Skip to content

Commit 358c4ba

Browse files
Merge pull request #1094 from Codeinwp/dev/playwright-migration
[Rock] Add playwright
2 parents cc48b80 + acfd39a commit 358c4ba

20 files changed

+65115
-10735
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ cypress.json
2727
.releaserc.yml
2828
docker-compose.ci.yml
2929
CONTRIBUTING.md
30+
artifacts

.github/workflows/test-e2e.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@ concurrency:
99
cancel-in-progress: true
1010
jobs:
1111
e2e:
12-
name: E2E for ${{ matrix.env }}
12+
name: Playwright E2E tests
1313
env:
1414
DOCKER_FILE: docker-compose.ci.yml
1515
strategy:
1616
fail-fast: false
17-
matrix:
18-
env: ["default","gutenberg", "gutenberg-datatable"]
1917
runs-on: ubuntu-latest
2018
steps:
2119
- uses: actions/checkout@v2
2220
- uses: actions/setup-node@v2
2321
with:
24-
node-version: '14'
22+
node-version: "18"
2523
- uses: actions/cache@v2
2624
id: npm-and-build-cache
2725
with:
@@ -32,20 +30,25 @@ jobs:
3230
restore-keys: |
3331
${{ runner.os }}-node-
3432
- name: Install npm deps
35-
run: npm ci
33+
run: |
34+
npm ci
35+
npm install -g playwright-cli
36+
npx playwright install --with-deps chromium
3637
- name: Install composer deps
3738
run: composer install --no-dev
3839
- name: Install environment
3940
run: |
40-
npm run up:ci
41-
bash ./bin/run-e2e-tests-${{matrix.env}}.sh
42-
- name: Run ${{ matrix.env }} Cypress tests
41+
npm run env:up
42+
- name: Run the tests
43+
run: |
44+
npm run test:e2e:playwright
4345
env:
4446
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
45-
uses: cypress-io/github-action@v2
47+
- name: Archive test results
48+
if: failure()
49+
uses: actions/upload-artifact@v4
4650
with:
47-
env: host=localhost,port=8080
48-
browser: chrome
49-
install: ${{ ! steps.npm-and-build-cache.outputs.cache-hit }}
50-
headless: true
51-
spec: cypress/integration/${{ matrix.env }}/**/*
51+
name: e2e-playwright-results
52+
path: artifacts
53+
retention-days: 1
54+
if-no-files-found: ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ cypress.env.json
1111
.DS_Store
1212
/cypress/videos/
1313
/cypress/screenshots/
14+
artifacts

bin/cli-setup.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

22
# install WP
3-
wp --allow-root core install --url="http://localhost:8080" --admin_user="wordpress" --admin_password="wordpress" --admin_email="[email protected]" --title="test" --skip-email
3+
wp --allow-root core install --url="http://localhost:8889" --admin_user="admin" --admin_password="password" --admin_email="[email protected]" --title="test" --skip-email
44
mkdir -p /var/www/html/wp-content/uploads
55
chmod -R 777 /var/www/html/wp-content/uploads/*
6-
wp --allow-root plugin install classic-editor --activate
6+
wp --allow-root plugin install classic-editor
7+
wp --allow-root theme install twentytwentyone
78

89
# activate
910
wp --allow-root plugin activate visualizer
10-
wp --allow-root theme activate twentynineteen
11+
wp --allow-root theme activate twentytwentyone
1112

1213
# set this constant so that the specific hooks are loaded
1314
wp --allow-root config set TI_CYPRESS_TESTING true --raw

0 commit comments

Comments
 (0)