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

Replace jest-puppeteer with Playwright #1884

Merged
merged 3 commits into from
Nov 6, 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
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
Loading