Skip to content

Commit

Permalink
Merge pull request #1884: Replace jest-puppeteer with Playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Nov 6, 2024
2 parents 540785d + f4ec004 commit 4e1ed7a
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 3,079 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm ci --loglevel verbose
- run: npm run get-data
- run: npm run smoke-test:ci
- run: npx playwright install chromium
- run: npm run smoke-test

lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ big_flu
s3/
/local_narratives/
/datasets/
**/__diff_output__

### OSX ###
.DS_Store
Expand All @@ -17,5 +16,8 @@ node_modules/
npm-debug.log
*tgz

### playwright ###
.playwright/

### IDE ###
.vscode/*
8 changes: 4 additions & 4 deletions DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ From a fork: `git pull --rebase upstream master`
We use the following libraries for all kinds of testing, so it'd help to read the docs to get familiar with their APIs and features:

1. [`Jest`](https://github.com/facebook/jest)
2. [`Puppeteer`](https://github.com/puppeteer/puppeteer/)
3. [`Jest-Puppeteer`](https://github.com/smooth-code/jest-puppeteer)
4. [`Jest-Image-Snapshot`](https://github.com/americanexpress/jest-image-snapshot)
2. [`Playwright`](https://playwright.dev)

When you submit a pull request to the auspice repository, certain tests will need to pass before it can be merged.

Expand All @@ -75,11 +73,13 @@ Run `npm run lint`. If there are issues run `npm run lint:fix`.

Auspice used to have integration testing using jest + puppeteer, however this was removed in [PR 1672](https://github.com/nextstrain/auspice/pull/1672).
Ideally this functionality will be brought back, and that PR would be a good place to start.
If embarking on this journey, consider using Playwright since it is already used for smoke tests.

#### For smoke tests

1. Fetch the datasets with `npm run get-data`.
2. Ensure you are **not** currently running the site locally, then run `npm run smoke-test:ci`.
2. Install the testing browser with `npx playwright install chromium`.
3. Run `npm run smoke-test`.


#### Test Tips
Expand Down
9 changes: 0 additions & 9 deletions jest-puppeteer.config.js

This file was deleted.

Loading

0 comments on commit 4e1ed7a

Please sign in to comment.