Skip to content

Commit 84de2b5

Browse files
authored
Merge pull request ryanwelcher#121 from ryanwelcher/feature/automated-test-playground
E2E Tests using Playground
2 parents 440220c + 47419a5 commit 84de2b5

17 files changed

+22632
-6
lines changed

.github/workflows/e2e.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: ['trunk']
6+
pull_request:
7+
branches: ['trunk']
8+
9+
jobs:
10+
e2e:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build Plugin
26+
run: composer run build && npm run build
27+
28+
- name: Setup Playwright
29+
run: npx playwright install --with-deps
30+
31+
- name: Run End-to-End tests
32+
run: npm run test:e2e
33+
34+
- name: Upload test results
35+
if: always() # Uploads artifacts even if tests fail
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: playwright-results
39+
path: test-results/

.github/workflows/static-linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
strategy:
2626
matrix:
27-
node-version: [14.x, 16.x, 18.x, 20.x]
27+
node-version: [16.x, 18.x, 20.x]
2828

2929
steps:
3030
- uses: actions/checkout@v3
@@ -39,4 +39,4 @@ jobs:
3939
env:
4040
CI: true
4141

42-
name: Javascript, CSS, and package.json
42+
name: Javascript

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
build
22
node_modules
3-
package-lock.json
43
.DS_Store
54
*.zip
65
DNU
@@ -10,3 +9,4 @@ composer.lock
109
.phpunit.*
1110
artifacts
1211
.vscode
12+
test-results

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/*
1+
v20.18.3

_blueprints/e2e-blueprint.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
3+
"constants": {
4+
"SCRIPT_DEBUG": true
5+
},
6+
"steps": [
7+
{
8+
"step": "activatePlugin",
9+
"pluginPath": "/wordpress/wp-content/plugins/advanced-query-loop/index.php"
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)