Browse Source

fix: Kanban test issue

pull/6376/head
Muhammed Mustafa 11 months ago
parent
commit
95c5243089
  1. 5
      tests/playwright/pages/Base.ts
  2. 2
      tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  3. 1
      tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts

5
tests/playwright/pages/Base.ts

@ -23,18 +23,21 @@ export default abstract class BasePage {
requestUrlPathToMatch,
// A function that takes the response body and returns true if the response is the one we are looking for
responseJsonMatcher,
timeout,
}: {
uiAction: () => Promise<any>;
requestUrlPathToMatch: string;
httpMethodsToMatch?: string[];
responseJsonMatcher?: ResponseSelector;
timeout?: number;
}) {
const [res] = await Promise.all([
this.rootPage.waitForResponse(
res =>
res.url().includes(requestUrlPathToMatch) &&
res.status() === 200 &&
httpMethodsToMatch.includes(res.request().method())
httpMethodsToMatch.includes(res.request().method()),
timeout ? { timeout } : undefined
),
uiAction(),
]);

2
tests/playwright/pages/Dashboard/ViewSidebar/index.ts

@ -91,6 +91,8 @@ export class ViewSidebarPage extends BasePage {
async createKanbanView({ title }: { title: string }) {
await this.createView({ title, locator: this.createKanbanButton });
await this.rootPage.waitForTimeout(1500);
}
async createMapView({ title }: { title: string }) {

1
tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts

@ -71,6 +71,7 @@ export class ToolbarFieldsPage extends BasePage {
uiAction: () => this.get().locator(`.nc-fields-show-all-fields`).click(),
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
timeout: 10000,
});
await this.toolbar.clickFields();
}

Loading…
Cancel
Save