Skip to content

Commit aeb9466

Browse files
authored
Merge pull request #250 from wpengine/add-end-to-end-tests
test(previews): add end-to-end tests
2 parents 1087e94 + 6085a34 commit aeb9466

File tree

15 files changed

+22707
-808
lines changed

15 files changed

+22707
-808
lines changed

.github/workflows/e2e-test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Playwright End-to-End Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "plugins/hwp-previews/**"
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- "plugins/hwp-previews/**"
14+
15+
jobs:
16+
playwright-e2e-tests:
17+
runs-on: ubuntu-24.04
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "22"
27+
cache: "npm"
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Install composer
33+
run: composer install
34+
working-directory: plugins/hwp-previews
35+
36+
- name: Install playwright browsers
37+
run: npx playwright install --with-deps
38+
working-directory: plugins/hwp-previews
39+
40+
- name: Start wp-env
41+
run: |
42+
npm run wp-env start
43+
working-directory: plugins/hwp-previews
44+
45+
- name: Run Playwright tests
46+
run: npm run test:e2e
47+
working-directory: plugins/hwp-previews
48+
49+
- name: Stop wp-env
50+
run: npm run wp-env stop
51+
working-directory: plugins/hwp-previews

0 commit comments

Comments
 (0)