Browse Source

fix(playwright): form test logic

pull/5328/head
Wing-Kam Wong 2 years ago
parent
commit
bf5d0f19c7
  1. 7
      tests/playwright/pages/Dashboard/Form/index.ts

7
tests/playwright/pages/Dashboard/Form/index.ts

@ -153,6 +153,9 @@ export class FormPage extends BasePage {
async fillForm(param: { field: string; value: string }[]) {
for (let i = 0; i < param.length; i++) {
await this.get()
.locator(`[data-testid="nc-form-input-${param[i].field.replace(' ', '')}"]`)
.click();
await this.get()
.locator(`[data-testid="nc-form-input-${param[i].field.replace(' ', '')}"] >> input`)
.fill(param[i].value);
@ -177,9 +180,7 @@ export class FormPage extends BasePage {
await this.getFormFieldsInputLabel().fill(label);
await this.getFormFieldsInputHelpText().fill(helpText);
if (required) {
await this.get()
.locator(`.nc-form-drag-${field.replace(' ', '')}`)
.click();
await this.getFormFieldsRequired().click();
}
await this.formHeading.click();
}

Loading…
Cancel
Save