Skip to content

Commit e365ad5

Browse files
committed
Run the playwright tests on both 'astro dev' and the production built server.
1 parent 7f6decd commit e365ad5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ defaults:
77
working-directory: webserver
88
jobs:
99
playwright:
10+
strategy:
11+
matrix:
12+
environment: [dev, prod]
1013
timeout-minutes: 60
1114
runs-on: ubuntu-latest
1215
container:
@@ -48,6 +51,7 @@ jobs:
4851
run: pnpm exec playwright test
4952
env:
5053
DEBUG: "pw:webserver"
54+
ENVIRONMENT: ${{ matrix.environment }}
5155
- uses: actions/upload-artifact@v4
5256
if: failure()
5357
with:

webserver/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ const config: PlaywrightTestConfig = {
5252

5353
/* Run your local dev server before starting the tests */
5454
webServer: {
55-
command: (process.env.CI || process.env.SKIP_BUILD ? '' : 'pnpm build && ') + 'PORT=4321 pnpm start',
55+
command: (process.env.ENVIRONMENT === 'dev' ? 'PORT=4321 pnpm dev' :
56+
(process.env.CI || process.env.SKIP_BUILD ? '' : 'pnpm build && ') + 'PORT=4321 pnpm start'),
5657
url: "http://localhost:4321/",
5758
reuseExistingServer: !process.env.CI
5859
},

0 commit comments

Comments
 (0)