3863 Commits

Author SHA1 Message Date
Kuba Janik
ee91bdc585
feat(ui-mode): display list of query params in request tab (#32443) 2024-09-04 07:54:44 -07:00
Dmitry Gozman
60631409d6
chore: make dev server only use public config (#32441)
In preparation to make it a part of a plugin.
2024-09-04 01:29:55 -07:00
Yury Semikhatsky
565aed6c39
Revert "chore: enforce tags format via typescript types (#32384)" (#32431)
After API review we decided to revert it:
* VSCode extension and UI mode users already get the (runtime) error if
the tag is not prefixed
* The typescript error message is not very nice
* The type change would break those clients that generate tests with
tags passed as string

This reverts commit 90e7b9ebacbd597b7380522001eb6d17ee9c3d86.
2024-09-03 10:07:08 -07:00
Simon Knott
201bad75d3
chore(test runner): rebase watch mode onto TestServerConnection (#32156)
Closes https://github.com/microsoft/playwright/issues/32076.

This PR rewrites `watchMode.ts` to use `TestServer` under the hood. It's
essentially a complete rewrite, so don't pay too much attention on the
old implementation. Note that there's no changes to tests, so all
behaviour we have specced out there still works.

To make this work without a superfluous WebSocket connection, I had to
refactor `TestServerConnection` a little. Originally, I pulled this into
a [separate PR](https://github.com/microsoft/playwright/pull/32132), but
then realised how small the refactoring is. So it's in this PR now. Let
me know if you'd like to land it separately.
2024-09-03 15:15:44 +02:00
Simon Knott
f62f85ba51
fix(test runner): fix types to allow calling custom matchers on expect.poll (#32407)
The `'should support custom matchers'` test asserts that the
functionality works, but it was a type error. This PR updates the types
so that it's allowed.

Closes https://github.com/microsoft/playwright/issues/32408

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-02 13:42:15 +02:00
Simon Knott
cf8c14f884
feat(html reporter): open html attachments in new tab (#32389)
Closes https://github.com/microsoft/playwright/issues/32281.

HTML attachments get a linkified name that opens the attachment in a new
tab.
2024-09-02 08:35:53 +02:00
Kuba Janik
a6b320e362
fix(ui-mode): format request body when headers are lower case (#32395)
Resolves https://github.com/microsoft/playwright/issues/32396

Currently, the request body is not formatted when content type header is
lower case (`content-type`). Even though the value is
`application/json`.

It happens because we are looking only for `Content-Type` header
ignoring headers that are lower case.

<img width="674" alt="363197933-5178ec23-b9cf-46b5-8284-e8d4d730b036"
src="https://github.com/user-attachments/assets/0ef01b52-7dd8-4f33-b836-9adb86f94cc9">
2024-08-30 16:21:51 +02:00
Simon Knott
ed5c21b827
fix(ui): respect --output param (#32351)
Closes https://github.com/microsoft/playwright/issues/32331

We're already passing the `outputDir` param to the UI, but the UI isn't
passing it back to the TestServer. This PR fixes that. I've added it to
`listTests`, which is requires to that
`TestServerDispatcher#_ignoredProjectOutputs` is populated with the
correct output dir. And i've added it to `runGlobalSetup`, which is what
the bug report was about.
2024-08-30 08:29:49 +02:00
Yury Semikhatsky
90e7b9ebac
chore: enforce tags format via typescript types (#32384)
Leverage [template literal
types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html).

Fixes https://github.com/microsoft/playwright/issues/32382
2024-08-29 14:16:49 -07:00
Yury Semikhatsky
896190edbb
Revert feat(addInitScript): support cjs modules (#32364)
Reverting https://github.com/microsoft/playwright/pull/32282 and
https://github.com/microsoft/playwright/pull/32240.
2024-08-28 15:39:48 -07:00
Playwright Service
d61b207ce3
feat(webkit): roll to r2066 (#32343)
Fixes https://github.com/microsoft/playwright/issues/30305

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2024-08-28 08:23:39 -07:00
Yury Semikhatsky
0fd97cb9ed
tests: delete flaky COOP test (#32346)
The scenario that the test covers is inherently racy and has been flaky
in all browsers.

Fixes https://github.com/microsoft/playwright/issues/32107
2024-08-27 14:53:27 -07:00
Pavel Feldman
bc87467b25
chore: generate simple dom descriptions in codegen (#32333) 2024-08-27 11:52:14 -07:00
Yury Semikhatsky
3f085d5689
chore: remove same-site expectations for old browsers (#32334) 2024-08-26 18:41:58 -07:00
Pavel Feldman
4340d153df
chore: deprecate locator.frameLocator() (#32306) 2024-08-26 10:28:54 -07:00
Max Schmitt
67d3d5f203
fix(clock): don't throw for |null| or |undefined| callbacks (#32309)
Fixes https://github.com/microsoft/playwright/issues/32293

This aligns it how Chromium and other browsers are doing it.
2024-08-26 09:26:38 -07:00
Max Schmitt
54709880c2
test: update Modernizir expectations (#32308)
Looks like `hiddenscroll` was different when an external monitor was
connected.
2024-08-26 08:32:22 -07:00
Max Schmitt
596f497633
fix: don't throw error on about:blank when blocking ServiceWorker (#32310)
Fixes https://github.com/microsoft/playwright/issues/32292
2024-08-26 08:27:21 -07:00
Simon Knott
1511d8643e
fix(test runner): expect.poll error reporting should handle non-expect errors (#32257)
Closes https://github.com/microsoft/playwright/issues/32256

We were expecting all errors to be of type `ExpectError`, but apparently
`expect` propagates rejections in the polling functions right through.
So we also need to handle that case.

I wonder if we have more cases of this. Would it make sense to enable
`useUnknownInCatchVariables` in TypeScript?
2024-08-26 09:39:25 +02:00
Max Schmitt
54c487c939 test: unskip 'should use ipv6 proxy' for Docker 2024-08-24 11:49:18 +02:00
Pavel Feldman
9d86bc5336
fix(dupe): render dupe test error indicator (#32303)
Fixes https://github.com/microsoft/playwright/issues/32093
2024-08-23 14:33:37 -07:00
Playwright Service
8703dd4f06
feat(webkit): roll to r2063 (#32295) 2024-08-23 17:57:18 +02:00
Max Schmitt
0d4d5758c4
test: update Modernizer tests to Safari 18 (#32290)
Fixes https://github.com/microsoft/playwright/issues/32288

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-08-23 16:59:55 +02:00
Max Schmitt
1b220c5289
chore: remove Chromium Windows proxy hacks (#31724)
Fixes https://github.com/microsoft/playwright/issues/17252
2024-08-23 15:17:00 +02:00
Simon Knott
3fb33e7144
chore(ui): decouple TestServerConnection from websocket transport (#32274)
Preparation for https://github.com/microsoft/playwright/issues/32076.
2024-08-23 14:58:34 +02:00
Max Schmitt
8c0e173d6c
test: rebase modernizer Linux tests (#32268) 2024-08-23 12:51:49 +02:00
Dmitry Gozman
3a75f23ea1
fix(addInitScript): require non-undefined arg to trigger commonjs module (#32282) 2024-08-23 02:48:56 -07:00
Simon Knott
0b9c036505
chore(ui): add test for font preview (#32225)
Adds a test for the font preview feature.
2024-08-22 17:56:07 +02:00
Max Schmitt
16e76cb71a
fix(client-certificates): errors during http2 TLS handshake (#32258) 2024-08-22 15:13:54 +02:00
Simon Knott
5368fd7ca7
fix(only-changed): exit successfully if there were no changes (#32197)
Closes https://github.com/microsoft/playwright/issues/32180

I was briefly wondering if we should output a log line a la "no tests
found", but my understanding is that that's the reporters job - so I
didn't change anything in that regard.
2024-08-22 14:53:00 +02:00
Dmitry Gozman
7758b330b1
fix(ui mode): make sure that reload does correctly restart the webserver (#32263)
Fixes #32103.
2024-08-22 05:48:31 -07:00
Max Schmitt
e3480d1886
test: add test for TLS renegotiation and client-certificates (#32252) 2024-08-22 08:42:09 +02:00
Dmitry Gozman
571f25a7d3
fix(role): hidden pseudos should not contribute to accessible name (#32251) 2024-08-21 11:14:41 -07:00
Dmitry Gozman
d5a7495041
feat(addInitScript): support cjs modules when passing both path and arg (#32240)
This works with scripts bundled by:
- `esbuild entrypoint.ts --bundle --format=cjs --outfile=injected.js`
- webpack with a typical config
  ```js
  module.exports = {
    entry: { 'injected': './entrypoint.js', },
    output: {
      path: require('path').resolve(__dirname),
      filename: '[name].js',
      libraryTarget: 'commonjs2',
    },
  };
  ```
2024-08-21 09:46:38 -07:00
Yury Semikhatsky
918dbe5e3a
chore: start listening for navigation events before navigation starts (#32237)
There is a chance in case of cross-process navigation that the
navigation event comes before `navigateFrame` finishes.
2024-08-21 08:34:55 -07:00
Dmitry Gozman
b4a9b247b4
fix(role): make sure to ignore style/script/noscript/template (#32231)
Even when these are a part of a hidden `aria-labelledby` traversal, all
browsers ignore them anyway.
2024-08-20 09:02:23 -07:00
Simon Knott
b599335404
chore(ui): enable react/recommended lint rules (#32214)
Closes https://github.com/microsoft/playwright/issues/32159. I
originally set out to enable Strict Mode for our React UI, but found a
way better thing: Enabling the lint rules we had already installed!

`eslint-plugin-react` is already in of our `package.json`, and this PR
enables it and fixes some of the reported issues. Most of them are
around the `key` prop which is mostly about performance, but there's
also fixes for misspelled `data-testid` props.
2024-08-20 14:16:28 +02:00
Dmitry Gozman
5271c26af1
fix(trace viewer): do not serve resources with x-unknown content type (#32219)
`x-unknown` is used as a placeholder for "no content-type" in the har.
We should not send it to the browser, because it is meaningfully
different from not sending `Content-Type` header. For example, Chromium
refuses to interpret stylesheets served with `x-unknown` content type.

Fixes https://github.com/microsoft/playwright-java/issues/1651.
2024-08-19 10:29:51 -07:00
Playwright Service
18694f6843
feat(webkit): roll to r2062 (#32147) 2024-08-19 19:29:23 +02:00
Max Schmitt
010778f6c5
feat(client-certificates): allow passing certificates from memory (#32210) 2024-08-19 09:24:32 +02:00
Max Schmitt
faf4853259
chore: validate client-certificates on context creation (#32168) 2024-08-19 09:02:14 +02:00
Simon Knott
3e6bba0b79
fix(only changed): make only-changed work together with list mode (#32196)
Closes https://github.com/microsoft/playwright/issues/32161

Turns out we were wrong in
https://github.com/microsoft/playwright/pull/31727#discussion_r1685793870!

Adds support for `--only-changed` in combination with `--list` by
removing our code to prevent that.
2024-08-16 17:12:45 +02:00
Dmitry Gozman
c4bb24f02f
feat(test runner): record trace after a test-scoped fixture teardown times out (#32160)
Fixes #30718, fixes #31537.
2024-08-16 08:03:02 -07:00
Dmitry Gozman
e17d1c498b
fix(test runner): timeout in fixture teardown should not prevent other slots (#32157)
When two fixtures have different time slots, timeout in the first one
should not prevent the second one from tearing down.

Similarly, timeout in afterEach hook should not prevent fixture
teardowns.
2024-08-16 04:25:00 -07:00
Dmitry Gozman
1537d3c2de
chore(test runner): make 'debug' an explicit option internally (#32154)
This allows any time slot that has a legitimate timeout of zero to be
updated later on. See test for an example.

Previously, setting timeout to zero at any moment was considered a
"debug mode" and any subsequent timeouts were ignored.
2024-08-16 01:44:37 -07:00
Max Schmitt
aac3a84321
fix(client-certificates): stall on tls handshake errors (#32163)
Extracted from https://github.com/microsoft/playwright/pull/32158.
2024-08-15 08:51:40 +02:00
Dmitry Gozman
f8eef3897c
chore: move urlMatch to isomorphic (#32142)
To be reused in injected code.
2024-08-13 12:47:02 -07:00
Kuba Janik
0588834307
feat: allow URLSearchParams and string as params in APIRequestContext (follow-up) (#32143)
Follow-up to https://github.com/microsoft/playwright/pull/32120

I made some changes suggested by @yury-s in the previous PR that make a
lot of sense:
- added an example to the documentation
- improved tests
  - check params on the client and server end
  - reverted to non-English characters being used as params
2024-08-13 10:39:56 -07:00
Yury Semikhatsky
a28f51a0f3
chore: use base BrowserType to reference browser types (#32125) 2024-08-12 22:20:58 -07:00
Kuba Janik
308381eeae
feat: allow URLSearchParams and string as params in APIRequestContext (#32120) 2024-08-12 14:22:03 -07:00