forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infrastructure for writing Playwright E2E tests (WordPress#38570)
* Add basic infrastructure of using @playwright/test * Fix comment of visitAdminPage * Add initial guideline for the migration * Mark e2e-test-utils-playwright as private for now * Fix link name * Mark e2e-tests as private and deprecate puppeteer packages Co-authored-by: Robert Anderson <robert@noisysocks.com>
- Loading branch information
Showing
46 changed files
with
2,465 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: End-to-End Tests Playwright | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
- 'wp/**' | ||
|
||
# Cancels all previous workflow runs for pull requests that have not completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name for pull requests | ||
# or the commit hash for any other events. | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
e2e: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: ['14'] | ||
|
||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 | ||
|
||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: npm | ||
|
||
- name: Npm install and build | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Install Playwright dependencies | ||
run: | | ||
npx playwright install chromium --with-deps | ||
- name: Install WordPress and start the server | ||
run: | | ||
npm run wp-env start | ||
- name: Run the tests | ||
run: | | ||
npm run test-e2e:playwright | ||
- name: Archive debug artifacts (screenshots, traces) | ||
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 | ||
if: always() | ||
with: | ||
name: failures-artifacts | ||
path: artifacts | ||
if-no-files-found: ignore | ||
|
||
- name: Archive flaky tests report | ||
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 | ||
if: always() | ||
with: | ||
name: flaky-tests-report | ||
path: flaky-tests | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.