Browse Source

feat(testing): Stability

pull/3848/head
Muhammed Mustafa 2 years ago
parent
commit
0454c0abdf
  1. 11
      scripts/playwright/pages/Dashboard/WebhookForm/index.ts

11
scripts/playwright/pages/Dashboard/WebhookForm/index.ts

@ -85,21 +85,30 @@ export class WebhookFormPage extends BasePage {
}) { }) {
await this.get().locator(`.nc-check-box-hook-condition`).click(); await this.get().locator(`.nc-check-box-hook-condition`).click();
const modal = await this.get().locator(`.menu-filter-dropdown`).last(); const modal = await this.get().locator(`.menu-filter-dropdown`).last();
// todo: All delays are for api calls that filter does, which rerenders
await this.rootPage.waitForTimeout(1000);
await modal.locator(`button:has-text("Add Filter")`).click(); await modal.locator(`button:has-text("Add Filter")`).click();
// todo: Integrate this with Filter page object or atleast wait for the api response(this part is flaky but barely) await this.rootPage.waitForTimeout(1500);
await modal.locator(".nc-filter-field-select").click(); await modal.locator(".nc-filter-field-select").click();
const modalField = await this.dashboard.rootPage.locator( const modalField = await this.dashboard.rootPage.locator(
".nc-dropdown-toolbar-field-list:visible" ".nc-dropdown-toolbar-field-list:visible"
); );
await modalField.locator(`.ant-select-item:has-text("${column}")`).click(); await modalField.locator(`.ant-select-item:has-text("${column}")`).click();
await this.rootPage.waitForTimeout(1500);
await modal.locator(".nc-filter-operation-select").click(); await modal.locator(".nc-filter-operation-select").click();
const modalOp = await this.dashboard.rootPage.locator( const modalOp = await this.dashboard.rootPage.locator(
".nc-dropdown-filter-comp-op:visible" ".nc-dropdown-filter-comp-op:visible"
); );
await modalOp.locator(`.ant-select-item:has-text("${operator}")`).click(); await modalOp.locator(`.ant-select-item:has-text("${operator}")`).click();
await this.rootPage.waitForTimeout(1500);
if (operator != "is null" && operator != "is not null") { if (operator != "is null" && operator != "is not null") {
await modal.locator("input.nc-filter-value-select").fill(value); await modal.locator("input.nc-filter-value-select").fill(value);
} }

Loading…
Cancel
Save