Commit graph

116 commits

Author SHA1 Message Date
Yury Semikhatsky 5cd9f83c7b
fix(webkit): properly set user agent in persistent context (#22283)
Fixes https://github.com/microsoft/playwright/issues/22274
2023-04-07 19:50:49 -07:00
Dmitry Gozman d7b3836752
chore: revert console and dialog events on BrowserContext (#22195)
This reverts #22033 and #21943, since there will be no immediate
benefits in v1.33.
2023-04-04 13:13:52 -07:00
Pavel Feldman 0d9ec60dc7
chore: implement jsHandle._objectCount in chromium (#22127) 2023-03-31 15:52:01 -07:00
Dmitry Gozman 37d1659508
feat(connect): support special headers for debug/attachments (#22106)
`x-playwright-debug-log: value` headers are printed to `pw:browser`
debug log.
`x-playwright-attachment: name=value` headers are attached to each test.

Fixes #21619.
2023-03-31 08:57:07 -07:00
Dmitry Gozman 3b359e27b7
feat: BrowserContext.on('dialog') (#22033)
Dialogs created early during page initialization are only reported on
the context, with `page()` being `null`.
2023-03-28 13:15:55 -07:00
Dmitry Gozman f502c72f2b
feat: browserContext.on('console') (#21943) 2023-03-27 16:35:05 -07:00
Sébastien Richert 591e4ea976
feat: Restrain sending http credentials on a specific origin (#20374)
For security purpose, we would like to restrain sending HTTP credentials
to only the specified server. The idea is to give the ability to specify
a origin (scheme://host:port) additionally to current pair
username/password. When an authorization response is received from
servers, the credentials are sent only if the server origin in the
request matches case insensitive the specified origin.
2023-03-27 08:52:00 -07:00
Pavel Feldman d4e0ef7f1a
chore: explicitly send route's requestUrl for tracing (#21940) 2023-03-23 14:57:03 -07:00
Pavel Feldman ecd0f927f4
chore: make stacks rendering live in ui mode (#21728)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-03-16 18:17:07 -07:00
Dmitry Gozman 40a6eff8f2
feat: support name option in tracing.startChunk() (#21692) 2023-03-15 17:34:56 -07:00
Pavel Feldman 09f77c41dd
chore: migrate to protocol's StackFrame type (#21198) 2023-02-24 18:36:15 -08:00
Pavel Feldman 8ccc02a9d3
chore: use client wall time in traces (#21163) 2023-02-23 14:37:53 -08:00
Pavel Feldman 55c95a4463
chore: do not send stacks as a part of the call metainfo (#21089) 2023-02-22 21:08:47 -08:00
Andrey Lushnikov 1db04f2839
fix: simplify protocol for toBeInViewport (#20960) 2023-02-16 11:02:19 -08:00
Andrey Lushnikov 68e170ef89
feat: implement expect(locator).toBeInViewport() (#20668)
The method accepts a `ratio` option to assert the ratio
of the element in viewport. `ratio` defaults to `Number.MIN_VALUE`.

NOTE: this reverts commit d950f5b6ee and
adds `ratio` option support + does the rename.

Fixes #8740
2023-02-10 04:33:22 -08:00
Dmitry Gozman d458e84f5b
feat(route): match pattern on the server side (#20410)
This avoids client-side roundtrip for requests that are not handled by
any route.

Fixes #19607.
2023-01-27 10:43:19 -08:00
Andrey Lushnikov 1b8b20dc25
chore: drop locator.viewportRatio() method (#20131)
As per API review discussion, we'd like to refrain from
exposing this method.
2023-01-19 08:46:45 -08:00
Andrey Lushnikov 3883799d68
feat: introduce locator.viewportRatio (#19761)
References #8740
2023-01-05 10:49:32 -08:00
Pranav Jain 59118b83f9
feat(android): add support for passing CR args & proxy when launching browser (#19212)
Fixes https://github.com/microsoft/playwright/issues/19211
2022-12-12 16:15:19 +01:00
Dmitry Gozman 256e9fd443
feat(connect): allow exposing local network to the remote browser (experimental) (#19372)
`connectOptions: { _exposeNetwork: '*' | 'localhost' }`

References #19287.
2022-12-09 11:16:29 -08:00
Pavel Feldman 7aa3935dcc
chore: match selected options by both value and label (#19316) 2022-12-07 09:04:32 -08:00
Andrey Lushnikov 6d82460a02
feat: implement a new image comparison function (#19166)
This patch implements a new image comparison function, codenamed
"ssim-cie94". The goal of the new comparison function is to cancel out
browser non-determenistic rendering.

To use the new comparison function:

```ts
await expect(page).toHaveScreenshot({
  comparator: 'ssim-cie94',
});
```

As of Nov 30, 2022, we identified the following sources of
non-determenistic rendering for Chromium:
- Anti-aliasing for certain shapes might be different due to the
  way skia rasterizes certain shapes.
- Color blending might be different on `x86` and `aarch64`
architectures.

The new function employs a few heuristics to fight these
differences.

Consider two non-equal image pixels `(r1, g1, b1)` and `(r2, g2, b2)`:
1. If the [CIE94] metric is less then 1.0, then we consider these pixels
   **EQUAL**. (The value `1.0` is the [just-noticeable difference] for
   [CIE94].). Otherwise, proceed to next step.
1. If all the 8 neighbors of the first pixel match its color, or
   if the 8 neighbors of the second pixel match its color, then these
   pixels are **DIFFERENT**. (In case of anti-aliasing, some of the
   direct neighbors have to be blended up or down.) Otherwise, proceed
   to next step.
1. If SSIM in some locality around the different pixels is more than
   0.99, then consider this pixels to be **EQUAL**. Otherwise, mark them
   as **DIFFERENT**. (Local SSIM for anti-aliased pixels turns out to be
   very close to 1.0).

[CIE94]: https://en.wikipedia.org/wiki/Color_difference#CIE94
[just-noticeable difference]:
https://en.wikipedia.org/wiki/Just-noticeable_difference
2022-12-02 15:22:05 -08:00
Pavel Feldman 5ac426b3d5
chore: expose utility script to inner evaluates (#19147) 2022-11-29 16:57:11 -08:00
Pavel Feldman 4e58b0c2ea
chore: render timed out error message when expect timeouts (#18863)
Fixes https://github.com/microsoft/playwright/issues/18859
2022-11-16 17:00:42 -08:00
Pavel Feldman ca2e7ef199
chore: report paused signal to the debug controller clients (#18701) 2022-11-10 12:15:29 -08:00
Pavel Feldman c25e67a0e7
chore: conditionally dispatch network events (#18687) 2022-11-09 21:10:57 -08:00
Pavel Feldman 0355d8618f
chore: use provided value for the generated test id (#18631) 2022-11-08 12:04:43 -08:00
Pavel Feldman 67c9624924
chore: send structured codegen info to the debug controller (#18491) 2022-11-01 18:02:14 -07:00
Pavel Feldman a7f5f2d7a1
chore: allow not overriding media when creating context (#18413) 2022-10-31 09:09:52 -07:00
Max Schmitt e25537f941
feat(android): add AndroidDevice.close event (#18306) 2022-10-25 18:18:14 -07:00
Pavel Feldman 37250cde17
chore: switch to the new debug controller harness (#18308) 2022-10-25 09:55:20 -07:00
Dmitry Gozman 329b3eadb4
feat: locator.blur() (#18303)
Note this is only available on Locator. Fixes #10724.
2022-10-25 06:10:40 -07:00
Max Schmitt 805312b722
feat(android): add Android.{launchServer,connect} (#18263)
Fixes https://github.com/microsoft/playwright/issues/17538
2022-10-24 17:23:11 -07:00
Pavel Feldman d3948d1308
chore: enable debug controller testing (#18270) 2022-10-24 16:19:58 -07:00
Pavel Feldman 3c0832a0d9
chore: brush up the debug controller api (#18262) 2022-10-21 17:57:22 -07:00
Pavel Feldman 5b1e4e08a5
chore: detect browser reuse based on the connection headers (#18230) 2022-10-20 18:30:37 -07:00
Pavel Feldman 739b64a09a
chore: render typed locators in the recorder (#18162) 2022-10-18 16:39:58 -07:00
Yury Semikhatsky 639b28db3b
fix: noWaitAfter option for hover (#17856)
Fixes https://github.com/microsoft/playwright/issues/17833
2022-10-07 12:43:48 -07:00
Pavel Feldman f2685cab95
chore: use api selectors in codegen hover (#17855) 2022-10-05 17:59:34 -07:00
Pavel Feldman 06e73b414f
chore: move connect utility into localUtils (#17590) 2022-09-27 13:05:06 -07:00
Pavel Feldman cb10ef3c71
chore: rename reuseController to debugController (#17520) 2022-09-21 15:35:52 -07:00
Pavel Feldman 3abbe0d850
chore: migrate codegen to controller events (#17450) 2022-09-20 14:32:21 -07:00
Andrey Lushnikov 7019cc8b97
feat(docker): closeAllBrowsers command for reuseController (#17383) 2022-09-15 20:38:28 -07:00
Pavel Feldman 872bcc9734
chore: expose driver protocol on the pw object (#17363) 2022-09-15 15:53:18 -07:00
Vincenzo Gasparo 17b203affb
feat: added follow and redirect arguments to fetch (#17033) 2022-09-09 12:14:42 -07:00
Pavel Feldman a07a4a25a2
chore: make parent scope explicit (#16819) 2022-08-25 11:58:41 -07:00
Pavel Feldman 737975bc7d
chore: expose hidehighlight from server (#16387) 2022-08-09 16:42:55 -07:00
Max Schmitt 1ca6635bb8
fix(cli): store trace/storage/har on SIGINT (#16339) 2022-08-09 00:13:38 +02:00
Pavel Feldman 8ed238843b
chore: allow inspecting element from server (#16324) 2022-08-05 19:34:57 -07:00
Pavel Feldman a198b6d753
chore: reparent context objects into the object (#15689) 2022-07-15 08:56:47 -07:00