From 6a62be653c5d35d4f7fb2b01487bf4507f23e68a Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Sat, 16 Sep 2023 13:06:04 +0530 Subject: [PATCH] test: fix form --- .../pages/Dashboard/common/Cell/index.ts | 2 +- tests/playwright/pages/SharedForm/index.ts | 15 ++++++++++----- tests/playwright/tests/db/views/viewForm.spec.ts | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Cell/index.ts b/tests/playwright/pages/Dashboard/common/Cell/index.ts index 43b4c72f1a..a6ca7cf2ef 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/index.ts +++ b/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(); } } } diff --git a/tests/playwright/pages/SharedForm/index.ts b/tests/playwright/pages/SharedForm/index.ts index ce626f8cb7..756e08319e 100644 --- a/tests/playwright/pages/SharedForm/index.ts +++ b/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`); diff --git a/tests/playwright/tests/db/views/viewForm.spec.ts b/tests/playwright/tests/db/views/viewForm.spec.ts index 226a198c47..c4cfd6d7d4 100644 --- a/tests/playwright/tests/db/views/viewForm.spec.ts +++ b/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();