Skip to content

Commit

Permalink
test: use more recent playwright-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
altano committed Nov 12, 2024
1 parent 1283ef3 commit 6716bd1
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 148 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
- name: Dump Playwright Information
run: |
eval "$(devbox shellenv)"
echo "Playwright: `devbox run pnpm exec playwright --version`"
echo "PLAYWRIGHT_BROWSERS_PATH=$PLAYWRIGHT_BROWSERS_PATH"
eval "$(devbox global shellenv)"
printenv | grep PLAYWRIGHT
echo "playwright version: `devbox run playwright --version`"
echo "@playwright/test version: `devbox run pnpm ls -r @playwright/test`"
- name: Validate and Build
run: |
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Read the [Devbox quickstart](https://jetpack.io/devbox/docs/contributor-quicksta
The Playwright setup in this repository is a little finicky. When updating the version:

- The version of `@playwright/test` in any package.json must be kept in sync with `playwright-driver` in `devbox.json`. Both should be precisely hard-coded (no semver ranges or `'latest'`).
- The nixpkgs hash in `devbox.lock` for `playwright-driver.browsers` must be manually changed to match the hash for the `playwright-driver` entry or the browsers will be the wrong version and tests will fail.

## Contributing

Expand Down
14 changes: 9 additions & 5 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
"difftastic@latest",
"git-branchless@latest",
"git@latest",
"github:NixOS/nixpkgs/5af0e374e7477769d662d5c4f6ba1b899a227b92#ffmpeg",
"github:NixOS/nixpkgs/5af0e374e7477769d662d5c4f6ba1b899a227b92#playwright-driver.browsers",
"github:NixOS/nixpkgs/5af0e374e7477769d662d5c4f6ba1b899a227b92#playwright-driver",
"github:NixOS/nixpkgs/5af0e374e7477769d662d5c4f6ba1b899a227b92#playwright-test",
"graphite-cli@latest",
"mercurialFull@latest",
"nodejs@20.11.1",
"playwright-driver.browsers",
"playwright-driver@1.47.0",
"sapling@latest",
"subversion@latest",
"tree@latest",
"graphite-cli@latest"
"tree@latest"
],
"env": {
"DEVBOX_COREPACK_ENABLED": "true",
"PLAYWRIGHT_BROWSERS_PATH": "$DEVBOX_PACKAGES_DIR",
"PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD": "1",
"PLAYWRIGHT_BROWSERS_PATH": "$DEVBOX_PACKAGES_DIR"
"PLAYWRIGHT_SKIP_BROWSER_GC": "1",
"PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS": "true"
}
}
62 changes: 0 additions & 62 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -330,68 +330,6 @@
}
}
},
"playwright-driver.browsers": {
"resolved": "github:NixOS/nixpkgs/d4f247e89f6e10120f911e2e2d2254a050d0f732#playwright-driver.browsers",
"source": "nixpkg",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"path": "/nix/store/j6fdya2dais8j41msnrhkahkmrd8dch7-playwright-browsers-1.47.0",
"default": true
}
]
}
}
},
"playwright-driver@1.47.0": {
"last_modified": "2024-10-13T23:44:06Z",
"resolved": "github:NixOS/nixpkgs/d4f247e89f6e10120f911e2e2d2254a050d0f732#playwright-driver",
"source": "devbox-search",
"version": "1.47.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/85kk5v8633iackwhg84nbv1wrcnqzm67-playwright-core-1.47.0",
"default": true
}
],
"store_path": "/nix/store/85kk5v8633iackwhg84nbv1wrcnqzm67-playwright-core-1.47.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/3kz4qnn7bwbcr5hc36q2wx9phibjlqzc-playwright-core-1.47.0",
"default": true
}
],
"store_path": "/nix/store/3kz4qnn7bwbcr5hc36q2wx9phibjlqzc-playwright-core-1.47.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/981kzim3k612rqq0qdjdmp4xlvmdr313-playwright-core-1.47.0",
"default": true
}
],
"store_path": "/nix/store/981kzim3k612rqq0qdjdmp4xlvmdr313-playwright-core-1.47.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4bxajgf2aibkxkzqq7pf2ad1hzjs6aw6-playwright-core-1.47.0",
"default": true
}
],
"store_path": "/nix/store/4bxajgf2aibkxkzqq7pf2ad1hzjs6aw6-playwright-core-1.47.0"
}
}
},
"sapling@latest": {
"last_modified": "2024-08-14T11:41:26Z",
"resolved": "github:NixOS/nixpkgs/0cb2fd7c59fed0cd82ef858cbcbdb552b9a33465#sapling",
Expand Down
32 changes: 11 additions & 21 deletions packages/satori-fit-text/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,19 @@ export default defineConfig({
},

/* Configure projects for major browsers */
projects: isCI
? [
// we can enable firefox/webkit when they ship in the `playwright-driver`
// nix linux derivation
//
// https://discourse.nixos.org/t/playwright-tests-on-multiple-browsers/41309
projects.chromium,
]
: [
projects.chromium,
projects.webkit,
projects: [
projects.chromium,
projects.firefox,
projects.webkit,

// satori doesn't currently work in Firefox without a polyfill
// projects.firefox,
/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,

/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,

/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],
/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],

/* Run your local dev server before starting the tests */
webServer: {
Expand Down
30 changes: 11 additions & 19 deletions packages/textfit/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,19 @@ export default defineConfig({
},

/* Configure projects for major browsers */
projects: isCI
? [
// we can enable firefox/webkit when they ship in the `playwright-driver`
// nix linux derivation
//
// https://discourse.nixos.org/t/playwright-tests-on-multiple-browsers/41309
projects.chromium,
]
: [
projects.chromium,
projects.webkit,
projects.firefox,
projects: [
projects.chromium,
projects.firefox,
projects.webkit,

/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,
/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,

/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],
/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],

/* Run your local dev server before starting the tests */
webServer: {
Expand Down
30 changes: 11 additions & 19 deletions packages/use-toc-visible-sections/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,19 @@ export default defineConfig({
},

/* Configure projects for major browsers */
projects: isCI
? [
// we can enable firefox/webkit when they ship in the `playwright-driver`
// nix linux derivation
//
// https://discourse.nixos.org/t/playwright-tests-on-multiple-browsers/41309
projects.chromium,
]
: [
projects.chromium,
projects.firefox,
projects.webkit,
projects: [
projects.chromium,
projects.firefox,
projects.webkit,

/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,
/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,

/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],
/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],

/* Run your local dev server before starting the tests */
webServer: {
Expand Down
30 changes: 11 additions & 19 deletions packages/use-visible-elements/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,19 @@ export default defineConfig({
},

/* Configure projects for major browsers */
projects: isCI
? [
// we can enable firefox/webkit when they ship in the `playwright-driver`
// nix linux derivation
//
// https://discourse.nixos.org/t/playwright-tests-on-multiple-browsers/41309
projects.chromium,
]
: [
projects.chromium,
projects.webkit,
projects.firefox,
projects: [
projects.chromium,
projects.firefox,
projects.webkit,

/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,
/* Test against mobile viewports. */
// projects.mobileChrome,
// projects.mobileSafari,

/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],
/* Test against branded browsers. */
// projects.edge,
// projects.chrome,
],

/* Run your local dev server before starting the tests */
webServer: {
Expand Down

0 comments on commit 6716bd1

Please sign in to comment.