Skip to content

Commit 281d9b2

Browse files
authored
feat: add playwright CI testing (#1542)
* add tests-browser package * rename to browser * add playwright and experiment with karma * add lock * remove karma * remove readme * replace default app, rename * add and configure playwright * up package-lock * use @waku/create-app, add scripts to handle it * remove tsconfig * update playwright script * move dependency to root * set folder * up * try install step * add playwright dep * remove step * add es module utils * fix import issue * run on master * use image prop * use dotenv-flow, set .env.local * add log, use dotenv-flow * add env var to ci * add env vars to CI * return install of deps * return container & log build step * upgrade @waku/create-app * fix firefox in container problem
1 parent a718c40 commit 281d9b2

14 files changed

+21638
-5149
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"**/*.spec.ts",
5050
"**/tests/**",
5151
"**/rollup.config.js",
52+
"**/playwright.config.ts",
5253
"**/.eslintrc.cjs",
5354
"**/karma.conf.cjs"
5455
]

.github/workflows/playwright.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Playwright tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
NODE_JS: "18"
11+
EXAMPLE_TEMPLATE: "web-chat"
12+
EXAMPLE_NAME: "example"
13+
EXAMPLE_PORT: "8080"
14+
# Firefox in container fails due to $HOME not being owned by user running commands
15+
# more details https://github.com/microsoft/playwright/issues/6500
16+
HOME: "/root"
17+
18+
jobs:
19+
test:
20+
timeout-minutes: 60
21+
runs-on: ubuntu-latest
22+
container:
23+
image: mcr.microsoft.com/playwright:v1.38.0-jammy
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ env.NODE_JS }}
29+
30+
- uses: ./.github/actions/npm
31+
32+
- name: Run Playwright tests
33+
run: npm run test --workspace=@waku/browser-tests
34+
35+
- uses: actions/upload-artifact@v3
36+
if: always()
37+
with:
38+
name: playwright-report
39+
path: playwright-report/
40+
retention-days: 30

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ coverage
99
*.log
1010
*.tsbuildinfo
1111
docs
12+
test-results
13+
playwright-report
14+
example

0 commit comments

Comments
 (0)