2320 Commits

Author SHA1 Message Date
Simon Knott
9a6f03eb87
fix(fetch): listener leaks on Socket (#32956)
Closes https://github.com/microsoft/playwright/issues/32951

`node:http` reuses TCP Sockets under the hood. We weren't cleaning up
our listeners, leading to the `MaxListenersExceededWarning`.

This PR adds cleanup logic. It also raises the warning threshhold, so
that it doesn't trigger until there's 100 concurrent requests over the
same socket.
2024-10-07 18:43:25 +02:00
Simon Knott
de4a4d1ce1
fix(har timing): record connect timing for proxied connections (#32855)
Fixes a bug discovered in
https://github.com/microsoft/playwright/pull/32647. When using http
proxy, the `connect` event isn't emitted so we don't populate
`tcpConnectionAt`. The updated version of `https-proxy-agent` emits a
`proxyConnect` as a replacement, so this PR updates and listens to that
event.
For socks proxies, the `on("socket")` event is emitted once the SOCKS
connection is established, which is the equivalent of having a TCP
connection available.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-10-07 09:59:13 +02:00
Dmitry Gozman
9f842da8b3
fix: throw when element handle is detached while waiting for selector (#32961) 2024-10-04 08:23:25 -07:00
Dmitry Gozman
84b4fd4e40
feat: wait for pending navigation to resolve before many actions (#32899)
This includes all actions that perform locator handler check.
    
Note this makes it impossible to interact with the page while a main
frame navigation is ongoing. This was already the case for Chromium, but
now WebKit and Firefox align with it.

Setting `PLAYWRIGHT_SKIP_NAVIGATION_CHECK` environment variable disables
this behavior.
2024-10-04 07:25:18 -07:00
Dmitry Gozman
10d6812058
chore: clear pendingDocument() for the same-document navigation (#32954)
WebKit notifies about a pending same-document navigation through
`Page.frameScheduledNavigation`, and committing it should clear the
`pendingDocument()`.

Extracted from #32899.
2024-10-04 04:54:56 -07:00
Playwright Service
0a45549533
feat(chromium): roll to r1140 (#32949)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-04 11:14:08 +02:00
Dmitry Gozman
6b1d0361cd
fix(chromium): reset mouse position upon page reuse (#32944)
Similarly to Firefox, move the mouse to (-1, -1) upon page reuse. This
fixes the corresponding test on all platforms.
2024-10-03 08:09:00 -07:00
Dmitry Gozman
0ffac886e8
test: fix android tests (#32932)
One test is removed, since it's impossible to fix. Hopefully, the rest
will pass.
2024-10-03 03:37:43 -07:00
Dmitry Gozman
3c5967d4f5
fix(trace viewer): clear old highlighted elements upon change (#32917)
When the list of highlighted elements changes over time, we should
update the elements marked as `__playwright_target__` in the snapshot.

A good example is an `expect(locator).toHaveText([...])` where the list
of elements changes from 4 items to 3 after clicking a "Delete" button.
2024-10-02 23:48:26 -07:00
Playwright Service
616425a0fb
feat(firefox): roll to r1465 (#32938) 2024-10-03 08:25:44 +02:00
Dmitry Gozman
773202867d
feat(trace): highlight strict mode violation elements in the snapshot (#32893)
This is fixing a case where the test failed with strict mode violation,
but all the matched elements are not highlighted in the trace.

For example, all the buttons will be highlighted when the following line
fails due to strict mode violation:
```ts
await page.locator('button').click();
```

To achieve this, we mark elements during `querySelector` phase instead
of inside `onBeforeInputAction`. This allows us to only mark from inside
the `InjectedScript` and remove the other way of marking from inside the
`Snapshotter`.
2024-10-02 00:00:45 -07:00
Max Schmitt
daac0ddd24
fix(fetch): fallback to given URL if baseURL is invalid (#32911) 2024-10-01 22:43:32 +02:00
Max Schmitt
6f16b6cc08
chore: unflake 'should record' (#32880) 2024-09-30 20:32:04 +02:00
Pavel Feldman
11014145ce
chore: update trace event on action merge (#32860) 2024-09-27 21:18:30 -07:00
Pavel Feldman
908b0de5d4
chore: style action list in tv mode (#32845) 2024-09-27 17:52:03 -07:00
Max Schmitt
6721cc1746
chore: disable LensOverlay in Chromium (#32790) 2024-09-27 20:06:27 +02:00
Dmitry Gozman
a395fb22c4
feat(routeWebSocket): address api review feedback (#32850) 2024-09-27 04:01:31 -07:00
Pavel Feldman
bcb6860ef5
chore: fix cross browser leak tests (#32843) 2024-09-26 19:33:07 -07:00
Pavel Feldman
1a3d3f699b
chore: render recorded action list in tv mode (#32841) 2024-09-26 16:46:27 -07:00
Pavel Feldman
c105de4436
chore: move actions types to recorder (#32839) 2024-09-26 14:50:09 -07:00
Playwright Service
463bd55cf0
feat(webkit): roll to r2083 (#32813) 2024-09-26 21:49:02 +02:00
Pavel Feldman
9bff4d7eab
chore: move sw files into the sw/ folder (#32837) 2024-09-26 11:22:20 -07:00
Dmitry Gozman
a9d5c39d40
chore: address api review for page.forceGarbageCollection (#32824)
- Renamed to `page.requestGC`.
- Added a useful snippet to the docs.

References #32278.

---------

Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-09-26 05:08:33 -07:00
Playwright Service
6c20318e5c
feat(chromium): roll to r1137 (#32827)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-26 13:58:55 +02:00
Yury Semikhatsky
597642d269
chore: pass cli config overrides straight to test server (#32818) 2024-09-25 19:45:59 -07:00
Pavel Feldman
61801aa1ee
chore: more codegen fixes (#32816) 2024-09-25 18:18:36 -07:00
Yury Semikhatsky
0480bd0cac
chore(bidi): launch firefox with user prefs tailored for testing (#32817)
Various settings that make Firefox behave when testing over Bidi. The
settings are copied from
ea36b7b1f0/packages/browsers/src/browser-data/firefox.ts (L190-L402).

Unlike Playwright bundled version, we write the settings into `user.js`
in the profile folder before launching the browser.
2024-09-25 18:17:07 -07:00
Yury Semikhatsky
b6783bb18b
fix(ui-mode): respect --tsconfig option (#32798)
Fixes https://github.com/microsoft/playwright/issues/32797
2024-09-24 19:59:15 -07:00
Pavel Feldman
35158feec0
chore: fix codegen flakiness (#32799) 2024-09-24 19:56:31 -07:00
Pavel Feldman
8649b13f25
chore: start putting tv-recorder ui together (#32776) 2024-09-23 19:13:45 -07:00
Yury Semikhatsky
eda0e01167
chore(bidi): bring to front, pdf (#32698) 2024-09-23 19:05:55 -07:00
Pavel Feldman
c7a5278fb3
fix: do not start tracing in default recorder (#32770) 2024-09-23 15:51:27 -07:00
Yury Semikhatsky
11320d34c6
Revert chore: ignore third-party execution contexts (#32437) (#32771)
Partially revert #32437 and add a test that console.log() messages from
content scripts are properly reported

Fixes https://github.com/microsoft/playwright/issues/32762
2024-09-23 15:48:11 -07:00
Yury Semikhatsky
c9a26e60f5
fix(webkit): 204 response is not a failure (#32768)
The login being changed was added in
https://github.com/microsoft/playwright/pull/1260 and is supposed to
only work for navigation requests.

Reference: https://github.com/microsoft/playwright/issues/32752
2024-09-23 14:30:40 -07:00
Pavel Feldman
0cdc7ee1a3
chore: extract polling recorder (#32749)
We are reusing recorder in a snapshot tab, no need for the polling
harness to be there.
2024-09-23 08:42:18 -07:00
Dmitry Gozman
b3a82bef46
feat: do not record route calls in the trace (#32723)
These are represented in the network pane instead.
2024-09-21 10:17:59 -07:00
Pavel Feldman
17ed944a84
chore: iterate towards recording into trace (4) (#32743) 2024-09-20 16:56:05 -07:00
Pavel Feldman
418d1c0c55
chore: allow starting recorder in traceviewer (#32741) 2024-09-20 15:25:49 -07:00
Pavel Feldman
dfb3fdf217
chore: iterate towards recording into trace (3) (#32718) 2024-09-20 13:08:33 -07:00
Dmitry Gozman
cdcaa7fab6
feat: routeWebSocket (#32675)
This introduces `WebSocketRoute` class and
`page/context.routeWebSocket()` methods.
2024-09-20 03:20:06 -07:00
Pavel Feldman
01b44ba077
chore: remove PWTEST_RECORDER_PORT as it was ignored (#32717) 2024-09-19 13:35:52 -07:00
Dmitry Gozman
cc302fa515
fix(chromium): allow PlzDedicatedWorker (#32711)
With the recent Chromium fixes in v129, it is now safe to enable this
feature.

Fixes #31747.
2024-09-19 06:38:58 -07:00
Playwright Service
e8e72deac2
feat(chromium): roll to r1136 (#32707)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-19 14:35:48 +02:00
Dmitry Gozman
5089d9f293
fix(chromium): disable ThirdPartyStoragePartitioning (#32701)
See
https://developers.google.com/privacy-sandbox/cookies/storage-partitioning
for more details.

References #32230.
2024-09-19 03:12:21 -07:00
Max Schmitt
48030a4eff
test: fix test expecations after Node.js 22.9.0 (#32695) 2024-09-19 10:52:29 +02:00
Pavel Feldman
2f4acbb001
chore: use contentFrame() as a canonical locator representation (#32697) 2024-09-18 20:15:01 -07:00
Pavel Feldman
790dbfd78f
fix(codegen): use content_frame property in python (#32699) 2024-09-18 19:11:14 -07:00
Yury Semikhatsky
48d3d5554d
chore(bidi): suppress crash reporter in firefox (#32694)
Same settings as geckodriver uses upstream:
https://searchfox.org/mozilla-central/rev/c414b4538dd3c7e1dc674f7b66176e7c309afa95/testing/geckodriver/src/browser.rs#130-132
2024-09-18 16:02:10 -07:00
Pavel Feldman
427eca6f7e
chore: iterate towards recording into trace (2) (#32693) 2024-09-18 14:39:07 -07:00
Dmitry Gozman
f9d9ad25de
feat(locator handler): perform checkpoit during locator.waitFor (#32683)
Fixes #32255.
2024-09-18 09:34:06 -07:00