diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a425c4f9..abd2d50f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,9 +42,7 @@ jobs: run: pnpm build - name: Run Playwright tests - run: | - pnpm preview & - pnpm test:e2e + run: pnpm test:e2e env: CI: true diff --git a/playwright.config.ts b/playwright.config.ts index fff68788..89202d15 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,8 +9,10 @@ export default defineConfig({ reporter: process.env.CI ? [['github'], ['list']] : 'list', use: { baseURL: 'http://localhost:3000', - trace: 'on-first-retry', - viewport: { width: 1920, height: 768 } + browserName: 'chromium', + permissions: ['clipboard-read', 'clipboard-write'], + trace: 'retain-on-failure', + viewport: { width: 1920, height: 1080 } }, projects: [ { @@ -19,7 +21,7 @@ export default defineConfig({ } ], webServer: { - command: 'pnpm run dev', + command: `pnpm ${process.env.CI ? 'preview' : 'dev'}`, url: 'http://localhost:3000', reuseExistingServer: !process.env.CI } diff --git a/vite.config.js b/vite.config.js index af1a94e5..1f6768db 100644 --- a/vite.config.js +++ b/vite.config.js @@ -18,6 +18,8 @@ export default defineConfig({ environment: 'jsdom', // in-source testing includeSource: ['src/**/*.{js,ts,svelte}'], + // Ignore E2E tests + exclude: ['tests/**/*'], setupFiles: ['./src/tests/setup.ts'], coverage: { exclude: ['src/mocks', '.svelte-kit', 'src/**/*.test.ts'],