diff --git a/.changeset/timeout-names-pattern.md b/.changeset/timeout-names-pattern.md
new file mode 100644
index 0000000000..ba011f4470
--- /dev/null
+++ b/.changeset/timeout-names-pattern.md
@@ -0,0 +1,6 @@
+---
+"e2e": patch
+"@e2e-dev/web": patch
+---
+
+A fixture call that times out names what it waited for: `browser.waitForResponse('foo.css')` fails with `operation timed out in browser.waitForResponse "foo.css"`. Steps for `waitForURL`, `waitForResponse`, `route`, and `unroute` show a string pattern in quotes and a RegExp as its literal.
diff --git a/.fallowrc.json b/.fallowrc.json
index 7751fab329..541d166fdf 100644
--- a/.fallowrc.json
+++ b/.fallowrc.json
@@ -35,6 +35,7 @@
"examples/**",
"**/next-env.d.ts",
"**/.e2e/**",
+ "apps/testbed/app/playwright/assets/**",
"packages/e2e/tests/tmp-projects/**"
],
"ignoreDependencies": [
diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml
index e374d7aff3..c8a755eb8b 100644
--- a/.github/workflows/spec.yml
+++ b/.github/workflows/spec.yml
@@ -66,12 +66,17 @@ jobs:
- name: Install browsers
run: pnpm --filter @e2e-dev/web exec playwright-core install chromium --with-deps --only-shell
# On a pull request, Jev leaves out the tests the change can't affect;
- # the merge queue and main pass no --changed-since and run every test.
+ # a push to main passes no --changed-since and runs every test.
# Without the key (a fork's pull request), every test runs.
- name: Testbed
- run: pnpm --filter @e2e-dev/testbed test ${{ github.event_name == 'pull_request' && format('--changed-since origin/{0}', github.base_ref) || '' }}
+ run: pnpm --filter @e2e-dev/testbed test ${{ github.event_name == 'pull_request' && format('--changed-since origin/{0} --exclude-tag playwright', github.base_ref) || '' }}
env:
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
+ # The tests ported from Playwright pin the web engine's behavior, so a
+ # pull request runs all of them, not only the ones Jev picks.
+ - name: Testbed, Playwright tests
+ if: ${{ github.event_name == 'pull_request' }}
+ run: pnpm --filter @e2e-dev/testbed exec e2e run --tag playwright
test:
runs-on: blacksmith-4vcpu-ubuntu-2404
diff --git a/.oxlintrc.json b/.oxlintrc.json
index e257a33c61..0ece7fe2f6 100644
--- a/.oxlintrc.json
+++ b/.oxlintrc.json
@@ -16,6 +16,8 @@
"packages/*/tests/fixtures/**",
// Vendored conformance data, kept byte for byte.
"packages/*/tests/conformance/*/**",
+ // Playwright's test assets, kept byte for byte.
+ "apps/testbed/app/playwright/assets/**",
"packages/*/tests/tmp-projects/**",
// Standalone user-facing projects with their own installs; nothing here builds them.
"examples/**",
diff --git a/apps/testbed/.gitignore b/apps/testbed/.gitignore
index 0daf3d8941..d8320ed41d 100644
--- a/apps/testbed/.gitignore
+++ b/apps/testbed/.gitignore
@@ -14,3 +14,5 @@
# Verification skill scratch: bug-bash charter output and proofs kept past the next run.
.e2e/bugbash/
.e2e/proof/
+# Goldens the Playwright screenshot tests write while they run.
+tests/screenshot.e2e.ts-snapshots/
diff --git a/apps/testbed/README.md b/apps/testbed/README.md
index ff3dbbfd2d..1104a2011f 100644
--- a/apps/testbed/README.md
+++ b/apps/testbed/README.md
@@ -17,6 +17,9 @@ here.
`controls` (control states, scrolling, the browser fixture's page, the
speed counter, about). `app/pages/index.mjs` merges them and
`app/layout.mjs` renders the nav from that registry.
+- `app/playwright/`: Playwright's test assets (v1.64.1, Apache-2.0, with its
+ `LICENSE` and `NOTICE`) and the dynamic routes its test server sets, served
+ by the playground for any path it has no page for.
- `app/bug-garden.mjs` — a bookshop with planted defects, for `e2e explore`.
- `dogfood/server.mjs` — an expense-claims app with a test API, for the
executor dogfoods.
@@ -27,7 +30,14 @@ here.
states and the failure codes (`controls`), pointer coordinates and path
swipes (`pointer`), viewport and node scrolling (`scroll`), the `browser`
fixture's own verbs (`browser`), and the per-action speed floor (`speed`).
- `tests/helpers.ts` holds the shared `failure`, `boxOf`, and `centerOf`.
+ The files tagged `playwright` are Playwright's own `tests/page` specs (and
+ `tests/library/download.spec.ts`) at v1.64.1, ported to the public API:
+ each header names its source and the tests left out. `fail: 'reason'`
+ marks a known difference from Playwright; `skip: 'reason'` one that fails
+ with an error `fail` does not cover. `--tag playwright` runs only them, and
+ CI runs them on every pull request.
+ `tests/helpers.ts` holds the shared `failure`, `boxOf`, and `centerOf`,
+ and the ported tests' `content`, `asset`, `PREFIX`, and `CROSS`.
- `e2e.lightpanda.config.ts` and `e2e.lightpanda-agent.config.ts`: the
local suite and the agent suite on `@e2e-dev/lightpanda`, which starts
[Lightpanda](https://lightpanda.io) from `LIGHTPANDA_PATH` (or `PATH`),
diff --git a/apps/testbed/app/playwright/LICENSE b/apps/testbed/app/playwright/LICENSE
new file mode 100644
index 0000000000..4ace03ddb6
--- /dev/null
+++ b/apps/testbed/app/playwright/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Portions Copyright (c) Microsoft Corporation.
+ Portions Copyright 2017 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/apps/testbed/app/playwright/NOTICE b/apps/testbed/app/playwright/NOTICE
new file mode 100644
index 0000000000..814ec1696f
--- /dev/null
+++ b/apps/testbed/app/playwright/NOTICE
@@ -0,0 +1,5 @@
+Playwright
+Copyright (c) Microsoft Corporation
+
+This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
+available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
diff --git a/apps/testbed/app/playwright/assets/button-overlay-oopif.html b/apps/testbed/app/playwright/assets/button-overlay-oopif.html
new file mode 100644
index 0000000000..7e1f136fcd
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/button-overlay-oopif.html
@@ -0,0 +1,39 @@
+
+
diff --git a/apps/testbed/app/playwright/assets/chromium-linux.zip b/apps/testbed/app/playwright/assets/chromium-linux.zip
new file mode 100644
index 0000000000..9c00ec080d
Binary files /dev/null and b/apps/testbed/app/playwright/assets/chromium-linux.zip differ
diff --git a/apps/testbed/app/playwright/assets/consolelog.html b/apps/testbed/app/playwright/assets/consolelog.html
new file mode 100644
index 0000000000..9ef271812d
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/consolelog.html
@@ -0,0 +1,11 @@
+
+
+
+ console.log test
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/counter.html b/apps/testbed/app/playwright/assets/counter.html
new file mode 100644
index 0000000000..1e90289577
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/counter.html
@@ -0,0 +1,10 @@
+
+
+
count: 0
+
diff --git a/apps/testbed/app/playwright/assets/css-transition.html b/apps/testbed/app/playwright/assets/css-transition.html
new file mode 100644
index 0000000000..449c1548df
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/css-transition.html
@@ -0,0 +1,21 @@
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/digits/0.png b/apps/testbed/app/playwright/assets/digits/0.png
new file mode 100644
index 0000000000..ac3c4768ed
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/0.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/1.png b/apps/testbed/app/playwright/assets/digits/1.png
new file mode 100644
index 0000000000..6768222729
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/1.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/2.png b/apps/testbed/app/playwright/assets/digits/2.png
new file mode 100644
index 0000000000..b1daa4735d
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/2.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/3.png b/apps/testbed/app/playwright/assets/digits/3.png
new file mode 100644
index 0000000000..6eca99b21b
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/3.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/4.png b/apps/testbed/app/playwright/assets/digits/4.png
new file mode 100644
index 0000000000..a721071e2c
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/4.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/5.png b/apps/testbed/app/playwright/assets/digits/5.png
new file mode 100644
index 0000000000..15cb19932a
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/5.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/6.png b/apps/testbed/app/playwright/assets/digits/6.png
new file mode 100644
index 0000000000..639f38439d
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/6.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/7.png b/apps/testbed/app/playwright/assets/digits/7.png
new file mode 100644
index 0000000000..5c1150b005
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/7.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/8.png b/apps/testbed/app/playwright/assets/digits/8.png
new file mode 100644
index 0000000000..abb8b48b0b
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/8.png differ
diff --git a/apps/testbed/app/playwright/assets/digits/9.png b/apps/testbed/app/playwright/assets/digits/9.png
new file mode 100644
index 0000000000..6a40a21c6f
Binary files /dev/null and b/apps/testbed/app/playwright/assets/digits/9.png differ
diff --git a/apps/testbed/app/playwright/assets/dom.html b/apps/testbed/app/playwright/assets/dom.html
new file mode 100644
index 0000000000..25572912e7
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/dom.html
@@ -0,0 +1,5 @@
+
Text,
+more text
+
+
+
diff --git a/apps/testbed/app/playwright/assets/download-blob.html b/apps/testbed/app/playwright/assets/download-blob.html
new file mode 100644
index 0000000000..3c4a3d8133
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/download-blob.html
@@ -0,0 +1,29 @@
+
+
+
+ Blob Download Example
+
+
+
+ Download
+
+
diff --git a/apps/testbed/app/playwright/assets/empty.html b/apps/testbed/app/playwright/assets/empty.html
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/apps/testbed/app/playwright/assets/empty.pdf b/apps/testbed/app/playwright/assets/empty.pdf
new file mode 100644
index 0000000000..ed845a6372
Binary files /dev/null and b/apps/testbed/app/playwright/assets/empty.pdf differ
diff --git a/apps/testbed/app/playwright/assets/file to upload.txt b/apps/testbed/app/playwright/assets/file to upload.txt
new file mode 100644
index 0000000000..b4ad118489
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/file to upload.txt
@@ -0,0 +1 @@
+contents of the file
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/file-to-upload-2.txt b/apps/testbed/app/playwright/assets/file-to-upload-2.txt
new file mode 100644
index 0000000000..b4ad118489
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/file-to-upload-2.txt
@@ -0,0 +1 @@
+contents of the file
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/file-to-upload.txt b/apps/testbed/app/playwright/assets/file-to-upload.txt
new file mode 100644
index 0000000000..b4ad118489
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/file-to-upload.txt
@@ -0,0 +1 @@
+contents of the file
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/frames/child-redirect.html b/apps/testbed/app/playwright/assets/frames/child-redirect.html
new file mode 100644
index 0000000000..d4806e7f6b
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/child-redirect.html
@@ -0,0 +1 @@
+
diff --git a/apps/testbed/app/playwright/assets/frames/frame.html b/apps/testbed/app/playwright/assets/frames/frame.html
new file mode 100644
index 0000000000..3d3b943431
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/frame.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+
Hi, I'm frame
diff --git a/apps/testbed/app/playwright/assets/frames/frameset.html b/apps/testbed/app/playwright/assets/frames/frameset.html
new file mode 100644
index 0000000000..4d56f88839
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/frameset.html
@@ -0,0 +1,8 @@
+
diff --git a/apps/testbed/app/playwright/assets/frames/lazy-frame.html b/apps/testbed/app/playwright/assets/frames/lazy-frame.html
new file mode 100644
index 0000000000..f5e0e0914d
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/lazy-frame.html
@@ -0,0 +1,6 @@
+
One
+
Two
+
Three
+
Four
+
Five
+
diff --git a/apps/testbed/app/playwright/assets/frames/nested-frames.html b/apps/testbed/app/playwright/assets/frames/nested-frames.html
new file mode 100644
index 0000000000..d858d3285b
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/nested-frames.html
@@ -0,0 +1,30 @@
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/frames/one-frame.html b/apps/testbed/app/playwright/assets/frames/one-frame.html
new file mode 100644
index 0000000000..e941d795a2
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/one-frame.html
@@ -0,0 +1 @@
+
diff --git a/apps/testbed/app/playwright/assets/frames/redirect-my-parent.html b/apps/testbed/app/playwright/assets/frames/redirect-my-parent.html
new file mode 100644
index 0000000000..3beb0aac1a
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/redirect-my-parent.html
@@ -0,0 +1,3 @@
+
diff --git a/apps/testbed/app/playwright/assets/frames/script.js b/apps/testbed/app/playwright/assets/frames/script.js
new file mode 100644
index 0000000000..be22256d16
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/script.js
@@ -0,0 +1 @@
+console.log('Cheers!');
diff --git a/apps/testbed/app/playwright/assets/frames/style.css b/apps/testbed/app/playwright/assets/frames/style.css
new file mode 100644
index 0000000000..5b5436e874
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/style.css
@@ -0,0 +1,3 @@
+div {
+ color: blue;
+}
diff --git a/apps/testbed/app/playwright/assets/frames/two-frames.html b/apps/testbed/app/playwright/assets/frames/two-frames.html
new file mode 100644
index 0000000000..00324f0845
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/frames/two-frames.html
@@ -0,0 +1,16 @@
+
+
+
diff --git a/apps/testbed/app/playwright/assets/global-var.html b/apps/testbed/app/playwright/assets/global-var.html
new file mode 100644
index 0000000000..b6be975038
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/global-var.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/grid-iframe-in-shadow.html b/apps/testbed/app/playwright/assets/grid-iframe-in-shadow.html
new file mode 100644
index 0000000000..4649b27227
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/grid-iframe-in-shadow.html
@@ -0,0 +1,16 @@
+
+
diff --git a/apps/testbed/app/playwright/assets/grid.html b/apps/testbed/app/playwright/assets/grid.html
new file mode 100644
index 0000000000..8345f429bd
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/grid.html
@@ -0,0 +1,66 @@
+
+
+
diff --git a/apps/testbed/app/playwright/assets/historyapi.html b/apps/testbed/app/playwright/assets/historyapi.html
new file mode 100644
index 0000000000..bacaf9e9a0
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/historyapi.html
@@ -0,0 +1,5 @@
+
diff --git a/apps/testbed/app/playwright/assets/injectedstyle.css b/apps/testbed/app/playwright/assets/injectedstyle.css
new file mode 100644
index 0000000000..aa1634c255
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/injectedstyle.css
@@ -0,0 +1,3 @@
+body {
+ background-color: red;
+}
diff --git a/apps/testbed/app/playwright/assets/input/animating-button.html b/apps/testbed/app/playwright/assets/input/animating-button.html
new file mode 100644
index 0000000000..2946f2e89f
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/animating-button.html
@@ -0,0 +1,42 @@
+
+
diff --git a/apps/testbed/app/playwright/assets/input/background-fixed.html b/apps/testbed/app/playwright/assets/input/background-fixed.html
new file mode 100644
index 0000000000..5093939a5b
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/background-fixed.html
@@ -0,0 +1,16 @@
+
+
+
+
+
+
tall
+
+
diff --git a/apps/testbed/app/playwright/assets/input/button.html b/apps/testbed/app/playwright/assets/input/button.html
new file mode 100644
index 0000000000..bfce25ee00
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/button.html
@@ -0,0 +1,32 @@
+
+
+
+ Button test
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/checkbox.html b/apps/testbed/app/playwright/assets/input/checkbox.html
new file mode 100644
index 0000000000..ca56762e2b
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/checkbox.html
@@ -0,0 +1,42 @@
+
+
+
+ Selection Test
+
+
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/drag-n-drop-manual.html b/apps/testbed/app/playwright/assets/input/drag-n-drop-manual.html
new file mode 100644
index 0000000000..ee67aeb4d6
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/drag-n-drop-manual.html
@@ -0,0 +1,44 @@
+
+
+
+
+ Drop here
+
+
+ Drag me
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/fileupload-multi.html b/apps/testbed/app/playwright/assets/input/fileupload-multi.html
new file mode 100644
index 0000000000..05dd5a2237
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/fileupload-multi.html
@@ -0,0 +1,12 @@
+
+
+
+ File upload test
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/fileupload.html b/apps/testbed/app/playwright/assets/input/fileupload.html
new file mode 100644
index 0000000000..6486e5c288
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/fileupload.html
@@ -0,0 +1,12 @@
+
+
+
+ File upload test
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/folderupload.html b/apps/testbed/app/playwright/assets/input/folderupload.html
new file mode 100644
index 0000000000..16c7e2c3e9
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/folderupload.html
@@ -0,0 +1,12 @@
+
+
+
+ Folder upload test
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/handle-locator.html b/apps/testbed/app/playwright/assets/input/handle-locator.html
new file mode 100644
index 0000000000..5b164d5c7a
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/handle-locator.html
@@ -0,0 +1,91 @@
+
+
+
+ Interstitial test
+
+
+
+
+
A place on the side to hover
+
+
This interstitial covers the button
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/keyboard.html b/apps/testbed/app/playwright/assets/input/keyboard.html
new file mode 100644
index 0000000000..049ed439be
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/keyboard.html
@@ -0,0 +1,51 @@
+
+
+
+ Keyboard test
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/mouse-helper.js b/apps/testbed/app/playwright/assets/input/mouse-helper.js
new file mode 100644
index 0000000000..3c4d57033c
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/mouse-helper.js
@@ -0,0 +1,62 @@
+// This injects a box into the page that moves with the mouse;
+// Useful for debugging
+(function(){
+ const box = document.createElement('div');
+ box.classList.add('mouse-helper');
+ const styleElement = document.createElement('style');
+ styleElement.innerHTML = `
+ .mouse-helper {
+ pointer-events: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ height: 20px;
+ background: rgba(0,0,0,.4);
+ border: 1px solid white;
+ border-radius: 10px;
+ margin-left: -10px;
+ margin-top: -10px;
+ transition: background .2s, border-radius .2s, border-color .2s;
+ }
+ .mouse-helper.button-1 {
+ transition: none;
+ background: rgba(0,0,0,0.9);
+ }
+ .mouse-helper.button-2 {
+ transition: none;
+ border-color: rgba(0,0,255,0.9);
+ }
+ .mouse-helper.button-3 {
+ transition: none;
+ border-radius: 4px;
+ }
+ .mouse-helper.button-4 {
+ transition: none;
+ border-color: rgba(255,0,0,0.9);
+ }
+ .mouse-helper.button-5 {
+ transition: none;
+ border-color: rgba(0,255,0,0.9);
+ }
+ `;
+ document.head.appendChild(styleElement);
+ document.body.appendChild(box);
+ document.addEventListener('mousemove', event => {
+ box.style.left = event.pageX + 'px';
+ box.style.top = event.pageY + 'px';
+ updateButtons(event.buttons);
+ }, true);
+ document.addEventListener('mousedown', event => {
+ updateButtons(event.buttons);
+ box.classList.add('button-' + event.which);
+ }, true);
+ document.addEventListener('mouseup', event => {
+ updateButtons(event.buttons);
+ box.classList.remove('button-' + event.which);
+ }, true);
+ function updateButtons(buttons) {
+ for (let i = 0; i < 5; i++)
+ box.classList.toggle('button-' + i, buttons & (1 << i));
+ }
+})();
diff --git a/apps/testbed/app/playwright/assets/input/rotatedButton.html b/apps/testbed/app/playwright/assets/input/rotatedButton.html
new file mode 100644
index 0000000000..1bce66cf5e
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/rotatedButton.html
@@ -0,0 +1,21 @@
+
+
+
+ Rotated button test
+
+
+
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/scrollable.html b/apps/testbed/app/playwright/assets/input/scrollable.html
new file mode 100644
index 0000000000..885d3739d5
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/scrollable.html
@@ -0,0 +1,23 @@
+
+
+
+ Scrollable test
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/scrollable2.html b/apps/testbed/app/playwright/assets/input/scrollable2.html
new file mode 100644
index 0000000000..885d3739d5
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/scrollable2.html
@@ -0,0 +1,23 @@
+
+
+
+ Scrollable test
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/select.html b/apps/testbed/app/playwright/assets/input/select.html
new file mode 100644
index 0000000000..42784c28f3
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/select.html
@@ -0,0 +1,70 @@
+
+
+
+ Selection Test
+
+
+
+
+
+
diff --git a/apps/testbed/app/playwright/assets/input/textarea.html b/apps/testbed/app/playwright/assets/input/textarea.html
new file mode 100644
index 0000000000..11da79882e
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/textarea.html
@@ -0,0 +1,20 @@
+
+
+
+ Textarea test
+
+
+
+
+
+
Plain div
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/input/touches.html b/apps/testbed/app/playwright/assets/input/touches.html
new file mode 100644
index 0000000000..4392cfacbd
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/input/touches.html
@@ -0,0 +1,35 @@
+
+
+
+ Touch test
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/testbed/app/playwright/assets/networkidle-frame.html b/apps/testbed/app/playwright/assets/networkidle-frame.html
new file mode 100644
index 0000000000..3bf7ad4feb
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/networkidle-frame.html
@@ -0,0 +1 @@
+
diff --git a/apps/testbed/app/playwright/assets/networkidle.html b/apps/testbed/app/playwright/assets/networkidle.html
new file mode 100644
index 0000000000..ab10c97967
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/networkidle.html
@@ -0,0 +1 @@
+
diff --git a/apps/testbed/app/playwright/assets/networkidle.js b/apps/testbed/app/playwright/assets/networkidle.js
new file mode 100644
index 0000000000..9d8998458a
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/networkidle.js
@@ -0,0 +1,12 @@
+async function main() {
+ window.ws = new WebSocket('ws://localhost:' + window.location.port + '/ws');
+ window.ws.addEventListener('message', message => {});
+
+ fetch('fetch-request-a.js');
+ window.top.fetchSecond = () => {
+ // Do not return the promise here.
+ fetch('fetch-request-b.js');
+ };
+}
+
+main();
diff --git a/apps/testbed/app/playwright/assets/offscreenbuttons.html b/apps/testbed/app/playwright/assets/offscreenbuttons.html
new file mode 100644
index 0000000000..b7f381decd
--- /dev/null
+++ b/apps/testbed/app/playwright/assets/offscreenbuttons.html
@@ -0,0 +1,55 @@
+
+
'));
+ const error = await browser.locator('div').check().catch((caught: Error) => caught);
+ expect((error as Error).message).toContain('Not a checkbox or radio button');
+ });
+
+ test('should throw when not a checkbox 2', async ({ browser }) => {
+ await browser.goto(content('
Check me
'));
+ const error = await browser.locator('div').check().catch((caught: Error) => caught);
+ expect((error as Error).message).toContain('Not a checkbox or radio button');
+ });
+
+ test('should check the box inside a button', async ({ browser }) => {
+ await browser.goto(content(""));
+ await browser.locator('input').check();
+ expect(await browser.evaluate("() => document.querySelector('input').checked")).toBe(true);
+ expect(await browser.locator('input').isChecked()).toBe(true);
+ });
+
+ test('should throw when trying to uncheck radio button', async ({ browser }) => {
+ await browser.goto(content(""));
+ const error = await browser.locator('#radio').uncheck().catch((caught: Error) => caught);
+ expect((error as Error).message).toContain('uncheck cannot clear a radio button');
+ });
+});
diff --git a/apps/testbed/tests/click-scroll.e2e.ts b/apps/testbed/tests/click-scroll.e2e.ts
new file mode 100644
index 0000000000..3d3fcfbb23
--- /dev/null
+++ b/apps/testbed/tests/click-scroll.e2e.ts
@@ -0,0 +1,103 @@
+/**
+ * Adapted from microsoft/playwright tests/page/page-click-scroll.spec.ts at v1.64.1.
+ * Copyright Microsoft Corporation. Licensed under the Apache License 2.0 (see ../app/playwright/LICENSE).
+ * Rewritten against the e2e public API: `page.click(selector)` is a locator
+ * tap, a `text=` selector a substring `getByText`.
+ *
+ * Not ported:
+ * - should not crash when force-clicking hidden input: e2e tap has no force option.
+ * - should not scroll the page when scroll is "none": e2e tap has no scroll option.
+ * - should click in-viewport element when scroll is "none": same.
+ * - should not scroll nested container when scroll is "none": same.
+ * - should not scroll on hover when scroll is "none": same, and a `>>` chain.
+ * - should scroll into view display:contents with position: Playwright skips it on Chromium.
+ */
+
+import { test } from '@e2e-dev/web';
+import { expect } from 'e2e';
+import { content, CROSS } from './helpers.ts';
+
+test.describe('page click scroll', { requires: ['browser'], tags: ['playwright'] }, () => {
+ test('should not hit scroll bar', async ({ screen, browser }) => {
+ await browser.goto(content(`
+
+