Browse Source

feat(testing): Stabilized Relational column test

pull/3848/head
Muhammed Mustafa 2 years ago
parent
commit
bc00216e18
  1. 15
      scripts/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts
  2. 10
      scripts/playwright/tests/columnRelationalExtendedTests.spec.ts

15
scripts/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts

@ -10,6 +10,10 @@ export class ChildList extends BasePage {
this.dashboard = dashboard;
}
get() {
return this.dashboard.get().locator(`.nc-modal-child-list`);
}
async verify({
cardTitle,
linkField,
@ -65,7 +69,14 @@ export class ChildList extends BasePage {
await this.get().waitFor({ state: "hidden" });
}
get() {
return this.dashboard.get().locator(`.nc-modal-child-list`);
async openLinkRecord({ linkTableTitle }: { linkTableTitle: string }) {
const openActions = this.get()
.locator(`button:has-text("Link to '${linkTableTitle}'")`)
.click();
await this.waitForResponse({
requestUrlPathToMatch: '/exclude',
httpMethodsToMatch: ['GET'],
uiAction: openActions
});
}
}

10
scripts/playwright/tests/columnRelationalExtendedTests.spec.ts

@ -41,10 +41,7 @@ test.describe("Relational Columns", () => {
// open link record modal
//
await dashboard.childList
.get()
.locator(`button:has-text("Link to 'City'")`)
.click();
await dashboard.childList.openLinkRecord({linkTableTitle: 'City'})
await dashboard.linkRecord.verify([
"A Corua (La Corua)",
"Abha",
@ -111,10 +108,7 @@ test.describe("Relational Columns", () => {
// open link record modal
//
await dashboard.childList
.get()
.locator(`button:has-text("Link to 'Film'")`)
.click();
await dashboard.childList.openLinkRecord({linkTableTitle: 'Film'})
await dashboard.linkRecord.verify([
"ACE GOLDFINGER",
"ADAPTATION HOLES",

Loading…
Cancel
Save