Commit Graph

42 Commits

Author SHA1 Message Date
Julian Descottes 454b6f938d
test(bidi): Update browserName used for har file tests when using bidi (#34313) 2025-01-13 13:56:00 -08:00
Simon Knott a8df750a48
fix(har): account for reused sockets (#33087)
Closes https://github.com/microsoft/playwright/issues/32960

If the socket is reused, the connect and DNS timings are set to -1,
because that timing doesn't apply to the current request. The time
between request start and the socket being free is counted as `blocked`.
2024-10-14 17:22:29 +02:00
Simon Knott 042161e1ce
Reapply "fix(har timing): record connect timing for proxied connections" (#32855) (#33003)
This reapplies what we reverted in
https://github.com/microsoft/playwright/pull/32989.

Max and me debugged this, and found that the test failures come from
SOCKS proxy now preferring IPv6 over IPv4. We've updated the tests and
made sure that this doesn't mask any breaking change.

I'm enabling CQ1 to make sure we don't oversee any other CI failures.
2024-10-08 14:17:50 +02:00
Simon Knott 1b589c4bd3
Revert "fix(har timing): record `connect` timing for proxied connections" (#32989)
Reverts microsoft/playwright#32855. This broke two tests on main, and we
don't yet know how to fix it other than downgrading.
2024-10-08 10:13:21 +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
Simon Knott 825df6c074
feat(har): record `serverIPAddress` for API requests (#32660)
Discovered working on
https://github.com/microsoft/playwright/pull/32658. We're recording the
remote server address for browser requests, but not for API requests.
This PR adds that for API requests.
2024-09-18 14:51:42 +02:00
Simon Knott 4460c98710
fix(har tracing): record `response.bodySize` for API requests (#32656)
A small drive-by that came out of working on
https://github.com/microsoft/playwright/issues/32653.
2024-09-18 08:21:10 +02:00
Simon Knott 8a97050822
feat(har): record `securityDetails` for API Requests (#32664)
While working on https://github.com/microsoft/playwright/pull/32658 I
discovered that we're recording `securityDetails` for browser requests,
but not for API requests. This PR fixes that.
2024-09-18 08:18:47 +02:00
Simon Knott f1390cc269
chore(har recorder): ensure we respect minimal mode (#32658)
Closes https://github.com/microsoft/playwright/issues/32653.

Adds some test coverage to ensure we respect minimal mode for API
Requests in HAR tracing.

| omit setting | result |
| - | - |
| `omitCookies` |  added test for it |
| `omitTiming` | already covered |
| `omitSecurityDetails` | not recorded yet |
| `omitServerIP` | we don't record it yet, so no action here. gonna open
a separate issue |
| `omitPages` | not relevant to API requests |
| `omitSizes` | added test for it |
| `omitScripts` | not relevant to API requests |
2024-09-17 19:59:44 +02:00
Simon Knott 751b939d3a
feat(fetch): record timings (#32613)
Related to https://github.com/microsoft/playwright/issues/19621

Adds some instrumentation to collect timings for `APIRequestContext`
requests and adds them to the HAR trace. Doesn't yet expose them via an
API, but makes our `Duration` field in the trace viewer show a nice
duration:

<img width="1392" alt="Screenshot 2024-09-14 at 11 46 04"
src="https://github.com/user-attachments/assets/8020382d-9494-4634-9cfd-22b6f4a1d770">


I'm gonna add it to our API in a separate PR.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-17 16:11:21 +02:00
Max Schmitt 90af289ba2
test: use managed http2 server for client-certificates (#31844) 2024-07-25 18:53:38 +02:00
Max Schmitt f570c747d5
test: unskip har http2 test on WebKit Windows (#31774) 2024-07-19 13:44:56 +02:00
Pavel Feldman 5752a28f87
chore: make tests strict (1) (#27731) 2023-10-23 09:31:30 -07:00
Jim Hays dcc8dcca73
Fix various typos (Fixes #27396) (#27391)
Fixes https://github.com/microsoft/playwright/issues/27396
2023-10-04 19:56:42 -07:00
Dmitry Gozman b3edf8e562
fix(har): handle invalid Expires/Max-Age (#27098)
Fixes #27073.
2023-09-14 17:06:56 -07:00
Playwright Service bcf59ed721
feat(webkit): roll to r1905 (#26909) 2023-09-07 07:41:46 +02:00
Max Schmitt c27317b6e5
feat(webkit): roll to r1893 (#26596)
This should make it into v1.38 and once its merged one day later it can
be tested in [Playwright
Canary](https://playwright.dev/docs/canary-releases).

Fixes https://github.com/microsoft/playwright/issues/22569
Fixes https://github.com/microsoft/playwright/issues/23259
2023-08-22 17:57:02 +02:00
Playwright Service 96965cfbe9
feat(webkit): roll to r1885 (#26443)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-08-12 19:17:07 +02:00
Pavel Feldman d0fec20fe1
chore: update test certificates (#26423) 2023-08-10 17:06:03 -07:00
Pavel Feldman 744eb6823f
chore: fix s2 mode (#24525) 2023-07-31 11:24:04 -07:00
Pavel Feldman b39fd7283f
chore: skip tests that fail in cross-machine service mode (#24412) 2023-07-25 16:47:04 -07:00
Max Schmitt 3c2a8fa306
chore: enable no-floating-promises ESLint rule for tests (#23376)
https://github.com/microsoft/playwright/issues/23339
2023-06-02 21:59:12 +02:00
Dmitry Gozman 00b34dddb2
chore: move TestServer under test/ (#23287) 2023-05-25 15:11:16 -07:00
Playwright Service 2dee3c4fc7
feat(webkit): roll to r1813 (#21819)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-03-20 23:56:03 +01:00
Dmitry Gozman 8accabdb59
test: gardening (#21814)
Notable changes:
- `page-event-crash` is not a page test, moving out of page/.
- One of the expect tests is directly covered by another, merging them.
2023-03-20 12:52:52 -07:00
Yury Semikhatsky 0ebe090b8c
fix(har): do not hang on chunked response in har recorder (#21397)
Fixes #21182
2023-03-03 17:27:34 -08:00
Yury Semikhatsky 26fa0eeae8
test: har does not hang on slow chunked response (#21392)
#21182
2023-03-03 11:32:21 -08:00
Dmitry Gozman 821949d580
test: update stale test expectations (#20423) 2023-01-27 21:52:34 -08:00
Pavel Feldman 8b80e22a03
fix(har): recalculate receive time after response ended (#19646)
Fixes https://github.com/microsoft/playwright/issues/19327
2022-12-22 17:30:32 -08:00
Pavel Feldman df143031e7
chore: move protocol and trace types into the top-level packages (#17486) 2022-09-20 18:41:51 -07:00
Yury Semikhatsky 01d83f1d5e
fix(har): record request overrides to har (#17027) 2022-09-04 10:52:20 -07:00
Eran Rom 68d558f896
chore(default context): Apply context workaround only when browser and scenario match (#15904) 2022-07-27 12:23:22 -07:00
Pavel Feldman 7bd72716f9
feat(har): introduce the slim mode (#15053) 2022-06-22 14:44:12 -07:00
Pavel Feldman be64e9ce66
chore(har): attach resources for .zip hars (#14938) 2022-06-16 18:27:25 -07:00
Pavel Feldman 245c33a5d4
feat(har): allow storing content as separate files (#14934) 2022-06-16 16:33:32 -07:00
Dmitry Gozman 7c0bff15ca
feat(fulfill): improve fulfilling from har (#14789)
- `har` option is now an object `{ path, fallback }`.
- Allows falling back to `abort()`, `continue()` or throwing.
- Matches based on url + method.
- Follows redirects in the HAR file.
- Nice error/stack when throwing.
- Tests.
2022-06-10 14:26:45 -07:00
Dmitry Gozman 868e00253f
feat(har): store textual content without base64 encoding (#14772) 2022-06-10 14:10:52 -07:00
Dmitry Gozman e975aef961
feat(route): fulfill from har (#14720)
feat(route): fulfill from har

This allows to use pre-recorded HAR file to fulfill routes.
2022-06-08 20:29:03 -07:00
Dmitry Gozman fdcdd58d7f
feat(har): introduce urlFilter (#14693)
This is a glob or regex pattern that filters entries recorder in the HAR.
2022-06-07 18:09:47 -07:00
Ross Wollman 3b3cad7d69
feat: rewrite gitCommitInfo plugin, drop GlobalInfo & attachments (#13837) 2022-05-02 16:28:14 -07:00
Pavel Feldman f0156d057e
chore: flatten supplements (#13437) 2022-04-08 12:52:40 -07:00
Pavel Feldman 02cac8a066
chore: group tests under tests/ (1) (#13081) 2022-03-25 16:05:50 -07:00