Skip to content

Commit 3912bf4

Browse files
committed
chore(playwright): add to github actions
1 parent ef93e4a commit 3912bf4

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/web-host.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
run: npm ci
2323
- name: Build
2424
run: npm run web-host:build
25+
- name: Install Playwright
26+
run: npx playwright install --with-deps
27+
working-directory: ./packages/web-host
28+
- name: e2e tests (playwright)
29+
run: WAIT_FOR_SERVER_AT_URL=http://localhost:4173/webassembly-component-model-experiments/ npm run test:e2e:all:preview
30+
- uses: actions/upload-artifact@v4
31+
if: ${{ !cancelled() }}
32+
with:
33+
name: playwright-report
34+
path: ./packages/web-host/playwright-report/
35+
retention-days: 30
2536
- name: Cache build artifacts
2637
id: cache-build-www-host
2738
uses: actions/cache@v4

packages/web-host/playwright.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,20 @@ export default defineConfig({
2828
/* Base URL to use in actions like `await page.goto('/')`. */
2929
baseURL:
3030
process.env.BASE_URL ||
31-
"http://localhost:5173/webassembly-component-model-experiments",
31+
"http://localhost:5173/webassembly-component-model-experiments/",
3232

3333
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3434
trace: "on-first-retry",
3535
},
36+
...(process.env.WAIT_FOR_SERVER_AT_URL
37+
? {
38+
webServer: {
39+
command: "npm run preview -- --strictPort",
40+
url: process.env.WAIT_FOR_SERVER_AT_URL,
41+
reuseExistingServer: true,
42+
},
43+
}
44+
: {}),
3645

3746
/* Configure projects for major browsers */
3847
projects: [

0 commit comments

Comments
 (0)