Browse Source

feat(testing): Stability

pull/3848/head
Muhammed Mustafa 2 years ago
parent
commit
6ad4c48ae1
  1. 8
      scripts/playwright/pages/Dashboard/common/ProjectMenu/index.ts
  2. 9
      scripts/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  3. 2
      scripts/playwright/tests/01-webhook.spec.ts
  4. 5
      scripts/playwright/tests/baseShare.spec.ts
  5. 2
      scripts/playwright/tests/rolesCreate.spec.ts
  6. 1
      scripts/playwright/tests/viewKanban.spec.ts

8
scripts/playwright/pages/Dashboard/common/ProjectMenu/index.ts

@ -33,4 +33,12 @@ export class ProjectMenuObject extends BasePage {
await this.rootPage.waitForTimeout(1000);
}
}
async clickPreview(role: string) {
await this.click({
menu: "Preview as",
subMenu: role,
});
await this.rootPage.waitForTimeout(2500);
}
}

9
scripts/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -50,13 +50,16 @@ export class ToolbarFilterPage extends BasePage {
}) {
await this.toolbar.clickFilter();
// todo: If the filter menu is open for the first time for the table, there can will be a api call which will re render the filter menu
await this.rootPage.waitForTimeout(1000);
await this.get().locator(`button:has-text("Add Filter")`).first().click();
await this.rootPage.locator(".nc-filter-field-select").last().click();
const selectColumn = this.rootPage
.locator("div.ant-select-dropdown.nc-dropdown-toolbar-field-list")
.locator(`div[label="${columnTitle}"][aria-selected="false"]:visible`)
.click();
.locator("div.ant-select-dropdown.nc-dropdown-toolbar-field-list")
.locator(`div[label="${columnTitle}"][aria-selected="false"]:visible`)
.click();
await this.waitForResponse({
uiAction: selectColumn,
httpMethodsToMatch: isLocallySaved ? [ "GET" ] : ["POST", "PATCH" ],

2
scripts/playwright/tests/01-webhook.spec.ts

@ -167,6 +167,8 @@ test.describe.serial("Webhook", async () => {
});
test("webhook Conditional webhooks", async ({ request }) => {
test.slow();
await clearServerData({ request });
// close 'Team & Auth' tab
await dashboard.closeTab({ title: "Team & Auth" });

5
scripts/playwright/tests/baseShare.spec.ts

@ -13,6 +13,9 @@ test.describe("Shared base", () => {
let projectPage: ProjectsPage;
async function roleTest(role: string) {
// todo: Wait till the page is loaded
await dashboard.rootPage.waitForTimeout(2000);
await dashboard.validateProjectMenu({
role: role.toLowerCase(),
mode: "shareBase",
@ -63,6 +66,7 @@ test.describe("Shared base", () => {
// access shared base link
await dashboard.signOut();
// todo: Move this to a page object
await dashboard.rootPage.goto(url);
await roleTest("editor");
@ -83,6 +87,7 @@ test.describe("Shared base", () => {
// access shared base link
await dashboard.signOut();
// todo: Move this to a page object
await dashboard.rootPage.goto(url);
await roleTest("viewer");

2
scripts/playwright/tests/rolesCreate.spec.ts

@ -32,7 +32,7 @@ test.describe("User roles", () => {
});
test("Create role", async () => {
test.setTimeout(150000);
test.slow();
// close 'Team & Auth' tab
await dashboard.closeTab({ title: "Team & Auth" });

1
scripts/playwright/tests/viewKanban.spec.ts

@ -149,6 +149,7 @@ test.describe("View", () => {
});
test("Kanban view operations", async () => {
test.slow();
// close 'Team & Auth' tab
await dashboard.closeTab({ title: "Team & Auth" });
await dashboard.treeView.openTable({ title: "Film" });

Loading…
Cancel
Save