diff --git a/scripts/playwright/package.json b/scripts/playwright/package.json index 043f568d59..dc4ad0ef5c 100644 --- a/scripts/playwright/package.json +++ b/scripts/playwright/package.json @@ -4,8 +4,9 @@ "description": "", "main": "index.js", "scripts": { - "test": "npx playwright test", - "test-debug": "npx playwright test -c playwright.config.ts test --headed --project=chromium --repeat-each 1 --retries 0 --timeout 0 --workers 1 --max-failures=1" + "test": "npx playwright test --workers=6", + "test-debug": "PWDEBUG=console npx playwright test -c playwright.config.ts test --headed --project=chromium --repeat-each 1 --retries 0 --timeout 0 --workers 1 --max-failures=1", + "ci-test-mysql": "E2E_TYPE=mysql npx playwright test --workers=2" }, "keywords": [], "author": "", diff --git a/scripts/playwright/pages/ExpandedForm/index.ts b/scripts/playwright/pages/ExpandedForm/index.ts index 6dc72f232f..85db37a44a 100644 --- a/scripts/playwright/pages/ExpandedForm/index.ts +++ b/scripts/playwright/pages/ExpandedForm/index.ts @@ -33,6 +33,6 @@ export class ExpandedFormPage { await this.get().press('Escape'); await this.get().waitFor({state: 'hidden'}); await this.base.toastWait({message: `updated successfully.`}); - await this.page.waitForTimeout(400); + await this.page.locator('[pw-data="grid-load-spinner"]').waitFor({ state: 'hidden' }); } } \ No newline at end of file diff --git a/scripts/playwright/pages/Grid.ts b/scripts/playwright/pages/Grid.ts index 07603bbe8b..51f9b5951d 100644 --- a/scripts/playwright/pages/Grid.ts +++ b/scripts/playwright/pages/Grid.ts @@ -56,6 +56,7 @@ export class GridPage { // Click text=Delete Row await this.page.locator('text=Delete Row').click(); await this.page.locator('span.ant-dropdown-menu-title-content > nc-project-menu-item').waitFor({state: 'hidden'}); + await this.page.waitForTimeout(300); } async openExpandedRow({index}:{index: number}) { diff --git a/scripts/playwright/setup/index.ts b/scripts/playwright/setup/index.ts index b9c47327a9..4e5546ac1c 100644 --- a/scripts/playwright/setup/index.ts +++ b/scripts/playwright/setup/index.ts @@ -2,9 +2,11 @@ import { Page, TestInfo } from '@playwright/test'; import axios from 'axios'; import { DashboardPage } from '../pages/Dashboard'; -const setup = async ({page}: {page: Page}) => { +const setup = async ({page, typeOnLocalSetup}: {page: Page, typeOnLocalSetup?: string}) => { + const type = process.env.CI ? process.env.E2E_TYPE : typeOnLocalSetup; const response = await axios.post(`http://localhost:8080/api/v1/meta/test/reset`, { - parallelId: process.env.TEST_PARALLEL_INDEX + parallelId: process.env.TEST_PARALLEL_INDEX, + type: type ?? 'sqlite', }); if(response.status !== 200) {