|
|
|
@ -146,8 +146,24 @@ export class FormPage extends BasePage {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async configureHeader(param: { subtitle: string; title: string }) { |
|
|
|
|
await this.formHeading.fill(param.title); |
|
|
|
|
await this.formSubHeading.fill(param.subtitle); |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: async () => { |
|
|
|
|
await this.formHeading.click(); |
|
|
|
|
await this.formHeading.fill(param.title); |
|
|
|
|
await this.formSubHeading.click(); |
|
|
|
|
}, |
|
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/forms', |
|
|
|
|
httpMethodsToMatch: ['PATCH'], |
|
|
|
|
}); |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: async () => { |
|
|
|
|
await this.formSubHeading.click(); |
|
|
|
|
await this.formSubHeading.fill(param.subtitle); |
|
|
|
|
await this.formHeading.click(); |
|
|
|
|
}, |
|
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/forms', |
|
|
|
|
httpMethodsToMatch: ['PATCH'], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async verifyHeader(param: { subtitle: string; title: string }) { |
|
|
|
@ -177,14 +193,21 @@ export class FormPage extends BasePage {
|
|
|
|
|
label: string; |
|
|
|
|
helpText: string; |
|
|
|
|
}) { |
|
|
|
|
const waitForResponse = async (action: () => Promise<any>) => |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: action, |
|
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/form-columns', |
|
|
|
|
httpMethodsToMatch: ['PATCH'], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
await this.get() |
|
|
|
|
.locator(`.nc-form-drag-${field.replace(' ', '')}`) |
|
|
|
|
.locator('div[data-testid="nc-form-input-label"]') |
|
|
|
|
.click(); |
|
|
|
|
await this.getFormFieldsInputLabel().fill(label); |
|
|
|
|
await this.getFormFieldsInputHelpText().fill(helpText); |
|
|
|
|
await waitForResponse(() => this.getFormFieldsInputLabel().fill(label)); |
|
|
|
|
await waitForResponse(() => this.getFormFieldsInputHelpText().fill(helpText)); |
|
|
|
|
if (required) { |
|
|
|
|
await this.getFormFieldsRequired().click(); |
|
|
|
|
await waitForResponse(() => this.getFormFieldsRequired().click()); |
|
|
|
|
} |
|
|
|
|
await this.formHeading.click(); |
|
|
|
|
} |
|
|
|
@ -241,7 +264,14 @@ export class FormPage extends BasePage {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async configureSubmitMessage(param: { message: string }) { |
|
|
|
|
await this.afterSubmitMsg.fill(param.message); |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: async () => { |
|
|
|
|
await this.afterSubmitMsg.click(); |
|
|
|
|
await this.afterSubmitMsg.fill(param.message); |
|
|
|
|
}, |
|
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/forms', |
|
|
|
|
httpMethodsToMatch: ['PATCH'], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
submitAnotherForm() { |
|
|
|
|