Skip to content

Commit

Permalink
Update playwright + deps install
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinepouille committed Nov 5, 2024
1 parent b4b8f95 commit 5c3e3b1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ jobs:
npm ci
sudo apt-get update
sudo apt-get install lighttpd
sudo npm install -D @playwright/test@latest
npm install --save-dev @types/node @types/yauzl
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Download online-ui
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"@playwright/test": "^1.47.2",
"@playwright/test": "^1.48.2",
"@types/node": "^22.7.4",
"@types/yauzl": "^2.10.3"
},
Expand Down
19 changes: 13 additions & 6 deletions tests/playwright/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
This directory contains the webapp tests, that use playwright.

### Install deps
### Install/update playwright

Regularly update playwright to test on up to date browsers, and match the CI version.

```sh
npm install --save-dev @types/node @types/yauzl
npm install -D @playwright/test@latest
npx playwright install --with-deps
```

### Recompute screenshots and downloaded exports
### Install deps

```sh
UPDATE_EXPORTS=true npx playwright test --update-snapshots --project firefox
npm install --save-dev @types/node @types/yauzl
```

for a given test or test group
### Recompute screenshots and downloaded exports

`UPDATE_EXPORTS=true` is similar to playwright `--update-snapshots`, but for downloaded files

```sh
UPDATE_EXPORTS=true npx playwright procedure.spec.ts:449 files --update-snapshots --project firefox
UPDATE_EXPORTS=true npx playwright test --update-snapshots
UPDATE_EXPORTS=true npx playwright test --update-snapshots --project firefox
UPDATE_EXPORTS=true npx playwright test procedure.spec.ts:449 --update-snapshots
```
4 changes: 3 additions & 1 deletion tests/playwright/procedure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,9 @@ test.describe('projects_and_files', () => {
);
await utils.wait_for_file_load(page, { timeout: 10000 });
const contact_map = page.locator('#map-container');
await expect.soft(contact_map).toHaveScreenshot();

const opts_screen = { threshold: 0.2, maxDiffPixels: 150 }
await expect.soft(contact_map).toHaveScreenshot(opts_screen);

// TODO: fix this flaky test: sometimes the graph doesn't show, bug?
// simulate and test screenshot
Expand Down
Binary file modified tests/playwright/refs/plot_firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c3e3b1

Please sign in to comment.