Fix E2E tests: Use npm run start instead of preview to avoid double build
CI Pipeline / canary (pull_request) Successful in 0s
CI Pipeline / test (20) (pull_request) Successful in 1m58s
CI Pipeline / test (18) (pull_request) Successful in 2m8s
CI Pipeline / e2e (webkit) (pull_request) Has been cancelled
CI Pipeline / visual-regression (pull_request) Has been cancelled
CI Pipeline / performance (pull_request) Has been cancelled
CI Pipeline / storybook (pull_request) Has been cancelled
CI Pipeline / lint (pull_request) Has been cancelled
CI Pipeline / build (pull_request) Has been cancelled
CI Pipeline / e2e (chromium) (pull_request) Has been cancelled
CI Pipeline / e2e (firefox) (pull_request) Has been cancelled
CI Pipeline / canary (pull_request) Successful in 0s
CI Pipeline / test (20) (pull_request) Successful in 1m58s
CI Pipeline / test (18) (pull_request) Successful in 2m8s
CI Pipeline / e2e (webkit) (pull_request) Has been cancelled
CI Pipeline / visual-regression (pull_request) Has been cancelled
CI Pipeline / performance (pull_request) Has been cancelled
CI Pipeline / storybook (pull_request) Has been cancelled
CI Pipeline / lint (pull_request) Has been cancelled
CI Pipeline / build (pull_request) Has been cancelled
CI Pipeline / e2e (chromium) (pull_request) Has been cancelled
CI Pipeline / e2e (firefox) (pull_request) Has been cancelled
This commit is contained in:
@@ -61,7 +61,7 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
||||||
# start app, wait, run tests
|
# start app, wait, run tests
|
||||||
- run: npm run preview &
|
- run: npm run start &
|
||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
- run: npx wait-on http://localhost:3000
|
- run: npx wait-on http://localhost:3000
|
||||||
- run: npx playwright test --project=${{ matrix.browser }}
|
- run: npx playwright test --project=${{ matrix.browser }}
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npx playwright install --with-deps
|
- run: npx playwright install --with-deps
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run preview &
|
- run: npm run start &
|
||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
- run: npx wait-on http://localhost:3000
|
- run: npx wait-on http://localhost:3000
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Start application
|
- name: Start application
|
||||||
run: npm run preview &
|
run: npm run start &
|
||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
|
|
||||||
- name: Wait for application
|
- name: Wait for application
|
||||||
|
|||||||
+6
-4
@@ -2,11 +2,13 @@ import { AxeBuilder } from "@axe-core/playwright";
|
|||||||
|
|
||||||
export async function runA11y(page, options = {}) {
|
export async function runA11y(page, options = {}) {
|
||||||
const results = await new AxeBuilder({ page })
|
const results = await new AxeBuilder({ page })
|
||||||
.withTags(['wcag2a', 'wcag2aa'])
|
.withTags(["wcag2a", "wcag2aa"])
|
||||||
.analyze();
|
.analyze();
|
||||||
|
|
||||||
if (results.violations.length > 0) {
|
if (results.violations.length > 0) {
|
||||||
console.log('Accessibility violations found:', results.violations);
|
console.log("Accessibility violations found:", results.violations);
|
||||||
throw new Error(`Found ${results.violations.length} accessibility violations`);
|
throw new Error(
|
||||||
|
`Found ${results.violations.length} accessibility violations`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user