Skip to content

Commit 5a4391d

Browse files
committed
Fix refactor to CI from DEBUG in playwright config
1 parent 99d008a commit 5a4391d

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎.github/instructions/general.instructions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ When a Playwright-native action (e.g., `page.click()`, `page.fill()`, `page.hove
7777
## E2E Testing Standards
7878

7979
- **NEVER hard-code content slugs in e2e tests** (e.g., `/articles/typescript-best-practices`, `/services/web-development`). Content can be deleted or renamed. Always dynamically fetch the first available item from listing pages (articles, services, case-studies, etc.) and navigate to it. This prevents test breakage when content changes.
80-
- **Playwright E2E Tests**: ALWAYS run with `CI=1` environment variable (e.g., `CI=1 npx playwright test`). This prevents the Playwright test runner from launching its own dev server. The user maintains a running dev server for development.
81-
- **NEVER run the full e2e test suite** unless explicitly requested by the user. The full suite is very resource intensive and takes over 10 minutes to run. Only run specific e2e test files when verification is needed (e.g., `CI=1 npx playwright test test/e2e/specific-file.spec.ts`).
80+
- **Playwright E2E Tests**: ALWAYS run with `CI=1` and `FORCE_COLOR=1` environment variables (e.g., `CI=1 FORCE_COLOR=1 npx playwright test`). This prevents the Playwright test runner from launching its own dev server. The user maintains a running dev server for development.
81+
- **NEVER run the full e2e test suite** unless explicitly requested by the user. The full suite is very resource intensive and takes over 10 minutes to run. Only run specific e2e test files when verification is needed (e.g., `CI=1 FORCE_COLOR=1 npx playwright test test/e2e/specific-file.spec.ts`).
8282
- **NEVER start a dev server yourself**. The user runs their own dev server for development. When you need a dev server running, notify the user instead of starting one.
8383

8484
### Astro View Transitions Testing

‎.github/instructions/testing.instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ applyTo: "**/*.spec.ts"
1414
## E2E Testing
1515

1616
- **NEVER hard-code content slugs** - fetch dynamically from listing pages
17-
- **Always run with `CI=1`** - e.g., `CI=1 npx playwright test test/e2e/file.spec.ts`
17+
- **Always run with `CI=1` and `FORCE_COLOR=1`** - e.g., `CI=1 FORCE_COLOR=1 npx playwright test test/e2e/file.spec.ts`
1818
- **NEVER run full e2e suite** unless requested - it takes 10+ minutes
1919
- **NEVER start dev server** - user maintains running server
2020
- **Use `BasePage.waitForPageLoad()`** to wait for `astro:page-load` event

‎playwright.config.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export default defineConfig({
3434
/* Run tests in files in parallel */
3535
fullyParallel: true,
3636
/* Fail the build on CI if you accidentally left test.only in the source code. */
37-
forbidOnly: !!process.env['CI'],
37+
forbidOnly: !!process.env['GITHUB_ACTIONS'],
3838
/* Retry on CI only */
39-
retries: process.env['CI'] ? 2 : 0,
39+
retries: process.env['GITHUB_ACTIONS'] ? 2 : 0,
4040
/* Opt out of parallel tests on CI. */
41-
workers: process.env['CI'] ? 1 : '75%',
41+
workers: process.env['GITHUB_ACTIONS'] ? 1 : '75%',
4242
/* Only run @ready tests in CI, all tests locally */
43-
...(process.env['CI'] ? { grep: /@ready/ } : {}),
43+
...(process.env['GITHUB_ACTIONS'] ? { grep: /@ready/ } : {}),
4444
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
45-
reporter: process.env['CI']
45+
reporter: process.env['GITHUB_ACTIONS']
4646
? 'github'
4747
: isCIMode
4848
? [

0 commit comments

Comments
 (0)