Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rock] Add playwright #1094

Merged
merged 15 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ cypress.json
.releaserc.yml
docker-compose.ci.yml
CONTRIBUTING.md
artifacts
31 changes: 17 additions & 14 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ concurrency:
cancel-in-progress: true
jobs:
e2e:
name: E2E for ${{ matrix.env }}
name: Playwright E2E tests
env:
DOCKER_FILE: docker-compose.ci.yml
strategy:
fail-fast: false
matrix:
env: ["default","gutenberg", "gutenberg-datatable"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: "18"
- uses: actions/cache@v2
id: npm-and-build-cache
with:
Expand All @@ -32,20 +30,25 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Install npm deps
run: npm ci
run: |
npm ci
npm install -g playwright-cli
npx playwright install --with-deps chromium
- name: Install composer deps
run: composer install --no-dev
- name: Install environment
run: |
npm run up:ci
bash ./bin/run-e2e-tests-${{matrix.env}}.sh
- name: Run ${{ matrix.env }} Cypress tests
npm run env:up
- name: Run the tests
run: |
npm run test:e2e:playwright
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
uses: cypress-io/github-action@v2
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v4
with:
env: host=localhost,port=8080
browser: chrome
install: ${{ ! steps.npm-and-build-cache.outputs.cache-hit }}
headless: true
spec: cypress/integration/${{ matrix.env }}/**/*
name: e2e-playwright-results
path: artifacts
retention-days: 1
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ cypress.env.json
.DS_Store
/cypress/videos/
/cypress/screenshots/
artifacts
7 changes: 4 additions & 3 deletions bin/cli-setup.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

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

# activate
wp --allow-root plugin activate visualizer
wp --allow-root theme activate twentynineteen
wp --allow-root theme activate twentytwentyone

# set this constant so that the specific hooks are loaded
wp --allow-root config set TI_CYPRESS_TESTING true --raw
Expand Down
Loading
Loading