Commit Graph

1634 Commits

Author SHA1 Message Date
Dmitry Gozman
778dd20403
chore(docs): beautify generated types, put options always last (#20805) 2023-02-09 20:46:33 -08:00
Andrey Lushnikov
bcb2d67c5d
chore: remove experimental dockerfile.remote (#20790)
We didn't find a compelling-enough use case to release this.
2023-02-09 12:18:02 -08:00
Playwright Service
3be6772fa5
feat(chromium-tip-of-tree): roll to r1085 (#20782)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-09 17:06:39 +01:00
Pavel Feldman
6b0a7003c4
chore(watch): run by default again (#20763) 2023-02-08 18:53:07 -08:00
Dmitry Gozman
6e5964cccd
fix(connect): respect launch options when turning into connect (#20757) 2023-02-08 13:06:05 -08:00
Dmitry Gozman
98e2fe184e
chore(docs): sort members instead of validating (#20755) 2023-02-08 09:59:31 -08:00
Pavel Feldman
0678b6575f
chore(watch): allow toggling browser (#20738) 2023-02-08 08:36:02 -08:00
Dmitry Gozman
edfff8cd8c
test: run more tests in 'service' mode (#20734) 2023-02-07 18:25:33 -08:00
Dmitry Gozman
2d3e4027e7
fix(chromium): do not pre-populate non-preflight OPTIONS requests (#20684)
Fixes #20469.
2023-02-07 15:10:44 -08:00
Dmitry Gozman
fbccc8ef64
fix(role): closed <details> are considered hidden (#20726)
Fixes #20610.
2023-02-07 15:10:18 -08:00
Dmitry Gozman
bc74383480
test: remove service2 mode and experimental-grid (#20730) 2023-02-07 14:19:37 -08:00
Andrey Lushnikov
b67cef2c4d
feat: introduce Dockerfile.remote image (#20691)
When this image is launched, it exposes a single endpoint
that can be used to connect to and to launch browsers.
2023-02-07 10:50:44 -08:00
Andrey Lushnikov
303c5998f8
feat: release "comparator" option from experiment (#20720)
The option defines a comparator to be used to compare images.
Possible values are `"pixelmatch"` and `"ssim-cie94"`.

Note: This reverts commit 8167f8bf54.
2023-02-07 08:51:48 -08:00
Playwright Service
740bd228aa
feat(chromium-tip-of-tree): roll to r1084 (#20712)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-07 14:20:15 +01:00
Andrey Lushnikov
d3c5430080
fix: reset SNAP* env variables when launching Firefox (#20692)
Our builds never come from Snap, so Playwright's Firefox should
never consider that it's been installed via SNAP.

Fixes #20555

---------

Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-02-07 01:41:12 -08:00
Playwright Service
439d3cefcf
feat(webkit): roll to r1792 (#20694)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-07 09:03:09 +01:00
Andrey Lushnikov
1120b82ba2
feat(firefox): roll Firefox & Firefox Beta (#20670)
Fixes #19685 
Fixes #20093
2023-02-06 14:08:32 -08:00
Yury Semikhatsky
86dd29a15e
docs: custom selectors registration (#20687)
https://github.com/microsoft/playwright/issues/20424
2023-02-06 13:32:00 -08:00
Andrey Lushnikov
0a752f3fd6
chore(docker): remove experimental docker integration (#20676)
This removes everything related to docker integration experiments that
we conducted over the last 6 months.

I'll send a follow-up with an alternative suggestion that was demo'ed on
a team meeting in the end of December.
2023-02-06 10:50:45 -08:00
Playwright Service
73b07610c3
feat(webkit): roll to r1791 (#20630) 2023-02-04 10:33:48 -08:00
Andrey Lushnikov
9c6a1a6ff0
fix: make sure screenshots work when main page context is tampered (#20615)
This patch has 2 fixes:
- screenshot code was accidentally using main page context to fetch
  page layout metrics instead of a utility context
- Avoid usage of `self.eval` inside utility context since it escapes
Firefox sandbox. This turns out to be an upstream bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1814898

Fixes #20434
2023-02-03 10:01:23 -08:00
Dmitry Gozman
3180bc9804
fix(types): make most fixtures non-undefined (#20573)
Fixes #20416.
2023-02-02 13:11:50 -08:00
Playwright Service
3e4d22d04a
feat(webkit): roll to r1790 (#20585) 2023-02-02 08:38:05 -08:00
Playwright Service
f56d29709e
feat(firefox-beta): roll to r1377 (#20516)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2023-02-02 07:14:18 -08:00
Playwright Service
c922b5e7de
feat(chromium-tip-of-tree): roll to r1083 (#20591)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-02 15:33:22 +01:00
Dmitry Gozman
6f699cd346
docs: clarify headers propagation to redirects (#20572)
References #20501.
2023-02-01 16:55:03 -08:00
Dmitry Gozman
6ad4687f4d
feat(route): add maxRedirects option to Route.fetch (#20567)
References #20501.
2023-02-01 14:43:21 -08:00
Playwright Service
59d02e43d9
feat(webkit): roll to r1788 (#20547)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-01 11:39:26 +01:00
Playwright Service
48ac5b6fad
feat(chromium-tip-of-tree): roll to r1082 (#20526)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-31 15:52:51 +01:00
Dmitry Gozman
b39079b51e
feat(trace viewer): popout snapshot in a new tab (#20475) 2023-01-30 19:07:52 -08:00
Dmitry Gozman
c27ad35299
fix(locators): properly escape slash inside attributes (#20510)
Fixes #20471.
2023-01-30 13:27:41 -08:00
Playwright Service
a1c264c476
feat(firefox): roll to r1375 (#20507)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-30 12:21:35 -08:00
Yury Semikhatsky
cffe7b65e3
fix: do not hang on submitting target=_blank form (#20458)
Fixes #18392
2023-01-30 11:13:56 -08:00
Playwright Service
e6f83f5b94
feat(webkit): roll to r1785 (#20504)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-30 19:11:08 +01:00
Max Schmitt
92eb8e5090
chore: make connectOverCDP work with localhost (#20396)
This wraps happy eyeballs in two places, the place where we make the
JSON request to Chromium and the actual CDP WebSocket request.

It required changes inside our happy eyeballs implementation since the
[websocket library does not
set](https://github.com/websockets/ws/blob/master/lib/websocket.js#L714)
the `clientRequestOptions.hostname` field, it just sets the `host` field
where we then fall back to when its not set.

This test would pass before Node.js 18 and fail after Node.js 18 without
my changes.

Fixes https://github.com/microsoft/playwright/issues/20364
2023-01-30 17:44:26 +01:00
Playwright Service
5ad635522c
feat(webkit): roll to r1784 (#20466) 2023-01-30 08:36:02 -08:00
chimurai
f72d400952
chore: fix typos (#20473) 2023-01-30 09:53:28 +01:00
Yury Semikhatsky
532ca3f7b3
fix: throw on tap when hasTouch=false (#20457)
Fixes #20430
2023-01-27 15:51:57 -08:00
Max Schmitt
71752b4b2a
fix(windows): enable socks5 hostname resolution on WebKit (#20435)
Fixes https://github.com/microsoft/playwright/issues/20451
2023-01-27 23:33:06 +01:00
Etienne
252b489a7f
feat(trace-viewer): allow host and port to be specified (#20258) 2023-01-27 14:20:25 -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
Dmitry Gozman
ead4989947
fix(api): Response.finished() throws when target closes (#20453) 2023-01-27 10:42:43 -08:00
Andrey Lushnikov
2af31edadd
feat: roll Firefox and Firefox-Beta to latest builds (#20449)
These builds initiate browser-side navigation for `page.goto` command.

Drive-by: add a minimal file URL test.
2023-01-27 09:31:45 -08:00
Andrey Lushnikov
9ca9b08d90
fix: better formatting for sparse arrays (#20379)
Right now arrays preview yields all array elements. In case
of a sparse array with a single element on index 10000000,
this results in a large string that OOM Node.js.

This patch changes pretty-printing. For example:

```ts
// Given this array
const a = [];
a[10] = 1;
// Before this patch, pretty printing will yield:
"[,,,,,,,,1]"
// With this patch, pretty printing yields:
"[empty x 9, 1]"
```

The new array pretty-printing is equal to what Chrome DevTools
do to render sparse arrays.

Fixes #20347
2023-01-27 05:07:55 -08:00
Andrey Lushnikov
5b93c1d2f9
chore: truncate long protocol logs (#20412)
This affects the logs in the `DEBUG=pw:protocol` mode so that they
never span more then 10 lines of 80-character-width terminal.
2023-01-27 04:58:13 -08:00
Playwright Service
cf0ca2e662
feat(webkit): roll to r1783 (#20433)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-27 11:50:43 +01:00
Dmitry Gozman
332dbc5bf6
fix(chromium): enable gpu support in mac headless (#20418) 2023-01-26 13:21:25 -08:00
Playwright Service
ccb53c2c1b
feat(chromium-tip-of-tree): roll to r1081 (#20398)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-26 16:56:07 +01:00
Playwright Service
ff302585d9
feat(chromium): roll to r1046 (#20397)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-26 16:55:45 +01:00
Playwright Service
754dd05a8e
feat(webkit): roll to r1780 (#20393)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-26 16:14:55 +01:00
Pavel Feldman
5761a62b1c
docs: clarify the null value for the viewport (#20333)
Fixes https://github.com/microsoft/playwright/issues/20284
2023-01-25 17:48:18 -08:00
Dmitry Gozman
cab52cded9
chore: consolidate route handling logic in NetworkRouter (#20353)
References #19607.
2023-01-25 14:11:53 -08:00
Playwright Service
d7366cfc7c
feat(chromium-tip-of-tree): roll to r1080 (#20323)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-01-25 10:23:12 +01:00
Playwright Service
00edf587d5
feat(webkit): roll to r1773 (#20342)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2023-01-25 10:03:50 +01:00
Dmitry Gozman
a9422beecb
Revert "chore: respect headless option when reusing browser (#19980)" (#20336)
This reverts commit e674ea217f.
2023-01-24 11:07:53 -08:00
Playwright Service
aedcecb3db
feat(webkit): roll to r1770 (#20308) 2023-01-24 09:33:48 +01:00
Dmitry Gozman
38f260cc51
test: unflake "should respect interval" (#20298) 2023-01-23 17:57:37 -08:00
Playwright Service
7c5e0eb1cc
feat(firefox): roll to r1373 (#20271)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-23 07:53:29 -08:00
Playwright Service
20c3baf9bf
feat(firefox-beta): roll to r1375 (#20273)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-23 07:49:27 -08:00
Max Schmitt
05843bdfd9
chore: support Debian 11 arm64 (#19676)
https://github.com/microsoft/playwright/issues/18319
2023-01-23 15:54:25 +01:00
Dmitry Gozman
71798d658f
chore: remove separate network tethering client connection (#20267) 2023-01-21 18:18:22 -08:00
Dmitry Gozman
b700c08dc5
feat(screenshots): when actual and expected have different sizes, pad and produce the diff image (#20208)
Also show sizes in the html report to easier spot the size mismatch
issue.

<img width="1030" alt="diff"
src="https://user-images.githubusercontent.com/9881434/213327632-b8fcd69c-8d08-460c-9de1-b5f4f8c56359.png">

Fixes #15802.
2023-01-20 19:41:43 -08:00
Dmitry Gozman
0cc0d168cd
chore: mark 1.31-next (#20268) 2023-01-20 19:29:14 -08:00
Dmitry Gozman
eafa6fda13
fix(expect): poll/toPass should not wait over specified timeout (#20266)
Drive-by: unflake some timeout-dependent tests.
2023-01-20 15:47:24 -08:00
Playwright Service
d8e8ddba20
feat(webkit): roll to r1767 (#20265) 2023-01-20 22:28:56 +01:00
Playwright Service
1cd90cc8b6
feat(webkit): roll to r1766 (#20244) 2023-01-20 09:39:59 +01:00
Pavel Feldman
411a86512d
chore: roll webkit to 1765 (#20228) 2023-01-19 15:57:04 -08:00
Dmitry Gozman
d950f5b6ee
chore: remove toIntersectViewport for the next release (#20232)
Mostly reverts #19901.
2023-01-19 15:04:09 -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
Playwright Service
e87b974f97
feat(webkit): roll to r1763 (#20226)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-19 16:59:15 +01:00
Playwright Service
b4d63498d2
feat(chromium-tip-of-tree): roll to r1079 (#20224)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-19 15:28:47 +01:00
Playwright Service
4b53b1842f
feat(chromium): roll to r1045 (#20219)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-19 14:40:26 +01:00
Playwright Service
e740522069
feat(webkit): roll to r1761 (#20207)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-19 11:22:00 +01:00
Playwright Service
6d63773965
feat(webkit): roll to r1760 (#20197) 2023-01-18 12:24:12 -08:00
Playwright Service
9edc0ad988
feat(firefox-beta): roll to r1374 (#20117)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-18 11:27:18 -08:00
Playwright Service
c9873cd16d
feat(firefox): roll to r1372 (#20118)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-18 11:26:04 -08:00
Playwright Service
d2ec22551e
feat(chromium-tip-of-tree): roll to r1078 (#20161)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-17 22:39:59 +01:00
Max Schmitt
df05c00da3
fix: filter out pwt stacks correctly (#20158)
Fixes https://github.com/microsoft/playwright/issues/20155
2023-01-17 22:38:30 +01:00
Max Schmitt
341b50fd25
chore: return Promise<any> in {page,context}.unroute (#20135) 2023-01-17 19:14:47 +01:00
Playwright Service
b740aa04e7
feat(chromium): roll to r1044 (#20137)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-16 13:44:28 +01:00
Playwright Service
8671bfc53f
feat(firefox): roll to r1371 (#20115)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-13 22:37:26 -08:00
Pavel Feldman
d1c161ce99
chore: merge the util exports (#20110) 2023-01-13 13:50:38 -08:00
Alex
b984bb9ad6
fix: serviceWorker.register function (#20072) 2023-01-12 10:47:45 -08:00
Playwright Service
c111a0c1f7
feat(chromium-tip-of-tree): roll to r1077 (#20077)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-12 19:13:04 +01:00
Max Schmitt
1c1955a6e7
fix: do not write to stdout on cssTokenizer parse error (#20012)
Fixes https://github.com/microsoft/playwright/issues/20074
2023-01-12 19:10:01 +01:00
Playwright Service
1430c5b59c
feat(firefox-beta): roll to r1373 (#20058)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-12 08:59:34 -08:00
Playwright Service
cd6221e6c6
feat(firefox): roll to r1370 (#20050)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-12 08:58:23 -08:00
Dmitry Gozman
9a5df720ff
chore: fix build/watch script for bundles and vite-powered packages (#20055) 2023-01-11 18:36:04 -08:00
Max Schmitt
a7495c3326
fix: use no internal selectors for frame locators (#19964)
Fixes https://github.com/microsoft/playwright/issues/19406
2023-01-11 21:53:19 +01:00
Dmitry Gozman
4f837690e2
fix(connect): do not log ws query params (#20047) 2023-01-11 12:27:27 -08:00
Dmitry Gozman
e674ea217f
chore: respect headless option when reusing browser (#19980)
References #19746.
2023-01-10 10:49:53 -08:00
Max Schmitt
0fe327c21b
chore: return Promise<any> in {page,context}.route (#20005)
Fixes https://github.com/microsoft/playwright/issues/19855
Closes https://github.com/microsoft/playwright/pull/19856
2023-01-10 18:07:17 +01:00
Playwright Service
db5087e951
feat(chromium): roll to r1043 (#19991)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-10 14:55:27 +01:00
Playwright Service
394ed6db62
feat(chromium-tip-of-tree): roll to r1075 (#19993)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-10 14:55:10 +01:00
Andrey Lushnikov
9943bcfcd8
fix: do not subscribe to SIGINT signal unless lock is acquired (#19978)
Subscription to SIGINT handler removes default handler.

Fixes #19418
2023-01-09 20:19:28 -08:00
Pavel Feldman
6022a4098f
chore: deprecate page.waitForNavigation, locator.elementHandle (#19977) 2023-01-09 20:04:04 -08:00
Pavel Feldman
3f0adf5dd0
chore: release from pause when the page closes (#19975)
Fixes: https://github.com/microsoft/playwright/issues/19168
2023-01-09 18:49:18 -08:00
Andrey Lushnikov
8f62aa9335
chore: vendor proper-lockfile dependency (#19969)
This patch vendors the
https://github.com/moxystudio/node-proper-lockfile
project we rely to manage Playwright Registry.

The reason to vender is the following upstream issue that
didn't get resolved in almost a month:
https://github.com/moxystudio/node-proper-lockfile/issues/111

Follow-up will apply the fix for the issue to the vendored file.

NOTE: this patch also inlines all code in a single file.

References #19418
2023-01-09 17:13:58 -08:00
Dmitry Gozman
7d2cc06355
docs: add usage sections to Locator methods (#19968) 2023-01-09 13:06:25 -08:00
Max Schmitt
e3d615e9f2
docs: add Electron troubleshooting note (#19954)
Fixes https://github.com/microsoft/playwright/issues/19854

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
2023-01-09 18:39:54 +01:00
Dmitry Gozman
830c3c9f0f
fix(reuse): workaround long sw unregister (#19930)
Bogus `importScripts()` sometimes makes `unregister()` hang for long
time. We detect this case and not await it.

Fixes #19789.
2023-01-06 17:02:40 -08:00
Andrey Lushnikov
2a49c5e498
feat(expect): introduce expect(locator).toIntersectViewport() (#19901)
This is a new web-first assertion that should be used like this:

```ts
test('should work', async ({ page }) => {
  const locator = page.locator('body');
  // New web-first assertion.
  await expect(locator).toIntersectViewport();
  // The same functionality.
  await expect.poll(() => locator.viewportRatio()).toBeGreaterThan(0);
});
```

Fixes #8740
2023-01-06 16:56:24 -08:00
Max Schmitt
7bbaf2af21
fix(docker): take language binding version in consideration (#19924) 2023-01-06 19:47:37 +01:00
Max Schmitt
c339e1615b
fix(fetch): handle invalid redirect URL (#19890)
Fixes https://github.com/microsoft/playwright/issues/19879.

This part is then similar to how node-fetch is doing it:
55a4870ae5/src/index.js (L152-L159)

node-fetch also throws as of today with this URL. Before in Python it
was stalling, because the error was written to stdout and on Windows the
stdout wasn't working. On Node.js it ended up in an unhandled exception.
2023-01-06 10:22:17 -08:00
Dmitry Gozman
31a63b5c2a
fix(reuse): make reuse work with tracing (#19733)
Fixes #19059.
2023-01-05 14:50:47 -08:00
Yury Semikhatsky
10ccfa9517
feat(fetch): happy eyeballs (#19902)
Fixes #18790
2023-01-05 14:39:49 -08:00
Andrey Lushnikov
1afa38d5a7
chore(expect): extract polling from expect.poll and expect().toPass (#19882)
This extracts & unifies polling machinery from `expect.poll` and
`expect.toPass` methods.
2023-01-05 11:14:37 -08:00
Max Schmitt
ddccb59093
chore: fix Java CLI invocation on Windows (#19895)
For reference: https://stackoverflow.com/a/64300409
2023-01-05 10:55:07 -08:00
Andrey Lushnikov
3883799d68
feat: introduce locator.viewportRatio (#19761)
References #8740
2023-01-05 10:49:32 -08:00
Playwright Service
abe901d598
feat(chromium-tip-of-tree): roll to r1074 (#19853)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-01-05 19:04:20 +01:00
Oren
59e1437d7f
fix(serviceworker): network inspection works without options.serviceWorkers set (#19870) 2023-01-04 13:20:47 -08:00
Dmitry Gozman
6193e6d8ea
fix(reuse): reset tracing (#19876)
References #19059.
2023-01-04 13:19:05 -08:00
Playwright Service
2714e728d0
feat(chromium): roll to r1042 (#19799)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-02 14:11:44 +01:00
Andrey Lushnikov
caec93ef42
test: enable ssim-cie94 image comparison algorithm for our tests (#19313) 2022-12-29 23:48:28 -08:00
Ross Wollman
359d176ff6
fix(driver): avoid polluting stdout (#19759)
Relates microsoft/playwright-python#1699.
2022-12-28 17:09:11 -08:00
Yury Semikhatsky
b8f96a9411
fix(generator): FilterOptions in java (#19741)
Fixes #19448
2022-12-28 09:13:06 -08:00
Dmitry Gozman
0fba4d5611
chore: migrate waitForFunction to not use rerunnable task (#19730) 2022-12-27 17:22:44 -08:00
Dmitry Gozman
0b223b9036
fix(hit target): account for iframes with padding (#19732)
Padding on iframes moves the `documentElement` inside the iframe, so we
should account for it when converting coordinates between frames.

Fixes #19613.
2022-12-27 16:59:34 -08:00
Dmitry Gozman
3334d89ad7
fix(socks): support ipv6 (#19727)
Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2022-12-27 14:45:35 -08:00
Dmitry Gozman
c1b9a56079
chore: migrate waitForSelector to not use rerunnable task (#19715) 2022-12-27 13:39:35 -08:00
Dmitry Gozman
24f2ccb4ca
feat(getByLabel): support aria-label (#19726)
References #19284.
2022-12-27 12:43:55 -08:00
Dmitry Gozman
3ad65e7ce8
fix(launchServer): disable socks by default (#19723)
Socks does not support ipV6 yet.

References #19661.
2022-12-27 10:43:36 -08:00
Dmitry Gozman
1bb019ac81
chore: migrate most of rerunnable tasks to element callback (#19713) 2022-12-27 09:22:22 -08:00
Sang Nguyen
f88b22d0c0
docs: fix wrong waitForResponse example in Node.js (#19701) 2022-12-27 09:12:43 -08:00
Dmitry Gozman
0087bfac23
fix(role): update allowsNameFromContent to closer align with blink/gecko (#19692) 2022-12-27 09:06:46 -08:00
Dmitry Gozman
cce29215f9
chore: make input actions not use rerunnable task (#19638) 2022-12-24 10:40:36 -08:00
Pavel Feldman
e61a8c6592
fix(generator): penalize for the selector length (#19672) 2022-12-22 20:54:04 -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
fe989d95eb
chore(electron): move loader to be preload (#19650)
Fixes https://github.com/microsoft/playwright/issues/19648
2022-12-22 17:28:08 -08:00
Dmitry Gozman
83418aa8ab
fix(socks): cleanup event listeners upon disconnect (#19671)
References #19661.
2022-12-22 17:15:51 -08:00
Ross Wollman
06c7f1fb6c
fix(html): test and fix reporter timing display (#19670)
#19576 introduced a regression where the CLI reporters displayed some
times with way too many decimals. e.g. 7.123456789ms.

Prior to #19576, there were two monotonicTime implementations; that PR
updated the reporters to use the common definition that had existed in
utils.ts. However, that introduced a regression in the base.ts reporters
which used the ms duration humanizing package which did not account for
the more precise decimals used by the shared monotonicTime function.

This fix removes the dependency on the third-party ms package and now
consistently uses Pavel's humanize function which the HTML reporter had
been using and proved to have better defaults for decimals.
Additionally, we add more test coverage to limit future regressions
since this was caught in passing.

Closes #19556.
Relates #19576.
2022-12-22 15:57:55 -08:00
Dmitry Gozman
e12cf19012
chore: refactor frame.expect to not use rerunnable task (#19626) 2022-12-21 15:31:08 -08:00
Dmitry Gozman
eaae8ebbf3
chore: throw InvalidSelectorError from selector parser, add some tests (#19636) 2022-12-21 14:27:35 -08:00
Max Schmitt
7508c574e1
chore: bring ubuntu bionic back (#19625) 2022-12-21 18:37:42 +01:00
Playwright Service
acd3837484
feat(chromium): roll to r1041 (#19617)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-21 14:47:40 +01:00
Dmitry Gozman
ae2b1ac5e8
chore: move some injected code to InjectedScript (#19609) 2022-12-20 17:26:54 -08:00
Pavel Feldman
95cc5c2a2e
fix(electron): fix the directory app path (#19601) 2022-12-20 12:50:53 -08:00
Pavel Feldman
971e30482a
fix(electron): allow using pre-ready apis (#19599) 2022-12-20 10:40:48 -08:00
Max Schmitt
bb2a2c7331
fix: render discouraged / deprecated types (#19596)
Fixes https://github.com/microsoft/playwright/issues/19591
2022-12-20 16:19:07 +01:00
Dmitry Gozman
412c11db20
fix(reuse): make sure all dispose and close sequences are executed (#19572)
- When disposing recursively, only the root dispatcher received
`_dispose()` call, while some dispatchers need `_onDispose()` to clean
things up.
- When reusing the context, pages should be notified with `_onClose()`
so that all client-side waiting promises could reject.

Fixes #19216.
2022-12-19 15:54:53 -08:00
Pavel Feldman
3f333a8ef7
chore: simplify post_data processing (#19490) 2022-12-15 11:57:51 -08:00
Andrey Lushnikov
0be1fc8559
chore: cut version 1.29 (#19489) 2022-12-15 11:22:35 -08:00
Dmitry Gozman
1263bc3edd
feat(console api): first/last/nth (#19485) 2022-12-15 11:17:59 -08:00
Pavel Feldman
3afd83c8cc
chore: withdraw locator.enumerate (#19484) 2022-12-15 10:13:56 -08:00
Playwright Service
e7088cc685
feat(firefox): roll to r1369 (#19465)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-15 09:01:03 -08:00
Playwright Service
091234e57f
feat(firefox-beta): roll to r1372 (#19466)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-12-15 09:00:50 -08:00
Playwright Service
a67fa83ee1
feat(chromium-tip-of-tree): roll to r1069 (#19479)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-15 17:15:07 +01:00
Playwright Service
ed196ae9a2
feat(chromium): roll to r1040 (#19477)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-15 15:53:47 +01:00
Max Schmitt
1dcb8f643d
chore: fix Android tests (#19426) 2022-12-15 07:56:57 +01:00
Pavel Feldman
17a0074459
feat(api): introduce Locator.all, enumerate (#19461) 2022-12-14 16:42:50 -08:00
Playwright Service
cb4f26b41c
feat(webkit): roll to r1751 (#19391)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-14 14:07:27 -08:00
Dmitry Gozman
a27f1f744f
feat(getByLabel): support aria-labelledby (#19456)
Testing library also treats them equally.

Fixes #19284.
2022-12-14 13:51:05 -08:00
Andrey Lushnikov
8167f8bf54
chore: hide "comparator" option from documentation and types (#19441) 2022-12-14 09:58:19 -08:00
Playwright Service
8cc8fca129
feat(firefox-beta): roll to r1370 (#19444)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-14 09:57:17 -08:00
Pavel Feldman
d1559a0fcc
chore: route.fetch(postData) (#19436) 2022-12-13 14:01:39 -08:00
Pavel Feldman
6cadc56ea3
feat(api): allow getByTestId(regex) (#19419) 2022-12-13 08:43:13 -08:00
Playwright Service
af1783f4a8
feat(chromium-tip-of-tree): roll to r1068 (#19427)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-13 16:26:41 +01:00
Yury Semikhatsky
0cb1e97528
docs: strictSelectors does not affect Locators (#19414)
Fixes https://github.com/microsoft/playwright/issues/19398
2022-12-12 15:09:44 -08:00
Dmitry Gozman
539893402e
feat(socks): support pattern similar to proxy bypass rules (#19387)
- `<loopback>` for local interfaces;
- `123.123.123.123` for IPv4;
- `[1:2:3:4:5:6:7:8]` for IPv6;
- `*.example.com` and `.example.com` for subdomains;
- `example.com` for domains;
- `anything:3000` for port matching.
2022-12-12 12:27:34 -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
3c17a2603a
feat(console api): support locator.filter (#19389) 2022-12-09 15:25:12 -08: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
Playwright Service
8ea48752db
feat(chromium): roll to r1039 (#19382)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-09 13:23:38 +01:00
Andrey Lushnikov
858c2453b3
feat(containers): implement reverse proxy for novnc and server (#18569)
This patch adds a reverse proxy in front of novnc and playwright
server inside the container.

As a result:
- container exposes a single HTTP port to the host
- all Playwright clients can connect using this exposed port, e.g.
  `http://127.0.0.1:5400`
- navigating to the exposed port in the browser lands on a nice HTML
page
  with a link to view container screen
- users can also manually navigate to `http://127.0.0.1:5400/screen` to
  view screen
2022-12-08 17:17:18 -08:00
Andrey Lushnikov
526bc3f252
fix(ssim-cie94): further tune SSIM-CIE94 to fight wk artifacts (#19370)
This patch adds a grid border around the image so that the SSIM
resolution doesn't drop for the border pixels.

We also add a test with WebKit rendering artifacts to make sure
new approach helps to fight this.
2022-12-08 16:08:41 -08:00
Dmitry Gozman
465278a54f
feat(tether): always enable socks proxy on the server (#19363) 2022-12-08 14:23:14 -08:00
Max Schmitt
92b3995101
chore(recorder): align toolbar buttons correctly (#19357) 2022-12-08 17:33:18 +01:00
Playwright Service
883db90c3e
feat(chromium-tip-of-tree): roll to r1067 (#19358)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-08 17:07:39 +01:00
Dmitry Gozman
bdaf11a568
chore: refactor roleEngine to allow alternative representation (#19344) 2022-12-07 16:49:20 -08:00
Andrey Lushnikov
6139b432fd
fix(ssim-cie94): increase SSIM window radius (#19343)
While migrating Playwright tests from pixelmatch comparator to the
ssim-cie94 comparator, we noticed a rendering artifact that happens
on playwright screenshot tests on WebKit Linux.

This PR adds a set of cropped-down examples and tunes the ssim-cie94
comparator to accept these rendering artifacts.
2022-12-07 16:25:16 -08:00
Dmitry Gozman
dd58609a0b
chore: fix lint in types.d.ts (#19346) 2022-12-07 15:29:57 -08:00
Pavel Feldman
7aa3935dcc
chore: match selected options by both value and label (#19316) 2022-12-07 09:04:32 -08:00
Dmitry Gozman
fd22d8bde1
feat(tether): support hostname pattern in socks proxy (#19302)
For now, only '*' and 'localhost' are supported.

References #19287.
2022-12-07 08:46:35 -08:00
Andrey Lushnikov
cac67fb94f
chore: do not use "threshold" option for the ssim-cie94 comparator (#19314) 2022-12-06 17:03:13 -08:00
Dmitry Gozman
d294c5da33
chore: roll stable-test-runner to 1.28.1 (#19310)
This required `allowJs: false` in our `tsconfig.json` due to the
following error:

```

Error: Cannot find module './utilsBundleImpl'
Require stack:
- <playwright>/packages/playwright-core/src/utilsBundle.ts
- <playwright>/packages/playwright-test/lib/reporters/html.js
- <playwright>/tests/playwright-test/reporter-html.spec.ts
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/loader.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/runner.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/playwright-core/lib/cli/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/playwright-core/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli.js

   at ../../packages/playwright-core/src/utilsBundle.ts:20

  18 | import path from 'path';
  19 |
> 20 | export const colors: typeof import('../bundles/utils/node_modules/colors/safe') = require('./utilsBundleImpl').colors;
     |                                                                                   ^
  21 | export const debug: typeof import('../bundles/utils/node_modules/@types/debug') = require('./utilsBundleImpl').debug;
  22 | export const getProxyForUrl: typeof import('../bundles/utils/node_modules/@types/proxy-from-env').getProxyForUrl = require('./utilsBundleImpl').getProxyForUrl;
  23 | export const HttpsProxyAgent: typeof import('../bundles/utils/node_modules/https-proxy-agent').HttpsProxyAgent = require('./utilsBundleImpl').HttpsProxyAgent;

    at Object.<anonymous> (<playwright>/packages/playwright-core/src/utilsBundle.ts:20:83)
    at Object.<anonymous> (<playwright>/packages/playwright-test/src/reporters/html.ts:17:1)

```
2022-12-06 15:46:19 -08:00
Dmitry Gozman
4784dae10f
fix(role): accessibleName computation should walk the flat dom tree (#19301)
- When visiting `<slot>` element, descend into assigned nodes.
- When node has `assignedSlot`, skip it during regular traversal.

Fixes #18989.
2022-12-06 09:31:26 -08:00
Dmitry Gozman
81c8620bfe
chore: upgrade internal types to support TypeScript 4.9.3 (#19280)
Fixes https://github.com/microsoft/TypeScript/issues/51619

Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-12-05 17:22:25 -08:00
Dmitry Gozman
48182a4eb2
chore: refactor code around text selectors (#19278) 2022-12-05 14:08:54 -08:00
Playwright Service
84a0aaaaff
feat(chromium-tip-of-tree): roll to r1065 (#19239)
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>
2022-12-05 11:22:03 -08:00
Playwright Service
e576bd17df
feat(chromium): roll to r1038 (#19237)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-03 13:03:43 -08:00
Dmitry Gozman
e55a2bdf16
docs: rework Selectors to Other Locators (#19244)
- Replace links to `selectors.md` with `locators.md`.
- Remove sections that are covered by Locators docs.
- Restructure the rest of selectors doc, update them in terms of
locators.

Fixes #18992.
2022-12-02 21:48:37 -08:00
Pavel Feldman
9b35ef3b8d
docs: introduce the concept of details (#19242) 2022-12-02 17:35:21 -08:00
Dmitry Gozman
0be4fa768a
fix(codegen): do not generate Promise.all (#19182)
Drive-by: fix `download`, `dialog` and `popup` signals to use different
variable names in all languages.
2022-12-02 17:33:01 -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
Andrey Lushnikov
4cb49cb162
fix: remove firefox bandaid preferences (#19217)
These preferences were migrated to those we ship with builds.

Fixes #17442
2022-12-01 12:45:50 -08:00
Max Schmitt
3565d97a36
feat(recorder): make it work with [contenteditable] (#19066)
https://github.com/microsoft/playwright/issues/19029
2022-12-01 12:41:03 -08:00
Max Schmitt
1d3feba578
chore: do not set bypassCSP when inspector is used (#19190)
Fixes https://github.com/microsoft/playwright/issues/19186
2022-12-01 12:39:40 -08:00
Playwright Service
b212e99dbb
feat(firefox-beta): roll to r1369 (#19197)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-01 12:26:17 -08:00
Playwright Service
881097a431
feat(firefox): roll to r1367 (#19195)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-01 12:25:55 -08:00
Playwright Service
dbe4362b9c
feat(firefox): roll to r1366 (#19185)
Fixes https://github.com/microsoft/playwright/issues/18307.

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>
2022-11-30 19:13:11 -08:00
Playwright Service
58c4d1574b
feat(firefox-beta): roll to r1368 (#19191)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-30 19:09:41 -08:00
Pavel Feldman
f0e8d8f074
feat(api): introduce route.fetch and route.fulfill(json) (#19184) 2022-11-30 17:26:19 -08:00
Dmitry Gozman
499324961a
docs: remove Promise.all from examples (#19154)
Replaced with explicit `popupPromise` variable.
2022-11-30 12:36:35 -08:00
Playwright Service
f952e1147b
feat(chromium-tip-of-tree): roll to r1063 (#19070)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-11-30 11:11:54 -08:00
Dmitry Gozman
307a0b6ea7
fix(dotnet): codegen/docs use Name instead of NameString (#19156) 2022-11-29 20:56:18 -08:00
Pavel Feldman
5ac426b3d5
chore: expose utility script to inner evaluates (#19147) 2022-11-29 16:57:11 -08:00
Zihua Li
0c6a0f40c6
feat(keyboard): support simple cut-pasting using meta+x/v (#18756) 2022-11-29 12:58:14 -08:00
Dmitry Gozman
43a6bf4d45
fix(inspector): support custom test id attribute (#18996)
Fixes #18959.
2022-11-29 11:43:47 -08:00
Pavel Feldman
85467d1b7d
chore: generate get by title (#19119) 2022-11-28 19:55:34 -08:00
Playwright Service
e3d7e080b4
feat(webkit): roll to r1747 (#19080) 2022-11-28 09:50:07 -08:00