4245 Commits

Author SHA1 Message Date
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
Simon Knott
edd1894ac6
fix(test runner): run project dependencies of --only-changed test files (#32094)
Closes https://github.com/microsoft/playwright/issues/32070. We were
applying `additionalFileMatcher` not just to `filteredProjectSuites`,
but also to `projectSuites`. `projectSuites` is where we take dependency
projects from, though - so `--only-changed` led to empty dependency
projects, resulting in the reported bug.

The fix is to only apply `additionalFileMatcher` on
`filteredProjectSuites`.
2024-08-12 17:26:01 +02:00
Simon Knott
effb1ae234
fix(test runner): align with typescript behaviour for resolving index.js and package.json through path mapping (#32078)
Supercedes https://github.com/microsoft/playwright/pull/31915, closes
https://github.com/microsoft/playwright/issues/31811.

When TypeScript resolves a specifier via path mapping, it does not
interpret `package.json`. If path mapping resolves to a directory, it
only looks at the `index.js` file in that directory if it's in CommonJS
mode.

We need to mirror this in our `esmLoader.ts`.

---------

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-08-12 15:05:19 +02:00
Simon Knott
c8cc4f9c8b
chore(ui): update to react 18 (#32079)
Part of https://github.com/microsoft/playwright/issues/31863. Updates
most of our React usage to React 18. `recorder` doesn't seem to like it
yet. I suspect that some of our code isn't compatible with concurrent
mode, i've investigated that in
https://github.com/microsoft/playwright/pull/32101.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-08-12 13:50:11 +02:00
Dmitry Gozman
a30a8805c9
fix(expect): account for timeout during the first locator handler check (#32095)
Also considered an alternative to not perform the locator handler check
during one-shot, but that would be somewhat against the promise of the
locator handler that is supposed to run **before** every expect check.

Fixes #32089.
2024-08-12 01:57:15 -07:00
Playwright Service
e8d845be64
feat(webkit): roll to r2061 (#32109) 2024-08-10 11:44:32 +02:00
Yury Semikhatsky
d73c0ba689
test: skip COOP navigation test on wk linux (#32108)
Reference: https://github.com/microsoft/playwright/issues/32107
2024-08-09 15:30:56 -07:00
Yury Semikhatsky
236a8ac2ac
test: enable header overrides on redirect in firefox (#32088)
Fixes: https://github.com/microsoft/playwright/issues/32045
2024-08-08 23:46:36 -07:00
Dmitry Gozman
f24e46c367
fix(types): revert type changes made to support TS 5.5 (#32066)
Regressed in #31532. The TS5.5 changes broke chaining of `extend`s where
the first `extend` did not specify any type arguments.

Fixes #32056.
2024-08-08 05:21:48 -07:00
Dmitry Gozman
ea747afcdd
chore: use a single binding for all Playwright needs (#32039)
This makes it easier to manage bindings, being just init scripts.
Fixes the BFCache binding problem.
Makes bindings removable in Firefox.

Fixes #31515.
2024-08-07 06:20:12 -07:00
Kuba Janik
7ec3a93db3
feat(ui-mode): add filters to network tab (#31956) 2024-08-06 14:52:35 -07:00
Dmitry Gozman
a54ed48b42
feat(test runner): --tsconfig cli option (#31932)
Introduce `--tsconfig` to specify a single config to be used for all
imported files, instead of looking up tsconfig for each file separately.

Fixes #12829.
2024-08-06 06:55:15 -07:00
Max Schmitt
bff97b4810
test: fix failing client-certificate tests (#32021) 2024-08-06 08:46:35 +02:00
Pavel Feldman
3c87f217df
feat(events): allow waiting for removeAllListeners (#31941) 2024-08-05 21:14:35 -07:00
Yury Semikhatsky
fef27395a5
chore(trace): do not nest API actions based on time (#31990)
They should be properly nested based on Node.js zones now.
2024-08-05 10:06:14 -07:00
Dmitry Gozman
5c9ce6b9d9
test: unflake various tests (#32014) 2024-08-05 08:29:13 -07:00
Max Schmitt
613ccb8d5b
chore(client-certificates): rewrite error for unsupported PFX errors (#32008) 2024-08-05 14:42:29 +02:00
Max Schmitt
71e614dc5a
fix(client-certificates): report error to the browser if incorrect passphrase (#32007) 2024-08-05 10:54:33 +02:00
Max Schmitt
dbc4bc84d6
fix(trace-viewer): popup snapshot utf-8 support (#32006) 2024-08-05 09:11:31 +02:00