From 8969ead3bf6119e4f106685d2331f81fa9fa98f0 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 22:44:36 -0600 Subject: [PATCH] Fix E2E tests: Use npm run start instead of preview to avoid double build --- .gitea/workflows/ci.yaml | 6 +++--- tests/e2e/axe.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 34f1528..f90a543 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -61,7 +61,7 @@ jobs: - run: npm run build # start app, wait, run tests - - run: npm run preview & + - run: npm run start & env: { CI: true } - run: npx wait-on http://localhost:3000 - run: npx playwright test --project=${{ matrix.browser }} @@ -90,7 +90,7 @@ jobs: - run: npm ci - run: npx playwright install --with-deps - run: npm run build - - run: npm run preview & + - run: npm run start & env: { CI: true } - run: npx wait-on http://localhost:3000 @@ -139,7 +139,7 @@ jobs: run: npm run build - name: Start application - run: npm run preview & + run: npm run start & env: { CI: true } - name: Wait for application diff --git a/tests/e2e/axe.ts b/tests/e2e/axe.ts index 317b23d..992a3d4 100644 --- a/tests/e2e/axe.ts +++ b/tests/e2e/axe.ts @@ -2,11 +2,13 @@ import { AxeBuilder } from "@axe-core/playwright"; export async function runA11y(page, options = {}) { const results = await new AxeBuilder({ page }) - .withTags(['wcag2a', 'wcag2aa']) + .withTags(["wcag2a", "wcag2aa"]) .analyze(); - + if (results.violations.length > 0) { - console.log('Accessibility violations found:', results.violations); - throw new Error(`Found ${results.violations.length} accessibility violations`); + console.log("Accessibility violations found:", results.violations); + throw new Error( + `Found ${results.violations.length} accessibility violations` + ); } }