Browse Source

test: fix form

pull/6360/head
DarkPhoenix2704 1 year ago
parent
commit
6a62be653c
  1. 2
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 15
      tests/playwright/pages/SharedForm/index.ts
  3. 1
      tests/playwright/tests/db/views/viewForm.spec.ts

2
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -345,7 +345,7 @@ export class CellPageObject extends BasePage {
expect(await childList.count()).toBe(count);
// close child list
await this.rootPage.locator('.nc-modal-child-list').locator('button.ant-modal-close:visible').click();
await this.rootPage.locator('.nc-modal-child-list').locator('.nc-close-btn').last().click();
}
}
}

15
tests/playwright/pages/SharedForm/index.ts

@ -31,7 +31,13 @@ export class SharedFormPage extends BasePage {
}
async clickLinkToChildList() {
await this.get().locator('button[data-testid="nc-child-list-button-link-to"]').click();
await this.get().locator('.nc-virtual-cell').hover();
await this.get().locator('.nc-action-icon').click({ force: true });
//await this.get().locator('button[data-testid="nc-child-list-button-link-to"]').click();
}
async closeLinkToChildList() {
await this.get().locator('.nc-close-btn').click();
}
async verifyChildList(cardTitle?: string[]) {
@ -42,14 +48,13 @@ export class SharedFormPage extends BasePage {
// title: Link Record
// button: Add new record
// icon: reload
await expect(this.get().locator(`.ant-modal-title`)).toHaveText(`Link record`);
//await expect(this.get().locator(`.ant-modal-title`)).toHaveText(`Link record`);
// add new record option is not available for shared form
expect(await linkRecord.locator(`button:has-text("Add new record")`).isVisible()).toBeFalsy();
expect(await linkRecord.locator(`button:has-text("Link more records")`).isVisible()).toBeFalsy();
expect(await linkRecord.locator(`.nc-reload`).isVisible()).toBeTruthy();
// placeholder: Filter query
expect(await linkRecord.locator(`[placeholder="Filter query"]`).isVisible()).toBeTruthy();
expect(await linkRecord.locator('.nc-excluded-search').isVisible()).toBeTruthy();
{
const childList = linkRecord.locator(`.ant-card`);

1
tests/playwright/tests/db/views/viewForm.spec.ts

@ -363,6 +363,7 @@ test.describe('Form view with LTAR', () => {
await sharedForm.verifyChildList(['Atlanta', 'Pune', 'London', 'Sydney']);
await sharedForm.selectChildList('Atlanta');
await sharedForm.closeLinkToChildList();
await sharedForm.submit();
await sharedForm.verifySuccessMessage();

Loading…
Cancel
Save