diff --git a/client/package.json b/client/package.json index 06bf44a6..06bb2824 100644 --- a/client/package.json +++ b/client/package.json @@ -12,7 +12,7 @@ "lint:fix": "eslint './src/**/*.(ts|tsx)' --fix", "test": "vitest --run", "test:watch": "vitest --watch", - "test:e2e": "cross-env DEBUG=pw:* npx playwright test tests/e2e", + "test:e2e": "npx playwright test tests/e2e", "test:e2e:interactive": "npx playwright test --ui", "test:e2e:debug": "npx playwright test --debug", "test:e2e:codegen": "npx playwright codegen", diff --git a/client/playwright.config.ts b/client/playwright.config.ts index 50d8171b..7ededa8d 100644 --- a/client/playwright.config.ts +++ b/client/playwright.config.ts @@ -76,6 +76,6 @@ export default defineConfig({ url: 'http://127.0.0.1:3000', cwd: '..', reuseExistingServer: !process.env.CI, - timeout: 60000, + timeout: 10000, }, }); diff --git a/client/tests/e2e/globalSetup.ts b/client/tests/e2e/globalSetup.ts index 05f18f3d..248174dc 100644 --- a/client/tests/e2e/globalSetup.ts +++ b/client/tests/e2e/globalSetup.ts @@ -8,20 +8,25 @@ async function globalSetup(config: FullConfig) { }); const page = await browser.newPage({ baseURL: config.webServer?.url }); - await page.goto('/'); - await page.getByTestId('install_get_started').click(); - await page.getByTestId('install_web_port').fill(PORT.toString()); - await page.getByTestId('install_next').click(); - await page.getByTestId('install_username').fill(ADMIN_USERNAME); - await page.getByTestId('install_password').fill(ADMIN_PASSWORD); - await page.getByTestId('install_confirm_password').click(); - await page.getByTestId('install_confirm_password').fill(ADMIN_PASSWORD); - await page.getByTestId('install_next').click(); - await page.getByTestId('install_next').click(); - await page.getByTestId('install_open_dashboard').click(); - await page.waitForURL((url) => !url.href.endsWith('/install.html')); - - await browser.close(); + try { + await page.goto('/'); + await page.getByTestId('install_get_started').click(); + await page.getByTestId('install_web_port').fill(PORT.toString()); + await page.getByTestId('install_next').click(); + await page.getByTestId('install_username').fill(ADMIN_USERNAME); + await page.getByTestId('install_password').fill(ADMIN_PASSWORD); + await page.getByTestId('install_confirm_password').click(); + await page.getByTestId('install_confirm_password').fill(ADMIN_PASSWORD); + await page.getByTestId('install_next').click(); + await page.getByTestId('install_next').click(); + await page.getByTestId('install_open_dashboard').click(); + await page.waitForURL((url) => !url.href.endsWith('/install.html')); + } catch (error) { + console.error('Error during global setup:', error); + await page.screenshot({ path: 'error_screenshot.png' }); + } finally { + await browser.close(); + } } export default globalSetup;