Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"WebFetch(domain:api.github.com)"
]
}
}
61 changes: 61 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: E2E Tests

on:
pull_request:
branches: [ trunk, develop ]

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install Composer dependencies
run: composer install --no-dev --no-progress --prefer-dist

- name: Install npm dependencies
run: npm ci --force

- name: Build plugin assets
run: npm run build

- name: Install Playwright Chromium
run: npx playwright install chromium --with-deps

- name: Start wp-env
run: npx wp-env start

- name: Run E2E tests
env:
WP_BASE_URL: http://localhost:8888
WP_USERNAME: admin
WP_PASSWORD: password
run: npm run test:e2e

- name: Stop wp-env
if: always()
run: npx wp-env stop

- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results
path: |
test-results/
playwright-report/
retention-days: 7
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
build/*
!build/index.php

# Playwright
test-results/
playwright-report/
tests/e2e/artifacts/
tests/e2e/.env

# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows,node,yarn,composer,phpstorm+all,visualstudiocode,sublimetext
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows,node,yarn,composer,phpstorm+all,visualstudiocode,sublimetext

Expand Down
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"core": null,
"phpVersion": "8.2",
"phpVersion": "8.3",
"plugins": [ "." ],
"config": {
"WP_DEBUG": true,
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
},
"require-dev": {
"a8cteam51/team51-configs": "dev-trunk",

"wp-coding-standards/wpcs": "3.1.*",
"phpcompatibility/phpcompatibility-wp": "*",

"roave/security-advisories": "dev-latest",

"phpunit/phpunit": "^9.6",
"yoast/phpunit-polyfills": "^2.0"
},
Expand All @@ -38,18 +35,20 @@

"format:php": "phpcbf --basepath=. . -v",
"lint:php": "phpcs --basepath=. . -v",

"packages-install": "@composer install --ignore-platform-reqs --no-interaction",
"packages-update": [
"@composer clear-cache",
"@composer update --prefer-stable --no-interaction"
]
},
"config": {
"platform": {
"php": "8.3"
},
"allow-plugins": {
"composer/*": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
}
}
}
Loading
Loading