Skip to content

Commit 744e2ae

Browse files
committed
ci: run playwright tests
Signed-off-by: Simon Emms <simon@simonemms.com>
1 parent f1f119d commit 744e2ae

4 files changed

Lines changed: 27 additions & 6 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
}
1717
},
1818
"postCreateCommand": {
19-
"playwright": "npx --yes playwright install --with-deps"
19+
"playwright": "npx --yes playwright install --with-deps chromium"
2020
},
2121
"containerEnv": {
2222
"PLAYWRIGHT_HTML_HOST": "0.0.0.0",
2323
"PUBLIC_WORKFLOWS_DIR": "/workspaces/studio/workflows",
24-
"VITE_HOST": "0.0.0.0"
24+
"HOST": "0.0.0.0"
2525
},
2626
"forwardPorts": [
27-
5173
27+
5173,
28+
9323
2829
]
2930
}

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ jobs:
6565
- name: Checking
6666
run: npm run check
6767

68+
e2e:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v6
72+
73+
- uses: actions/setup-node@v6
74+
with:
75+
node-version: lts/*
76+
77+
- name: Install dependencies
78+
run: npm ci
79+
80+
- name: Install Playwright browsers
81+
run: npx playwright install --with-deps chromium
82+
83+
- name: End-to-end tests
84+
run: npm run test:e2e
85+
6886
helm:
6987
runs-on: ubuntu-latest
7088
steps:
@@ -151,6 +169,7 @@ jobs:
151169
runs-on: ubuntu-latest
152170
needs:
153171
- commitlint
172+
- e2e
154173
- helm
155174
- pre-commit
156175
- test

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"prepare": "svelte-kit sync || echo ''",
1717
"start": "node build",
1818
"test:e2e": "playwright test",
19+
"test:e2e:report": "playwright show-report --host 0.0.0.0",
1920
"test:e2e:ui": "playwright test --ui",
2021
"test:e2e:headed": "playwright test --headed",
2122
"test:e2e:debug": "playwright test --debug"

playwright.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default defineConfig({
2424
reporter: 'html',
2525

2626
use: {
27-
baseURL: 'http://localhost:5173',
27+
baseURL: 'http://127.0.0.1:5173',
2828
trace: 'on-first-retry',
2929
},
3030

@@ -39,8 +39,8 @@ export default defineConfig({
3939

4040
webServer: {
4141
command: 'npm run dev',
42-
url: 'http://localhost:5173',
43-
reuseExistingServer: true,
42+
url: 'http://127.0.0.1:5173',
43+
reuseExistingServer: !process.env.CI,
4444
timeout: 120_000,
4545
},
4646
});

0 commit comments

Comments
 (0)