Skip to content

Commit

Permalink
Migrate to Playwright from Puppeteer (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-grace authored Mar 19, 2024
1 parent 4425d16 commit 4249e11
Show file tree
Hide file tree
Showing 21 changed files with 1,001 additions and 2,272 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -51,14 +52,18 @@ jobs:
if: env.STAGE == 'REVIEW' || env.STAGE == 'STAGING'
- run: curl --insecure -4 --retry 7 --retry-connrefused http://localhost:3000 1>/dev/null
if: env.STAGE == 'REVIEW' || env.STAGE == 'STAGING'
- run: npm run test:e2e:headless
- name: Run Playwright tests
if: env.STAGE == 'REVIEW' || env.STAGE == 'STAGING'
uses: docker://mcr.microsoft.com/playwright:v1.42.1-jammy
with:
args: npx playwright test
- name: Store reports
if: (env.STAGE == 'REVIEW' || env.STAGE == 'STAGING') && failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: reports
path: reports/
retention-days: 3
- run: npm run deploy
if: github.repository_owner == 'microbit-foundation' && (env.STAGE == 'REVIEW' || success())
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ __pycache__
*.pyc
/reports/*
/crowdin/*
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ These are excluded from the normal test run.

The tests expect the app to already be running on http://localhost:3000, for example via `npm start`.

We use [Puppeteer](https://pptr.dev/) and the helpers provided by [Testing Library](https://testing-library.com/docs/pptr-testing-library/intro/).
We use [Playwright](https://playwright.dev/).

The CI tests run these end-to-end tests against a production build.

Expand Down
Loading

0 comments on commit 4249e11

Please sign in to comment.