Commit graph

1107 commits

Author SHA1 Message Date
Elias Sørensen 6ca18b3bb8
chore: support Pop!_OS 22.04 versioning (#14859)
Co-authored-by: Elias Sorensen <elias.soerensen@usercentrics.com>
2022-06-21 03:02:48 -07:00
Dmitry Gozman bff90b5abb
fix(chromium): disable back-forward cache (#14996)
Otherwise, back/forward navigation does not intercept requests.
2022-06-20 17:27:45 -07:00
Pavel Feldman 883e4d449a
test(har): add more har tests (#14997) 2022-06-20 17:22:32 -07:00
Pavel Feldman aaafb77036
feat(har): disambiguate using matching headers (#14995) 2022-06-20 16:41:53 -07:00
Pavel Feldman b5524aa756
chore(har): brush up post data serialization (#14994) 2022-06-20 15:29:13 -07:00
Dmitry Gozman e3da3ebfa4
feat(har): do not expose HAR types, remove HARResponse fulfill (#14992) 2022-06-20 15:19:54 -07:00
Pavel Feldman eb87966441
feat(har): disambiguate requests by post data (#14993) 2022-06-20 14:14:40 -07:00
Ross Wollman c3bbf8963d
test: installation test for CDN failover (#14963) 2022-06-20 11:24:23 -07:00
Pavel Feldman 920f1d52fc
chore: allow routing by uncompressed har (#14987) 2022-06-20 11:07:53 -07:00
Pavel Feldman e5372c3421
chore: move har router into local utils (#14967) 2022-06-18 20:24:55 -07:00
Yury Semikhatsky ed6b14f0f4
fix(har): restart redirected navigation (#14939) 2022-06-17 21:17:30 -07:00
Pavel Feldman 030e7d211c
chore(har): allow replaying from zip har (#14962) 2022-06-17 16:11:22 -07:00
Max Schmitt 822b86d8a4
chore: add CDN download fallbacks (#14933) 2022-06-17 11:47:32 -07:00
Playwright Service 466d50e3e3
feat(chromium): roll to r1011 (#14948)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-17 18:41:06 +02:00
Pavel Feldman e9069bef6b
fix(body): fetch body explicitly for prefetched scripts (#14941) 2022-06-16 22:07:43 -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
Yury Semikhatsky 2bdb0998bd
feat(cli): block-service-workers option (#14931) 2022-06-16 16:03:35 -07:00
Dmitry Gozman cdb862767f
fix(page): "load" event should fire before "waitForLoadState" resolves (#14897)
Currently, `loadstate` and `load` are two separate events in the protocol,
and are fired in this order. As a result, `waitForLoadState()` sometimes
resolves before the `'load'` event is fired, which is unexpected.

Also fixes a flaky test that assumed `load` event comes after `domcontentloaded`
for the empty page, which is not always a case in Chromium.
2022-06-16 09:35:53 -07:00
Yury Semikhatsky 79378dd1eb
fix: add pw:api logging to har router (#14903) 2022-06-16 07:48:57 -07:00
Yury Semikhatsky c349c1d57f
feat: newContext.har (#14892)
Replaced {Page,BrowserContext}.(un)routeFromHar with browser.newContext.har.
2022-06-15 16:35:44 -07:00
Pavel Feldman 225ab68d1c
fix(test): fix the route test (#14890) 2022-06-15 16:15:45 -07:00
Pavel Feldman b8fece7204
chore: allow joining async handlers (#14893) 2022-06-15 15:27:31 -07:00
Pavel Feldman 464cbb7457
feat(chromium): allow attaching to other targets as to pages (#14873) 2022-06-15 09:31:32 -07:00
Yury Semikhatsky 259c8d64a5
feat: Page.routeFromHar (#14870) 2022-06-15 08:41:46 -07:00
Dmitry Gozman 06c8d8e31c
chore: use channels types instead of a copy in server (#14874)
This is to avoid duplicating types for no reason.
2022-06-14 22:02:15 -07:00
Yury Semikhatsky e00a26a11d
feat(route): fulfill with HARResponse (#14865) 2022-06-14 15:07:22 -07:00
Playwright Service c8283cf9de
feat(chromium): roll to r1010 (#14863)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-14 23:18:03 +02:00
Dmitry Gozman e640f553b5
fix(connectOverCDP): make sure downloads work in default context (#14864) 2022-06-14 12:36:35 -07:00
Pavel Feldman 48f98673ef chore: remove stray fallback overrides check 2022-06-13 18:06:01 -07:00
Pavel Feldman 9cf068ad06
feat(fallback): allow falling back w/ overrides (#14849) 2022-06-13 17:56:16 -07:00
Ross Wollman 3974d1b359
revert(#14797): fix(test runner): collect artifacts when calling browser.close() (#14846)
Revert "fix(test runner): collect artifacts when calling `browser.close()` (#14797)"

This reverts commit c7a28ac7e9.

Looks like it broke a bunch of tracing tests:

* Good: https://github.com/microsoft/playwright/runs/6838098316?check_suite_focus=true
* First Bad: https://github.com/microsoft/playwright/runs/6838104691?check_suite_focus=true
* Still bad on HEAD (88664c39c9): https://github.com/microsoft/playwright/runs/6868333846?check_suite_focus=true
2022-06-13 17:20:59 -07:00
Andrew Branch 26e22c9a89
fix(types): compilation error in TypeScript 4.8 (#14847) 2022-06-13 16:39:55 -07:00
Pavel Feldman dcdd3c3cdb
feat(route): explicitly fall back to the next handler (#14834) 2022-06-13 12:30:51 -07:00
Pavel Feldman c7b3f4646f
fix(strict): escape css class names when generating selectors (#14810) 2022-06-12 09:39:30 -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 c7a28ac7e9
fix(test runner): collect artifacts when calling browser.close() (#14797)
Previously, we only collected artifacts on context closure.
However, in serial mode it is possible to close the browser instead.
2022-06-10 14:11:34 -07:00
Dmitry Gozman 868e00253f
feat(har): store textual content without base64 encoding (#14772) 2022-06-10 14:10:52 -07:00
Pavel Feldman 7a568a2952
feat(route): chain routes (#14771) 2022-06-10 09:06:39 -07:00
Dmitry Gozman 6822d03f0b
fix(cli): default to no timeout (#14769) 2022-06-09 21:07:57 -07:00
Max Schmitt a2e8c17fbf
chore: fix WK ubuntu 22 deps on Docker (#14770) 2022-06-10 00:00:05 +02:00
Max Schmitt 3853014fa7
chore: add ubuntu 22 support (#14588) 2022-06-09 13:20:18 +02: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
Ross Wollman 85d03714d9
feat: add allow/block serviceWorkers option (#14714)
Adds cross-browser support for easily allowing/blocking Service Workers via a Context option.

Includes plumbing for Playwright Test's `use`.

Resolves #14522.

Relates #1090.
Supercedes #14321.
2022-06-08 18:27:51 -04:00
Ross Wollman fccee89b41
feat: add Response.fromServiceWorker flag (#14715)
Resolves #14666.

Relates #1090.
Supercedes #14321.
2022-06-08 17:34:19 -04:00
Dmitry Gozman 176ab7e48b
chore: make LocalUtils easily available on the client (#14717)
Instead of plumbing it around, expose it through Connection.
2022-06-08 13:22:05 -07:00
Dmitry Gozman 6c739eb345
feat(cli): option to record har (#14696)
`npx playwright open --save-har=file.har` produces a HAR file that
can be later inspected or used for mocks.
`--save-har-glob="**/*.{png,woff2}"` option can be used to
produce a smaller har that only contains entries matching the glob.
2022-06-08 10:59:50 -07:00
Yury Semikhatsky 7f026dd64c
feat(webkit): roll to r1658 (#14709)
Language override behavior changed upstream in WebKit/WebKit@039ebd9
New logic is closer to the actual behavior of WebKit on macOS, meaning that when the user changes system language the actual locale changes according to some weird OS rules:
ru-RU => navigator.language === 'ru'
fr-CH => navigator.language === 'fr-FR'
es-MX => navigator.language === 'es-MX'
Our locale emulation is aligned with that, so setting locale to fr-CH will result in fr-FR etc.
2022-06-08 10:16:49 -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
Playwright Service 712ad4ec12
feat(firefox): roll to r1327 (#14614)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-06-07 17:42:08 +02:00
Playwright Service cf2c6ee81d
feat(chromium): roll to r1009 (#14620)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-07 17:38:13 +02:00
Sébastien Règne 4c2fc6b6eb
feat(browser): add Browser.BrowserType() method (#14468) 2022-06-06 09:46:08 -07:00
Dmitry Gozman 40bfdb0f4e
fix(codegen): use name attribute for frame elements (#14609) 2022-06-02 21:14:01 -07:00
Ross Wollman 978854b859
chore: move multi-select assertion to toHaveValues (#14595)
Follow-up to e0a87e52d7
2022-06-02 16:01:34 -04:00
Elijah dbc2494e54
fix: sanitize URLs with vbscript: (#14325)
fix: sanitize URLs with vbscript:

The vbscript: protocols can be used to run scripts in much the same way as the javascript: protocol. This PR adds in validation for those aforementioned protocols in snapshotterInjected.ts and snapshotRenderer.ts.
2022-06-02 12:25:59 -07:00
Ross Wollman e0a87e52d7
feat: support multi-select/combo box with toHaveValue (#14555) 2022-06-02 12:10:28 -04:00
Dmitry Gozman d00efa0dfe
feat(expect): add ignoreCase option to toHaveText and toContainText (#14534) 2022-06-02 05:52:53 -07:00
Dmitry Gozman c4581e54c0
fix(click): detect iframe overlays that cover target element (#13876)
This restores the old hit target check, in addition to the new
hit target interceptor.

This way, we got some coverage for iframes and other quirky cases,
but keep the bullet-proof hit target check in place.
2022-06-01 15:23:41 -07:00
Dmitry Gozman dbcf039717
chore: remove experimental types (#14560) 2022-06-01 15:22:43 -07:00
Playwright Service c53676e605
feat(firefox): roll to r1325 (#14512)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-01 01:39:28 -07:00
Playwright Service f087e39c01
feat(chromium): roll to r1008 (#14448)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-05-30 15:04:05 +02:00
Yury Semikhatsky abced7223c
fix: filechooser interception in OOPIFs (#14432) 2022-05-27 13:04:58 -07:00
Pavel Feldman 2fab2c1ca1
fix(tracing): invalidate non-stalling evaluates on crash (#14392) 2022-05-24 14:02:32 -07:00
Playwright Service c12a9077d5
feat(chromium): roll to r1007 (#14307)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-24 11:26:20 +03:00
Max Schmitt e02e5e66f0
chore: bump TypeScript to 4.6 (#14358) 2022-05-23 22:59:33 +03:00
Pavel Feldman a1324bd935
fix(route): support route w/ async handler & times (#14317) 2022-05-21 21:55:46 -07:00
Pavel Feldman b92163176d
chore: render titles on all matching nodes (#14316) 2022-05-20 22:09:10 -07:00
Ross Wollman fbb364c1cd
fix: page.locator.focus() and page.locator(…).type(…) (#14267)
Fixes focus and blur management when `page.locator(…).focus()`  and  `page.locator(…).type(…)` are used which was regressed by 7a5b070 (#13510).

#13510 relied on an implicit assumption that this (conditional) [`blur`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L672)) call would always be followed by a call that resulted in a newly focused element via this [`focus`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L674)) call.

However, some elements are [not focusable](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area), so we were blurring incorrectly, and losing focus that we should have maintained.

Two regression tests were added that pass on the commit prior to 7a5b070e95 (and match manual testing/expectations):

* `page.locator(…).focus()`: _keeps focus on element when attempting to focus a non-focusable element_
* `page.locator(…).type(…)`: _should type repeatedly in input in shadow dom_

Additionally, a third test (_should type repeatedly in input in shadow dom_) was added to check the invariant from #13510 that states:

> This affects [contenteditable] elements, but not input elements.

and allows us to introduce the targeted fix (contenteditble check before blur) without breaking FF again.

And _should type repeatedly in contenteditable in shadow dom with nested elements_ was added to ensure the above fix works with nest contenteditble detection.

Fixes #14254.
2022-05-19 14:31:56 -07:00
Pavel Feldman d5ea1b38f0
fix(recorder): remove waitForNavigation from codegen (#14166) 2022-05-18 10:02:09 -07:00
Pavel Feldman b5beeab98b
fix(click): climb the hit target hierarchy to anchor (#14235)
fix(click): climb the hit target hierarcchy to anchor
2022-05-18 10:01:34 -07:00
Pavel Feldman fe0afd6b5c
fix(toHaveProperty): serialize falsy arguments as well (#14232) 2022-05-17 14:44:12 -07:00
github-actions[bot] f1307f4a4d
feat(chromium): roll to r1006 (#14192)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-16 10:56:38 -07:00
Dmitry Gozman f6712ec43a
fix(tracing): workaround chromium scrollTop slowness (#14114)
References #14037.

We used to query and save all non-zero `scrollTop`/`scrollLeft` to restore the page perfectly. However, this became very slow with Chromium v100 regression (see issue).

This change only queries and stores `scrollTop`/`scrollLeft` for elements that are ancestors of the action target. The resulting snapshot does not perfectly recreate the original screen, but should be good enough to inspect the action.
2022-05-12 10:55:29 -07:00
Dmitry Gozman 0e2855348c
feat(locators): remove layout locators (#14129) 2022-05-12 18:50:19 +01:00
Dmitry Gozman b753ff8686
chore: split injected utils into proper files (#14093) 2022-05-11 13:49:12 +01:00
Pavel Feldman c99ca17199
chore: disable AvoidUnnecessaryBeforeUnloadCheckSync on chromium (#14080) 2022-05-10 14:55:44 -07:00
Dmitry Gozman ba0cfaeb2d
fix(chromium): work around about:blank issue on Chromium (#14068)
fix(chromium): work around about:blank issue on Chromium

We don't receive the `loaderId` which translates to `newDocumentId`,
so we expect the same-document navigation. Instead, we can wait
for any new-document navigation as a workaround, only for `about:blank`.

This also reverts commit f0f65fa247.
2022-05-10 20:32:19 +01:00
Andrey Lushnikov 3ba1ea5c39
fix: support installing dependencies on non-ubuntu. (#14010)
We should not fast-return if someone tries to run
`npx playwright install-deps` on Debian.

Instead, we should warn users, fallback to Ubuntu 20.04 dependencies,
and proceed.
2022-05-10 04:05:39 -07:00
Pavel Feldman cf89a36181
chore: serialize circular objects (#14045) 2022-05-09 18:51:53 -07:00
Pavel Feldman f0f65fa247 Revert "feat(chromium): roll to r1005 (#13999)"
This reverts commit 56b3bca8db.
2022-05-09 18:28:39 -07:00
Pavel Feldman e55f7bd896
feat(bindings): best-effort serialize circular structures (#14008) 2022-05-09 15:07:04 -07:00
Max Schmitt 04fafcabd8
fix: leaking server side objects (#13991) 2022-05-09 17:34:00 +01:00
github-actions[bot] 56b3bca8db
feat(chromium): roll to r1005 (#13999)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-05-09 15:52:00 +01:00
Pavel Feldman a052211dbf
chore: do not reset internal bindings for reuse (#14019) 2022-05-09 07:44:20 -07:00
Dmitry Gozman 6931d89eaf
feat(locators): rename locator.that to locator.filter (#14025) 2022-05-08 21:59:40 +01:00
Dmitry Gozman 64cd55089a
chore: role selectors non-experimental (#14021) 2022-05-08 11:07:01 +01:00
Dmitry Gozman c3cf7ee4a7
feat(layout locators): remove maxDistance option (#14013) 2022-05-08 07:18:16 +01:00
Pavel Feldman 5c9e7f48e0
fix(debug): do not pause on internal calls, update ct docs (#14018) 2022-05-07 19:56:25 -07:00
Andrey Lushnikov 5a5bb36d28
chore: nuke "fonts" screenshot option (#14004)
It was never released since it wasn't working as expected on WebKit WPE.

Fixes #12839
2022-05-06 17:54:17 -07:00
Andrey Lushnikov bfafb2680d
fix: put browserVersion in the browsers.json (#13946)
This patch:
- adds `browserVersion` field to the `browsers.json`. This is
  updated every time we roll browser.
- starts using `browserVersion` to display browser version that's
  been downloaded.

The downloading output now looks like this:

```bash
Downloading Chromium 101.0.4951.41 (playwright build v1003) - 118.9 Mb [====================] 100% 0.0s
Chromium 101.0.4951.41 (playwright build v1003) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/chromium-1003
Downloading FFMPEG playwright build v1007 - 1 Mb [====================] 100% 0.0s
FFMPEG playwright build v1007 downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/ffmpeg-1007
Downloading Firefox 99.0.1 (playwright build v1323) - 67.5 Mb [====================] 100% 0.0s
Firefox 99.0.1 (playwright build v1323) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/firefox-1323
Downloading Webkit 15.4 (playwright build v1632) - 52.7 Mb [====================] 100% 0.0s
Webkit 15.4 (playwright build v1632) downloaded to /Users/andreylushnikov/Library/Caches/ms-playwright/webkit-1632
```

Fixes #13198
2022-05-05 04:17:13 -07:00
Dmitry Gozman cf5101d44a
fix(networkidle): do not produce networkidle event on errored pages (#13938) 2022-05-04 20:52:50 +01:00
Yury Semikhatsky a919414553
feat(chromium): roll tot, ignore unknown session error (#13932)
After https://chromium-review.googlesource.com/c/chromium/src/+/3606712 browser returns an error to messages addressed to unknown session id (previously such messages would never get a response).

#13637
2022-05-04 10:00:02 -07:00
Dmitry Gozman cd53346594
fix(codegen): do not reset current source on every recorded action (#13925)
Currently, when I choose "Java" in the sources list and then
click on the page to generate the "click" action, sources reset
to "JavaScript". This is very inconvenient.

This changes the logic to only forcefully change files if either
old or new file is a user file, not a generated one.

Use cases considered:
- run `codegen`, click around, choose different language, click more;
- run script with inspector, pause, click "Record" and record an action;
- same as above, but then continue and see that user source is revealed.
2022-05-04 17:16:24 +01:00
Dmitry Gozman 9e0aa67d28
feat(codegen): brush up context options in pytest codegen (#13924) 2022-05-04 11:14:53 +01:00
Ronie Martinez 2c597f06bd
feat(codegen): pytest support in codegen (#13746)
feat(codegen): pytest support in codegen
2022-05-04 09:41:20 +01:00
Max Schmitt b5183b4cf9
chore: make React selectors work on React 18 (#13864)
Fixes #13845
2022-05-03 13:46:52 -07:00
github-actions[bot] 029aff16e4
feat(firefox): roll to r1323 (#13897)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-03 09:14:20 -07:00
Dmitry Gozman 54dd6d01e5
feat(locator): layout options (leftOf, rightOf, above, below, near) (#13821)
This also includes corresponding selector engines `left-of` and others,
modeled after existing `has` selector engine.
2022-05-03 10:33:33 +01:00
Yury Semikhatsky ed344a882b
fix: delete headers with undefined value (#13880) 2022-05-02 12:38:57 -07:00
Andrey Lushnikov bd2a2873b7
chore: unexperiment role selectors (#13858) 2022-05-02 09:32:50 -07:00
Yury Semikhatsky 4b682f9f13
fix(chromium): disable DialMediaRouteProvider in addition to MediaRouter (#13854) 2022-04-29 14:29:31 -07:00
Pavel Feldman 18bff137ce
chore: remove default config from cli (#13832) 2022-04-28 16:49:36 -07:00
Andrey Lushnikov a06b06b82b
fix: typo in the missing X Display error message (#13810) 2022-04-28 08:35:01 -07:00
Pavel Feldman e756528ad2
feat(plugins): expose suite to plugin setup (#13807) 2022-04-28 08:16:17 -07:00
Dmitry Gozman 38fdc5fe24
fix(selectors): refactor chaining logic (#13764)
This fixes a few issues:
- strict mode was producing false negatives if multiple query paths
  lead to the same element being picked;
- in some cases the number of intermediate items in the list was
  exponential and crashed quickly.

What changed:
- `visible` engine is a real engine now;
- `capture` selectors are transformed to `has=` selectors for
  easier implementation;
- chained querying switched from a list to a set to avoid
  exponential size.
2022-04-27 20:51:57 +01:00
Dmitry Gozman dab2384b0e
fix(process launcher): use spawnSync to cleanup synchronously (#13769)
This allows us to use the full retry logic of rimraf in the `onexit` handler.
Note this is already covered by failing on Windows test
`should remove temp dir on process.exit`.
2022-04-27 15:01:30 +01:00
Dmitry Gozman c0f0979055
fix(frames): networkidle for iframes with quirky urls (#13767) 2022-04-26 17:13:45 +01:00
Dmitry Gozman 39cfa2b6e3
test: switch temp dir tests to use userDataDir (#13745) 2022-04-26 09:32:58 +01:00
Dmitry Gozman 97750ccf9a
feat: locator.that (#13731)
Filters existing locator by options, currently `has` and `hasText`.
2022-04-25 20:06:18 +01:00
Yury Semikhatsky aab1a746d3
fix: join individual css selectors by > in cssFallback (#13712) 2022-04-25 11:11:24 -07:00
Dmitry Gozman 01a8977b4d
feat: make scrollIntoView work with zero-sized elements (#13702)
We skip waiting for "visible" state that enforces non-zero size.
Other invisible conditions like "display:none" fail during the
actual "scrolling" step and will retry.
2022-04-23 21:48:36 +01:00
Max Schmitt 39525878ab
chore: show small progress bar in downloader without tty (#13690) 2022-04-22 19:55:43 +02:00
Andrey Lushnikov 317b649f78
feat: support tip-of-tree chromium channel (#13701) 2022-04-22 09:43:57 -07:00
Max Schmitt ca4cfca8ad
chore: make tests pass on Node.js 17+ (#13678) 2022-04-22 13:42:52 +02:00
Yury Semikhatsky 801dbe0699
fix(oopif): dispose child sessions when frame session is disposed (#13693) 2022-04-21 18:32:56 -07:00
Pavel Feldman 5990eb6074
chore: use vite plugin for registry (#13658) 2022-04-21 17:30:17 -07:00
Pavel Feldman 89b8fdd4e5
fix(tracing): do not reset frame counter on every chunk (#13689) 2022-04-21 15:40:30 -07:00
github-actions[bot] 5753f7a7fa
feat(chromium): roll to r1003 (#13680)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-21 22:22:15 +02:00
Max Schmitt 4a3180aca9
chore: make Android host option configurable (#13685) 2022-04-21 22:16:42 +02:00
Max Schmitt c397daeb07
chore: language agnostic browsers missing error message (#13650) 2022-04-20 12:02:28 -07:00
Pavel Feldman 06645b0a1f
chore: fix the android ws sender/receiver (#13641) 2022-04-19 13:28:05 -07:00
Andrey Lushnikov a617604962
test: make sure toHaveScreenshot doesn't tolerate bad option values (#13627)
Fixes #13495
2022-04-19 07:43:18 -07:00
Andrey Lushnikov 80bc532874
fix: support undo/redo editing commands (#13606)
Fixes #13601
2022-04-18 22:22:52 -07:00
Pavel Feldman 3c896f6bc5
fix(tests): installation tests (#13623) 2022-04-18 22:17:56 -07:00
Pavel Feldman 007e908cd9
chore: bundle pwt deps (#13622) 2022-04-18 21:47:18 -07:00
Pavel Feldman 7989427ea6
chore: bundle core deps (#13621) 2022-04-18 20:20:49 -07:00
Pavel Feldman 63ea81ec54
chore: make bundles typed (#13620) 2022-04-18 17:50:25 -07:00
Pavel Feldman 58d79e5e4d
chore: add core utils bundle (#13615) 2022-04-18 13:47:23 -07:00
Pavel Feldman 4f0103fef0
chore: babel, expect, zip bundles (#13588) 2022-04-18 11:31:58 -07:00
Pavel Feldman 5f843c347d
chore: bundle pixelmatch, it has not changed for 2 years (#13585) 2022-04-15 16:58:31 -07:00
Yury Semikhatsky 7ffce1da53
chore: remove PlaywrightClient and Docker factory (#13571) 2022-04-15 12:11:38 -07:00
Yury Semikhatsky aee6ba299a
chore: remove GridClient, run only page tests in service mode (#13566) 2022-04-14 15:30:04 -07:00
Ross Wollman 11179982fc
chore: force localPaths to be resolved (#13544) 2022-04-14 11:19:36 -07:00
github-actions[bot] a29a986d67
feat(chromium): roll to r1002 (#13554)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-14 14:51:03 +02:00
Max Schmitt 584140f97a
fix: make fetch api work with connectOverCDP (#13521) 2022-04-14 12:53:49 +02:00
Dmitry Gozman 20dcc45afa
feat: support experimental doc entries (#13446)
feat: support experimental doc entries

- Params/options/members are marked as experimental in the docs.
- `experimental.d.ts` is generated that contains all types and
  includes experimental features.
- `experimental.d.ts` is references in our tests so that we
  can test experimental features.
- `fonts` option is restored as experimental.
2022-04-13 16:13:30 -07:00
Yury Semikhatsky e2fff31848
chore: send run_id from agent to server (#13542) 2022-04-13 12:13:35 -07:00
Yury Semikhatsky 00199b5617
chore: add link to workflow (#13541) 2022-04-13 11:56:00 -07:00
Andrey Lushnikov 269716d7d7
revert(#12877): chore: print error if install-deps is used != ubuntu (#13536)
Reason: turns out Debian Buster requires just one source list to
install `ttf-ubuntu-font-family` font.

All other dependencies are satisfied.

Fixes #13530
2022-04-13 11:03:28 -07:00
Yury Semikhatsky 9b8aceaa61
feat: support os parameter (#13511) 2022-04-12 22:20:48 -07:00
Dmitry Gozman 7a5b070e95
fix(type): focus switch between contenteditables in shadow dom (#13510)
Firefox has a bug: calling `node.focus()` does make the node focused,
but some internal "current contenteditable node" is not changed.
Blurring the previous one and focusing the new one helps.
2022-04-12 16:44:27 -07:00
Yury Semikhatsky ae4d2e75aa
chore: adjust gha agent params (#13509) 2022-04-12 13:39:08 -07:00
Max Schmitt 95d4041b8b
chore: fix mark-docker-image CLI command (#13499) 2022-04-12 10:10:34 -07:00
Andrey Lushnikov 0f6638190e
fix: do not require --force flag when installing channel on CI (#13487) 2022-04-11 13:42:21 -07:00
Yury Semikhatsky 9712b9ee08
fix: match against secure path (#13442) 2022-04-08 14:57:43 -07:00
Yury Semikhatsky 212c665152
fix: pass full grid url to agent (#13438) 2022-04-08 14:15:38 -07:00
Pavel Feldman f0156d057e
chore: flatten supplements (#13437) 2022-04-08 12:52:40 -07:00
kaivean d65263f151
feat(android): allow getting webviews by socket name (#13248) 2022-04-08 20:52:16 +02:00
github-actions[bot] d91349f22a
feat(webkit): roll to r1629 (#13407) 2022-04-08 11:50:53 -07:00
Ross Wollman db7bd8ebd2
chore: don't auto-install browsers if global install (#13299) 2022-04-08 10:46:24 -07:00
github-actions[bot] e72975d9c6
feat(chromium): roll to r1001 (#13424)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-08 18:39:42 +02:00
Dmitry Gozman dfb1584703
chore: remove MEMUSAGE workaround on Windows (#13408)
This was introduced in #7500 to fight `ERROR: The process "4436" not found.`
messages when killing a process that did already exit.

Since then, we no longer inherit stdout/stderr, so the error message
should not appear anymore.
2022-04-08 09:37:51 -07:00
Pavel Feldman 845e32cbb8
chore: use utils via index export (6) (#13417) 2022-04-07 21:48:41 -07:00
Pavel Feldman e79b90f454
chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
Dmitry Gozman 155bb7fcae
fix: wait for cleanup on double SIGINT (#13411)
This is a speculative fix to leftover tmp directories.
When users issues SIGINT twice, we enter `gracefullyClose()`
twice, and shortcut the second time. It turns out, we do
not wait for directories removal.

Note: it is unknown how often we reach this codepath in practice.
2022-04-07 19:20:54 -07:00
Yury Semikhatsky f803a929e4
feat: pass server address as argument (#13412) 2022-04-07 17:22:52 -07:00
Pavel Feldman a3c02222bf
chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
Pavel Feldman 40d5e3a3c9
chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
Pavel Feldman 6c1fa62000
chore: use utils via index export (2) (#13399) 2022-04-07 13:28:30 -07:00
Pavel Feldman dbafe3bb4e
chore: use utils via index export (1) (#13398) 2022-04-07 13:26:50 -07:00
Dmitry Gozman b7116906fc
feat(remote): support headless/x-playwright-headless (#13391)
This only applies when remote launches the browser.
2022-04-07 10:19:56 -07:00
Pavel Feldman 90d5990e75
chore: fix installation scripts (#13376) 2022-04-06 23:09:10 -07:00
Pavel Feldman bde7bf4ea9
chore: move registry & dispatchers to under server (#13370) 2022-04-06 22:21:27 -07:00
Yury Semikhatsky 32d30ae71d
chore: fix assert imports (#13359) 2022-04-06 21:30:48 -07:00
Yury Semikhatsky fccc14cdfa
feat: github agent, browser worker (#13336) 2022-04-06 18:03:27 -07:00
Pavel Feldman c80365dd43
chore: distill deps after import types update (#13367) 2022-04-06 15:41:08 -07:00
Pavel Feldman 5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Pavel Feldman 1c3db811f5
chore: move to folder-based deps lists (#13361) 2022-04-06 14:40:19 -07:00
Dmitry Gozman faaac318f4
chore: remove elementsFromPoint workaround (#13184)
The issue was fixed upstream in r982637.
2022-04-05 19:37:07 -07:00
Pavel Feldman 6ca58e18cb
fix(electron): better support for custom schemas (#13329) 2022-04-05 16:10:12 -07:00
Yury Semikhatsky cdef8171c1
chore: extract remote connection to a separate file (#13331) 2022-04-05 14:47:11 -07:00
github-actions[bot] 67c251f483
feat(chromium): roll to r1000 (#13327)
References #13198

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-05 11:05:01 -07:00
Max Schmitt 844ecbe2eb
chore: better Electron error message when no executable path is given (#13318) 2022-04-05 18:45:21 +02:00
Pavel Feldman 23d9dbc011
chore: rewrite non-web protocol for Electron tracing (#13305) 2022-04-04 20:56:04 -07:00
Dmitry Gozman a09b8dfa36
chore: unrelease 'fonts' screenshot option (#13300) 2022-04-04 14:51:11 -07:00
Pavel Feldman 1bebc28aed
chore: reset page/context for reuse in component tests (#13264) 2022-04-04 12:39:43 -07:00
Pavel Feldman 8232497c88
feat(electron): expose app process(), detach on exit (#13280) 2022-04-04 11:50:46 -07:00
Ross Wollman 42798b5857
chore: warn against using globally scoped install (#13196) 2022-04-03 20:26:23 -07:00
Pavel Feldman b0103566c9
fix(addInitScript): tolerate trailing comments (#13275) 2022-04-03 18:47:12 -07:00
Pavel Feldman bcb12fcf7f
chore: mark public methods on server as such (#13271) 2022-04-02 19:02:27 -07:00
kaivean 5d2e8918d8
feat(android): add androidDevice.options.omitDriverInstall (#13249) 2022-04-02 16:00:38 -07:00
Dmitry Gozman a200fe3528
feat(screenshot): rename "size" option to "scale" (#13254)
Drive-by: fix `caret` handling in `toHaveScreenshot`.
2022-04-01 12:28:40 -07:00
Dmitry Gozman 356fc35b85
feat(role selector): allow unquoted name attribute (#13224)
- This supports `role=button[name=Hello]` similarly to CSS selectors.
- Does not change `_react` or `_vue` behavior that insist on quoting the string.
- Uses CSS notion of "identifier" characters.
2022-04-01 10:08:02 -07:00
Andrey Lushnikov a87794dae6
fix: demand --force to re-install stable browser channels (#13200)
This patch will check if browser channel is already installed.
If it is, it'll abort installation with the following error:

```
aslushnikov:~/prog/playwright$ npx playwright install msedge
Failed to install browsers
Error:
╔═════════════════════════════════════════════════════════════════╗
║ ATTENTION: "msedge" is already installed on the system!         ║
║                                                                 ║
║ "msedge" installation is not hermetic; installing newer version ║
║ requires *removal* of a current installation first.             ║
║                                                                 ║
║ To *uninstall* current version and re-install latest "msedge":  ║
║                                                                 ║
║ - Close all running instances of "msedge", if any               ║
║ - Use "--force" to install browser:                             ║
║                                                                 ║
║     npx playwright install --force msedge                       ║
║                                                                 ║
║ <3 Playwright Team                                              ║
╚═════════════════════════════════════════════════════════════════╝
```

To re-install browser channel, use `--force`.

Fixes https://github.com/microsoft/playwright/issues/13061
2022-04-01 10:05:53 -07:00
Yury Semikhatsky 7d7fe3c618
fix(route): remove cors option, compare origin (#13231) 2022-03-31 19:21:21 -07:00
Dmitry Gozman 9fc95dda84
fix(screenshot): do not stall on hideHiglight attempt 2 (#13222)
It turns out that "non stalling evaluate" can stall in Chromium
in some weird conditions, like `document.open` after some weird
`iframe.src` value.

We now only hide highlight in those frames where we did install
highlight in the first place.
2022-03-31 15:33:29 -07:00
Dmitry Gozman e5182259b1
feat(role selector): docs and minor fixes (#13203)
- Added docs to `selectors.md`.
- `[pressed]` and `[checked]` do not match `"mixed"` states.
- Disallow `[name]` shorthand without a value.
- Renamed `includeHidden` to `include-hidden`.
2022-03-31 13:06:39 -07:00
Dmitry Gozman a8d4a8aa52
fix(text selector): ignore non-leading quote when parsing (#13170)
Previously, any unpaired quote in the text selector "escaped"
everything till the end of the selector string, and so any
subsequent chained selectors, including ">>" separator were ignored.

An example of misbehaving selector: `text=19" >> nth=1`.

Now, when text selector contains a non-leading quote, selector parser
does not assume it should escape ">>" separator and correctly
tokenizes all selectors from the chain.

Note that this behavior is a workaround for the fact that our
text selectors is somewhat poorly defined in this area. That said,
this workaround seems to be safe enough. It still does not work for
unpaired leading quotes like this: `text="19 >> nth=1`.
2022-03-30 09:33:32 -07:00
Andrey Lushnikov a9989852d5
feat(vrt): new option "caret" for taking screenshots (#13164)
This has two values:
- `"hide"` to hide input caret for taking screenshot
- `"initial"` to keep caret behavior unchanged

Defaults to `"hide"`.

Fixes #12643
2022-03-29 17:48:13 -07:00
Dmitry Gozman eb09306db2
feat(connect): add connectOptions.timeout (#13163) 2022-03-29 15:03:43 -07:00
Dmitry Gozman 6b48631eed
feat(role): add more tests for accessible name (#13154) 2022-03-29 11:59:44 -07:00
github-actions[bot] 54f6e5db19
feat(firefox): roll to r1322 (#13150)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-29 11:28:20 -07:00
Pavel Feldman 1961959dcb
chore: migrate injected scripts to esbuild (#13143) 2022-03-28 23:10:17 -07:00
Pavel Feldman 8758cf8cbf
chore: migrate html reporter to vite (#13116) 2022-03-28 18:21:19 -07:00
Dmitry Gozman 01a39e5b4c
test(role): add tests for implicit role calculation (#13132) 2022-03-28 15:22:50 -07:00
Philip Sanetra be41c4a35d
fix(registry): Fix support for generic-linux (#13129)
Fixes https://github.com/microsoft/playwright/issues/13128
2022-03-28 14:50:56 -07:00
Dmitry Gozman 8c19f71c36
feat(selectors): role selector engine (#12999)
This introduces `role=button[name="Click me"][pressed]` attribute-style
role selector. It is only available under `env.PLAYWRIGHT_EXPERIMENTAL_FEATURES`.

Supported attributes:
- `role` is required, for example `role=button`;
- `name` is accessible name, supports matching operators and regular expressions:
  `role=button[name=/Click(me)?/]`;
- `checked` boolean/mixed, for example `role=checkbox[checked=false]`;
- `selected` boolean, for example `role=option[selected]`;
- `expanded` boolean, for example `role=button[expanded=true]`;
- `disabled` boolean, for example `role=button[disabled]`;
- `level` number, for example `role=heading[level=3]`;
- `pressed` boolean/mixed, for example `role=button[pressed="mixed"]`;
- `includeHidden` - by default, only non-hidden elements are considered.
   Passing `role=button[includeHidden]` matches hidden elements as well.
2022-03-28 09:24:58 -07:00
Yury Semikhatsky 5734c18ef8
feat(route): add cors header in route.fulfill (#12943) 2022-03-25 14:56:57 -07:00
Andrey Lushnikov 4ab4c0bda1
feat: detect docker version and Playwright version mismatch (#12806)
This patch prints a friendly instructions in case Docker image version
mismatches Playwright version and there are missing browser
dependencies.

With this patch, Playwright will yield the following error:

```
root@f0774d2b2097:~# node a.mjs
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch:
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers.                                       ║
║ This is most likely due to docker image version not matching Playwright version:           ║
║ - Playwright: 1.22.0                                                                       ║
║ -     Docker: 1.21.0                                                                       ║
║                                                                                            ║
║ Either:                                                                                    ║
║ - (recommended) use docker image "mcr.microsoft.com/playwright:v1.22.0-focal"              ║
║ - (alternative 1) run the following command inside docker to install missing dependencies: ║
║                                                                                            ║
║     npx playwright install-deps                                                            ║
║                                                                                            ║
║ - (alternative 2) use Aptitude inside docker:                                              ║
║                                                                                            ║
║     apt-get install libgbm1                                                                ║
║                                                                                            ║
║ <3 Playwright Team                                                                         ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝
    at file:///root/a.mjs:3:10 {
  name: 'Error'
}```

Fixes #12796

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-03-25 14:45:53 -07:00
Pavel Feldman 6b81e76c2b
chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
Yury Semikhatsky 97e8ead57c
feat: large files upload in ff and wk (#12937) 2022-03-25 13:26:12 -07:00
Pavel Feldman 07c1a27732
chore(deps): prepare deps for monorepo (#13057) 2022-03-25 08:43:29 -07:00
Yury Semikhatsky 136c4e10e6
Revert "chore: align setInputFiles in webkit with other browsers (#13011)" (#13021)
This reverts commit 7fe763c1fc.
2022-03-24 07:46:37 -07:00
Dmitry Gozman 91408f2c5e
fix(storageState): provide nice error message for storage state issues (#13019) 2022-03-24 07:33:51 -07:00
Yury Semikhatsky 7fe763c1fc
chore: align setInputFiles in webkit with other browsers (#13011) 2022-03-23 16:07:47 -07:00
Ross Wollman 39376cccd8
fix: allow unnamed cookies (#12991)
Fixes #12808.
2022-03-23 15:50:43 -07:00
Andrey Lushnikov bbc1a4fea0
fix: print all missing libraries when used on unsupported linux distro (#12966)
This patch:
- Adds 3 new host platform types:
  * `generic-linux` and `generic-linux-arm64` for the unsupported
    linux distributions
  * `<unknown>` for non-supported OS versions
- Prints a warning when downloading Ubuntu browser builds on
  unsupported Linux distribution
- Makes sure launch doctor prints all missing shared libraries
  on unknown Linux distributions
- Also prints an `apt` command as an alternative to Playwright CLI
  dependency installation.
2022-03-23 14:06:14 -07:00
github-actions[bot] 53b84541ab
feat(chromium): roll to r983172 (#12995)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-23 20:34:23 +01:00
github-actions[bot] 2d5762c842
feat(webkit): roll to r1620 (#12971) 2022-03-23 11:30:42 -07:00
Max Schmitt b69d0566bb
chore: disable Chromium CertificateTransparencyComponentUpdater feature (#12992) 2022-03-23 19:14:22 +01:00
Dmitry Gozman 722302799e
feat(selectors): support regular expressions in attribute selectors (#12960)
Supports inline regex in addition to string: `_react=BookItem[author = /Ann?a/i]`.
This is similar to `text=` selector, but applies to `_react` and `_vue`
selectors. In the future, will also apply to `role=` selector.
2022-03-22 17:00:56 -07:00
Brian Rhoten fb83d4b42c
fix(codegen): do not consider empty attributes for selector generation (#12880)
Co-authored-by: Brian Rhoten <brhoten@appriss.com>
2022-03-22 13:56:33 -07:00
Brandon Walderman 7db40071a8
fix(selenium): Use ms:edgeOptions with Edge. (#12933) 2022-03-22 12:46:00 -07:00
Dmitry Gozman 4b877213a1
fix(tracing): preserve control values without modifying DOM (#12939)
Previously, we preserved input/textarea values by providing
`value` attribute or text child. This produces DOM that does not
actually match the original page.

This change starts using special attributes to modify values
directly when rendering.

Same treatment is also applied to options in `select` and
`checked` property of checkboxes and radio buttons.
2022-03-21 18:51:48 -07:00
Dmitry Gozman dea6528c0c
feat(aria): introduce role utils (#12916)
This includes aria role and accessible name computation.
Accessible name is covered by wpt tests.
2022-03-21 17:26:45 -07:00
Andrey Lushnikov 7f51336068
fix: allow toMatchSnapshot to use text comparator for text data (#12934)
This was regressed awhile ago.

In v1.17 we shipped the following code: 30e15ad36f/packages/playwright-test/src/matchers/golden.ts (L122-L131)

`toMatchSnapshot` should fallback to text comparator in case of
unknown extension and string data.

Fixes #12862
2022-03-21 16:42:21 -07:00
github-actions[bot] 478a75401a
feat(webkit): roll to r1619 (#12905) 2022-03-21 15:15:56 -07:00
Andrey Lushnikov c18077c0de
feat(toHaveScreenshot): align screenshot generation & comparison (#12812)
This patch aligns the strategies that are used to generate new
screnshot expectations and to compare screenshot expectations against
baseline.

With this patch, `toHaveScreenshot` will:
- when generating a new expectation: will wait for 2 consecutive
  screenshots to match and accept the last one as expectation.
- when given an expectation:
  * will compare first screenshot against expectation. If matches,
    resolve successfully
  * if first screenshot doesn't match, then wait for 2 consecutive
    screenshots to match and then compare last screenshot with the
    expectation.

An example of a new detailed call log:

```
  1) a.spec.ts:3:1 › should work ===================================================================

    Error: Screenshot comparison failed:

      20000 pixels (ratio 0.03 of all image pixels) are different

    Call log:
      - expect.toHaveScreenshot with timeout 5000ms
      -   verifying given screenshot expectation
      - fast-path: checking first screenshot to match expectation
      - taking page screenshot
      -   disabled all CSS animations
      -   waiting for fonts to load...
      -   fonts in all frames are loaded
      - fast-path failed: first screenshot did not match expectation - 20000 pixels (ratio 0.03 of all image pixels) are different
      - waiting for 2 consecutive screenshots to match
      - waiting 100ms before taking screenshot
      - taking page screenshot
      -   disabled all CSS animations
      -   waiting for fonts to load...
      -   fonts in all frames are loaded
      - 2 consecutive screenshots matched
      - final screenshot did not match expectation - 20000 pixels (ratio 0.03 of all image pixels) are different
      - 20000 pixels (ratio 0.03 of all image pixels) are different

    Expected: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-expected.png
    Received: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-actual.png
        Diff: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-diff.png

      3 | test('should work', async ({ page }) => {
      4 |   await page.goto('file:///Users/andreylushnikov/prog/playwright/tests/assets/rotate-z.html');
    > 5 |   await expect(page).toHaveScreenshot();
        |                      ^
      6 | });
      7 |
```
2022-03-21 15:10:33 -07:00
github-actions[bot] 9a60067fc2
feat(chromium): roll to r982481 (#12903)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-19 13:06:55 +01:00
Pavel Feldman e044bae888
chore: make count() work with _vue selectors (#12899) 2022-03-18 21:22:33 -07:00
Dmitry Gozman 85b01056b6
fix(click): workaround elementsFromPoint issue in Chromium (#12888)
Block elements inside elements are not returned correctly
from `document.elementsFromPoint(x, y)` in some cases.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1307458 for details.
2022-03-18 18:20:48 -07:00
Pavel Feldman 98ed81dc00
chore: do not initialize full sessions for pages used in session restore (#12886) 2022-03-18 18:17:37 -07:00
Max Schmitt dd32956ccc
chore: improve handling with missing xserver (#12724) 2022-03-18 22:39:11 +01:00
Max Schmitt d795f5dd64
chore: print error if install-deps is used != ubuntu (#12877) 2022-03-18 19:13:11 +01:00
Yury Semikhatsky a8d80621b2
feat(chromium): large file uploads (#12860) 2022-03-18 09:00:52 -07:00
Pavel Feldman c7d6f96328
chore: disambiguate internal flags (#12866) 2022-03-17 18:27:33 -07:00
Yury Semikhatsky 1284ab8101
feat(webkit): bump to 1617, freeze macOS 10.15 (#12790) 2022-03-15 16:09:56 -07:00
Dmitry Gozman f8c4cb3d24
fix(screenshot): do not stall on hideHighlight (#12764) 2022-03-15 14:13:45 -07:00
github-actions[bot] 08c29b305b
feat(chromium): roll to r980398 (#12757)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-14 18:51:46 -07:00
Andrey Lushnikov 88610c8b4c
fix: properly define apiName for web-first assertions (#12706)
Turns out relying on PWTRAP in stack is not reliable: depending on the
call structure, the stack might be cut unpredictably by Node.js.

This patch removes PWTRAP and instead plumbs explicit stack and
pre-set `apiName` all the way down to `wrapApiCall`.
2022-03-14 18:01:13 -07:00
Yury Semikhatsky 990224bde4
Revert "feat(webkit): bump to 1617 (#12738)" (#12760)
This reverts commit 77824ee19e.
2022-03-14 17:08:32 -07:00
Yury Semikhatsky 77824ee19e
feat(webkit): bump to 1617 (#12738) 2022-03-14 15:11:21 -07:00
Max Schmitt adcd32fc6e
fix(expect): toHaveCSS with custom CSS properties (#12709) 2022-03-12 09:32:40 -08:00
github-actions[bot] ffc8031bad
feat(chromium): roll to r980066 (#12705)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-12 09:07:57 +01:00
Andrey Lushnikov ef4b34fb7a
feat(toHaveScreenshot): enhance messaging in case of failures (#12677)
This patch:
- adds call logs to track screenshot timeouts, e.g. due to
  waiting for web fonts
- makes sure all snapshot expectations have `.png` extension
- throws a polite error when given a buffer or a string instead of a
  page or a locator
- removes stray NL between error description and call log
- makes sure `apiName` is always correct (and adds a test for it)
2022-03-11 22:40:28 -08:00
Andrey Lushnikov e83549e8a0
fix: support all commong screenshot options in toHaveScreenshot (#12670)
This patch adds support for all common options in
`expect.toHaveScreenshot`.
2022-03-10 18:36:20 -08:00
Andrey Lushnikov 65b9cba143
chore: follow-up to animations default option (#12669)
This is a follow-up to 42765804bc
that was landed without bots.

I ran the bots manually on Linux & Mac.
2022-03-10 17:26:50 -08:00
Andrey Lushnikov 42765804bc
chore: add "allow" as a default value for animations. (#12663) 2022-03-10 17:15:36 -08:00
Andrey Lushnikov 49e66c7f08
feat(screenshot): introduce new "fonts" option for screenshots (#12661)
This option will wait for webfonts to load before taking screenshots.
2022-03-10 16:54:36 -08:00
Dmitry Gozman a388bb2302
feat(screenshot): size:'css'|'device' option (#12634)
With this experimental option, screenshot dimensions are in CSS pixels,
not physical device pixels, effectively ignoring the device scale factor.
2022-03-10 13:07:10 -08:00
Yury Semikhatsky d49843edaa
fix(firefox): add missing dependency on Ubuntu 18.04 (#12625) 2022-03-09 11:21:15 -08:00
Dmitry Gozman 682eeb4ae0
reland(hooks): separate test timeout from beforeAll/afterAll timeouts (#12609)
This makes it possible to have longer `beforeAll`/`afterAll` and not
affect first/last test timeout.
2022-03-08 19:05:23 -08:00
Dmitry Gozman 62a032baa0
chore: remove env.PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK (#12605) 2022-03-08 16:42:39 -08:00
github-actions[bot] 04e03728b8
feat(chromium): roll to r978106 (#12585)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-03-08 21:05:56 +01:00
Andrey Lushnikov 497b51ad8c
fix(toHaveScreenshot): fix initial screenshot time (#12576)
Instead of being taken immediately, first screenshot was actually
taken after 1 second.
2022-03-08 09:30:14 -08:00
github-actions[bot] 18e6aa3f15
feat(firefox): roll to r1319 (#12587)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-08 09:19:00 -08:00
Dmitry Gozman d836ed41d3
feat(remote): send 'x-playwright-browser' header (#12556) 2022-03-07 10:30:53 -08:00
Siddharth Singha Roy a2b3d4f570
feat(cli) : allow passing PlaywrightServer.startDefault parameters via cli (#12530) 2022-03-07 09:15:46 -08:00
github-actions[bot] 702536d962
feat(webkit): roll to r1616 (#12541)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2022-03-06 12:22:47 +01:00
Andrey Lushnikov d7648d390c
fix(toHaveScreenshot): round ratio up (#12540)
This way the ratio value could be used right away in configuation.
2022-03-04 18:55:48 -08:00
Andrey Lushnikov 6dac01aec7
fix: implement log scale back-off for screenshots (#12504)
References https://github.com/microsoft/playwright/issues/12441
2022-03-04 18:17:57 -08:00
github-actions[bot] adb2847d84
feat(firefox): roll to r1318 (#12537)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-04 17:29:35 -08:00
Max Schmitt 5fd43edcbb
chore: fix android tests after #12220 (#12535) 2022-03-05 00:18:03 +01:00
Karan Shah fd1a1a2b1c
feat(android): Adding custom port parameter to connect to different adb server port (#12220) 2022-03-04 20:27:25 +01:00
Yury Semikhatsky 50cc1641d1
fix(webkit): add libopengl0 to the native deps (#12526) 2022-03-04 11:13:34 -08:00
Andrey Lushnikov b45c788a33
fix(disable-animations): rename boolean to enum (#12503)
Enums are more flexible in the long run since they let us easily
extend API.

References #12441
2022-03-04 11:02:59 -08:00
Andrey Lushnikov 1f5cfcaeec
fix(to-have-screenshot): show number of bad pixels in mismatched error (#12502)
Drive-by: do not show empty call log.

References #12441
2022-03-04 11:01:05 -08:00
github-actions[bot] ab40d934ad
feat(chromium): roll to r976882 (#12516)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-04 14:48:25 +01:00
Andrey Lushnikov 279e579097
chore: address pixelCount and pixelRatio review comments (#12501)
- documentation fixes
- rename pixelCount to maxDiffPixels
- rename pixelRatio to maxDiffPixelRatio
2022-03-03 23:17:31 -08:00
Max Schmitt 3db4b48bd3
fix(cli): fix wrong property for passing browser name (#12489) 2022-03-03 17:17:23 +01:00
Max Schmitt b2e3357613
chore: throw error if setCookies expires value is not valid (#12470) 2022-03-02 23:10:40 +01:00
Yury Semikhatsky 2d7ec26dc2
fix(fetch): send secure cookies for http://localhost requests (#12450) 2022-03-02 09:33:30 -08:00
Pavel Feldman 61a6cdde70
feat(api): expose locator.highlight (#12420) 2022-03-01 13:56:21 -08:00
Pavel Feldman b79bb32c82
chore: do not stall on actions when test timeout is 0 (#12418) 2022-03-01 13:43:38 -08:00
Pavel Feldman a612a3526a
chore: auto-detect ts esm mode (#12292) 2022-03-01 12:56:26 -08:00
Max Schmitt e0e6b66cbe
chore(android): align android context options with mixin (#12401) 2022-03-01 18:11:38 +01:00
Pavel Feldman 6a663ef54f
chore(test-runner): revert recent changes to fix tests (#12439)
* Revert "fix(hooks): separate test timeout from beforeAll/afterAll timeouts (#12413)"

This reverts commit 73dee69558.

* Revert "fix(test-runner): rely on test title paths instead of ordinal (#12414)"

This reverts commit d744a87aee.

* Revert "chore(test runner): run hooks/modifiers as a part of the test  (#12329)"

This reverts commit 47045ba48d.
2022-03-01 09:11:17 -08:00
Max Schmitt d2ae6a9db2
fix: isDisabled check with option/optgroup (#12437) 2022-03-01 18:10:16 +01:00
github-actions[bot] 5efd7fb356
feat(chromium): roll to r975608 (#12425)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-01 09:22:47 +01:00
Andrey Lushnikov a0cf33bbb0
fix: beautiful toHaveScreenshot in tracing (#12422) 2022-02-28 23:30:00 -08:00
Dmitry Gozman 73dee69558
fix(hooks): separate test timeout from beforeAll/afterAll timeouts (#12413)
This makes it possible to have longer `beforeAll`/`afterAll` and not
affect first/last test timeout.
2022-02-28 15:09:04 -08:00
Mateusz Burzyński eaa98ce53a
feat(keyboard): support simple copy-pasting using meta+c/v (#10828)
It's a straightforward change to support new, common, keyboard commands

Note that I've tested this locally with Chrome on my Mac but it seems that CI doesn't want to pass Chrome tests - it's running on ubuntu though. Does this mean that I should introduce per-platform editing commands? At the moment there is only a single [`macEditingCommands`](0ed33522c5/packages/playwright-core/src/server/macEditingCommands.ts) file.

References https://github.com/microsoft/playwright/issues/12000

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-02-28 13:43:43 -08:00
Andrey Lushnikov 396d920145
feat(test-runner): implement expect(pageOrLocator).toHaveScreenshot (#12242)
Fixes #9938
2022-02-28 12:25:59 -08:00
Andrey Lushnikov 8d94ed134c
fix: add snapshots for page and elementHandle screenshots (#12411)
Fixes #12280
2022-02-28 11:52:54 -08:00
github-actions[bot] 80a38a39c2
feat(chromium): roll to r974924 (#12377)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-26 07:52:27 +01:00
Max Schmitt 41e9b36f63
fix: install-deps did not throw on non 0 exit code (#12375) 2022-02-26 00:45:27 +01:00
Dmitry Gozman 3c2bca2768
fix(test loader): implement tsconfig paths through resolveFilename (#12357)
This uses `Module._resolveFilename` to intercept module resolution and
check `tsconfig.paths` similarly to pirates usage ot `Module._compile`.

Previously, we resolved during compilation that required reproducible
resolution due to caching. Now we can resolve as we go and support
all `tsconfig.paths`.
2022-02-25 15:43:58 -08:00
nswbmw b47c95c20c
feat: add iPhone 12 Mini (#11429)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-02-25 12:15:58 +01:00
Max Schmitt 821a8e93c7
chore: do not double trim in trace viewer (#12338) 2022-02-24 21:55:50 +01:00
Max Schmitt 0b55950d6a
chore: fix Android tests (#12325) 2022-02-24 06:57:32 +01:00
Andrey Lushnikov df7fbe7857
Revert "chore: best-effort cleanup for output folders that are mounted (#12300)" (#12321)
This reverts commit e5c9d1e39f.

Reason for revert: turns out this fix results in a 5-second delay
when starting tests in docker, with `test-results` folder being
a non-removable mount.

The reason for the delay is the `maxBusyTries` option that we
supply by default to rimraf when trying to remove the folder.

While this option might come handy when removing temporary
browser profile folder, it doesn't serve us well in this particular
usecase.

References #12106
2022-02-23 14:10:11 -08:00
Andrey Lushnikov e5c9d1e39f
chore: best-effort cleanup for output folders that are mounted (#12300)
Fixes #12106
2022-02-23 12:55:41 -08:00
github-actions[bot] cbe075135c
feat(chromium): roll to r973391 (#12279)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-22 11:33:25 +01:00
github-actions[bot] 222033d6b2
feat(chromium): roll to r972766 (#12248)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-21 11:30:30 +01:00
Pavel Feldman b8cf5ac661
fix(electron): do not attach external debugger when running Electron tests (#12250) 2022-02-19 17:46:26 -08:00
Andrey Lushnikov 18fdf927b7
chore: simplify screenshot option handling (#12245)
#9938
2022-02-18 21:34:56 -08:00
Dmitry Gozman a7ef1da5e9
fix(selenium): support MicrosoftEdge (#12235) 2022-02-18 14:44:15 -08:00
Andrey Lushnikov 0682672242
chore: move comparator logic to playwright-core (#12232)
This will enable implementation of `toHaveScreenshot` on the
server-side.

Drive-by: drop blink-diff

References #9938
2022-02-18 14:39:17 -08:00
github-actions[bot] 0518176f4a
feat(chromium): roll to r969391 (#12228)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-18 18:54:58 +01:00
Dmitry Gozman edac84d072
feat(remote): send browser/channel/headless in a header (#12205) 2022-02-18 07:54:33 -08:00
Dmitry Gozman 15043801cb
chore: use transport for BrowserType.connect (#12196)
This gives us logging, ECONNRESET error handling and proper cleanup.
2022-02-17 20:48:14 -08:00
Andrey Lushnikov c98d595bea
fix: support hiding caret in case of matching style rule (#12172) 2022-02-17 14:05:56 -08:00
Max Schmitt 21ae298015
fix(trace-viewer): don't crash when argument is null (#12186) 2022-02-17 22:12:42 +01:00
Max Schmitt 4115235f4d
feat(codegen): use web-first page assertions to match URL (#12177) 2022-02-17 20:52:35 +01:00
Max Schmitt a667d94d45
chore(codegen): do not over-escape spaces (#12155) 2022-02-17 01:01:46 +01:00
Max Schmitt 92045b7faf
feat(codgen): support radio buttons (#12157) 2022-02-16 19:10:00 +01:00
Dmitry Gozman 47cc7c4ae8
chore: refactor internal cli commands to use commander (#12146) 2022-02-16 09:54:12 -08:00
Yury Semikhatsky 08fd8d0762
fix(tracing): do not capture iframes in head (#12126) 2022-02-16 09:09:15 -08:00
Pavel Feldman d4deefbad3
feat(firefox): roll to r1317 (#12120) 2022-02-15 21:55:52 -08:00
pierscowburn 5db7ce5964
fix: propagate exit code in experimental mode (#12070)
In experimental ESM mode a child process is forked in order to run the tests. Currently the exit code of this child process is not propagated to the exit code of the parent process, which means that the process exits with a status code of `0` even if some of the tests failed.

This makes it difficult to use Playwright in CI in experimental mode, as the CI pipeline as a whole will pass despite the test failures.

This change addresses this by propagating the exit code in the case where it is non-zero.
2022-02-15 13:10:35 -08:00
Andrey Lushnikov e6d79a4f10
fix(docker): add missing dependency to the docker 1.19 (#12124)
The `libxtst6` is required in both amd64 and arm64.

Fixes #12075
2022-02-15 10:25:59 -08:00
Yury Semikhatsky f15610b874
fix(fetch): always return non-empty body regardless of request method (#12102) 2022-02-15 09:06:21 -08:00
Andrey Lushnikov 363b8a6970
feat: support mask option in screenshot methods (#12072)
Fixes https://github.com/microsoft/playwright/issues/10162
2022-02-15 07:05:05 -08:00
Dmitry Gozman 5a0445b8da
feat(remote): let client enable/disable sock proxy (#12086) 2022-02-14 15:10:58 -08:00
Andrey Lushnikov 6c89f160e8
fix(highlight): drive-by fixes to selector highlight (#12083) 2022-02-14 10:32:18 -08:00
Dmitry Gozman fb00991a78
chore: intercept socks proxy in the driver (#12021) 2022-02-13 14:03:47 -08:00
Dmitry Gozman ccb09acdba
fix(remote): make playwright server work with firefox-beta (#12039)
It is not considered "channel", but rather a "tool".
2022-02-11 14:02:02 -08:00
Max Schmitt 7e7996a7b7
chore(dotnet): do not use global CLI and use ps1 instead (#12025)
Fixes https://github.com/microsoft/playwright-dotnet/issues/2005
2022-02-11 11:26:16 -08:00
Joel Einbinder c6641321a0
chore: fix spelling error in comment (#12038) 2022-02-11 09:51:13 -08:00
Yury Semikhatsky abd7084bcc
fix: match default font families in headless chromium (#11340) 2022-02-11 09:06:17 -08:00
Pavel Feldman da2cecbea0
chore: don't close page in generated test (#12022) 2022-02-11 08:11:24 -08:00
Pavel Feldman 5ab7bc3a59
chore: headless mode for codegen (#12020) 2022-02-10 21:23:16 -08:00
Dmitry Gozman 66b5cf5ae1
feat(remote): make PlaywrightServer work with browserType.connect (#11849)
This changes PlaywrigtServer to serve connections like `ws://localhost:3333/?browser=chromium`:
- launches the browser;
- talks `browserType.connect`-style protocol over websocket;
- compatible with `connectOptions` fixture.

```js
await playwright.chromium.connect({ wsEndpoint: 'ws://localhost:3333/?browser=chrome' });
```
2022-02-10 16:36:23 -08:00
Dmitry Gozman 2bc19ae076
chore: extract SocksProxy to a spearate file (#12011) 2022-02-10 13:04:19 -08:00
Dmitry Gozman 9c66068971
fix(connect): make route.fulfill({ response }) work (#12006) 2022-02-10 12:05:04 -08:00
Mateusz Burzyński b0cd5b1420
feat(mouse): set .buttons correctly for basic mouse commands in Chrome (#10698)
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-02-09 20:48:16 -08:00
Dmitry Gozman 1f6b84f445
fix(mac): avoid printing empty line to stderr on mac (#11991)
It turns out, `sw_vers` prints an empty stderr line and we inherit it.
2022-02-09 15:34:10 -08:00
Dmitry Gozman ae7c52154f
fix(fixtures): make sure connected browser respects context options (#11990)
Connected browser was wired up to the wrong browserType object.
2022-02-09 15:25:15 -08:00
Andrey Lushnikov 6f87955243
feat: introduce disableAnimations option for screenshots (#11870)
This option stops all kinds of CSS animations while doing screenshot:
- CSS animations
- CSS transitions
- Web Animations

Animations get different treatment depending on animation duration:
- finite animations are fast-forwarded to its end, issuing the
  `transitionend` event.
- Infinite animations are resetted to its beginning, and then
  resumed after the screenshot.

References #9938, fixes #11912
2022-02-09 12:52:11 -08:00
Darío Kondratiuk 48cc41f3e7
feat: add key support on react engine (#11970)
I've got [this question](https://stackoverflow.com/questions/71050193/react-locator-example/71052432#71052432) on StackOverflow. And although, in that case, the `key` was part of the `props` attributes. That might not always be true.

I am bringing this to the tell to see what you think about this.
I'm also fixing a typo :)
2022-02-09 11:33:15 -08:00
Yury Semikhatsky f2773fbb3a
fix: include call log into browerType.launchServer TimeoutError (#11956) 2022-02-09 09:54:16 -08:00
Yury Semikhatsky 706c897031
feat(fixtures): respect tracing config for APIRequestContext (#11954) 2022-02-09 08:54:09 -08:00
Dmitry Gozman 19368e93af
feat(test runner): support connectOptions (#11919)
This allows to specify `connectOptions` in the config that
switch built-in `browser` to be remotely connected.
2022-02-08 20:45:42 -08:00
Pavel Feldman 9ce8572c78
chore: don't run debugger on pause() (#11948) 2022-02-08 14:24:13 -08:00
Yury Semikhatsky 985f932033
chore(trace-viewer): introduce MultiTraceModel (#11922) 2022-02-08 12:27:29 -08:00
Pavel Feldman 1b3c7c03b6
chore: fix(stack): ignore stack frames inside whole core (#11935) 2022-02-08 10:33:50 -08:00
Pavel Feldman 9f35a97a55
chore(chrome): tolerate unknown target types (#11936) 2022-02-08 09:46:05 -08:00
Pavel Feldman dbd124d84b
chore: disable page.pause() when JS debugger is attached (#11926) 2022-02-07 19:21:58 -08:00
Dmitry Gozman 7912c515a3
fix(fixtures): account for default options being undefined (#11916) 2022-02-07 17:11:36 -08:00
Yury Semikhatsky 1e00218ead
feat(tracing): suport loading multiple files in trace viewer (#11880) 2022-02-07 17:05:42 -08:00
Pavel Feldman c3c99a5f66
chore: shift left the inspector window. 2022-02-07 10:41:33 -08:00
Dmitry Gozman f82e09be04
feat(codegen): generate locators and frame locators (#11873) 2022-02-04 19:27:45 -08:00
Dmitry Gozman c45dacc834
feat(codegen): make selector generator strict (#11856)
This is required to migrate to locators.
2022-02-04 07:34:23 -08:00
Andrey Lushnikov 547a32885b
feat: hide blinking cursor when making screenshots (#11854)
References #9938
2022-02-03 21:44:23 -08:00
github-actions[bot] f96b1dd43b
feat(webkit): roll to r1609 (#11824) 2022-02-03 08:20:39 -08:00
Pavel Feldman 1215057ca1
chore: use ipc transport for out-of-process driver (#11826) 2022-02-02 21:26:45 -08:00
Dmitry Gozman f587a43932
feat(locator): "has" option (#11411)
This introduces `locator('div', { has: locator })` syntax that matches elements containing other elements.
Can be used together with `hasText`.

Internally, has selector engine takes an inner selector escaped with double-quotes:
`div >> has="li >> span >> text=Foo" >> span`.
2022-02-02 16:55:50 -08:00
github-actions[bot] fba523a9d0
feat(chromium): roll to r965416 (#11802)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-02-02 11:39:10 +01:00
Max Schmitt c752b28516
chore: pin production dependencies (#11793) 2022-02-02 11:14:41 +01:00
Andrey Lushnikov b0daa7754f
feat: filter stack traces to exclude test runner frames (#11795)
Before:

```bash
Running 1 test using 1 worker
  1) [chromium] › tests/example.spec.ts:3:1 › should work ==========================================

    Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      2 |
      3 | test('should work', async({page}) => {
    > 4 |   expect(1).toBe(2);
        |             ^
      5 | });
      6 |

        at Proxy.<anonymous> (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/expect.ts:151:30)
        at /Users/andreylushnikov/tmp/tests/example.spec.ts:4:13
        at /Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:335:13
        at runNextTicks (node:internal/process/task_queues:61:5)
        at processImmediate (node:internal/timers:437:9)
        at TestInfoImpl._runFn (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/testInfo.ts:164:7)
        at WorkerRunner._runTestWithBeforeHooks (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:317:24)
        at TimeoutRunner.run (/Users/andreylushnikov/prog/playwright/packages/playwright-core/src/utils/async.ts:48:14)
        at TestInfoImpl._runWithTimeout (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/testInfo.ts:151:7)
        at WorkerRunner._runTestOrAllHook (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:276:5)
        at WorkerRunner._runSuite (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:190:11)
        at WorkerRunner.run (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/workerRunner.ts:137:9)
        at process.<anonymous> (/Users/andreylushnikov/prog/playwright/packages/playwright-test/src/worker.ts:87:5)
```

after:

```
Running 1 test using 1 worker
  1) [chromium] › tests/example.spec.ts:3:1 › should work ==========================================

    Error: expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 1

      2 |
      3 | test('should work', async({page}) => {
    > 4 |   expect(1).toBe(2);
        |             ^
      5 | });
      6 |

        at /Users/andreylushnikov/tmp/tests/example.spec.ts:4:13
```
2022-02-01 18:40:44 -08:00
Max Schmitt 028afb167b
chore: bump production dependencies (#11787) 2022-02-01 21:27:34 +01:00
Caio Agiani b6b60decdf
fix: typos (#11789) 2022-02-01 11:09:41 -08:00
Yury Semikhatsky c2f6462a6b
fix(trace-viewer): info message for actions without snapshots (#11765) 2022-02-01 09:26:38 -08:00
Pavel Feldman c82f2641d7
fet(list-files): report per-project test dir and filters (#11764) 2022-02-01 08:08:56 -08:00
Andrey Lushnikov 2336692e8a
feat: support clarification message for expect (#11735)
The clarification message is displayed in the HTML report as the name of the step:

![image](https://user-images.githubusercontent.com/746130/151852652-48194140-5ea4-439d-afee-12583a8caf71.png)

It is also shown in terminal output:

![image](https://user-images.githubusercontent.com/746130/151852666-5c956ef1-6e94-4bc2-8e55-b58688dfc7e0.png)

Fixes #7816
2022-01-31 17:14:59 -08:00
Dmitry Gozman 0b04c7d504
fix(drag&drop): relax layout shift logic when dropping (#11760)
When element that is being dragged stays under the mouse,
it prevents the hit target check on drop from working,
because drop target is overlayed by the dragged element.

To workaround this, we perform a one-time hit target check
before moving for the drop, as we used to.
2022-01-31 16:21:35 -08:00
Andrey Lushnikov 3a4e506479
chore: extract SigIntWatcher (#11749)
This is to reduce the size of the long `_run` method in the `runner.ts`.
It also might come handy around the codebase.
2022-01-31 08:51:22 -08:00
Xiaoxing Ye a35c249fdc
fix: quote path to prevent space issue (#11733)
Co-authored-by: Xiaoxing Ye <xiaoye@microsoft.com>
2022-01-29 09:56:58 -08:00
Yury Semikhatsky 401cd9c0ee
fix(fetch): do not throw on empty response body with br encoding (#11708) 2022-01-28 12:58:58 -08:00
Yury Semikhatsky 84248f6e48
fix(webkit): handle will/didCheckPolicyForNavigation (#11631) 2022-01-27 14:58:43 -08:00
Yury Semikhatsky 480338d5f3
fix: create traces dir in /tmp instead of cwd (#11699) 2022-01-27 14:58:17 -08:00
Yury Semikhatsky d305a2ab3f
fix: throw in route.continue if it is called twice (#11701) 2022-01-27 14:58:02 -08:00
Andrey Lushnikov 0606afb2e6
chore: rename env variables (#11661)
These variables aren't CLI-only anymore, so pick some more general
names for them.

Note: all language ports would need to follow-up with the rename
after the next roll.

Fixes #11450
2022-01-27 09:06:43 -08:00
hackerman 872a4be752
fix(server): handle = in cookie values correctly (#11613) 2022-01-26 11:27:43 -08:00
Dmitry Gozman 687a16b848
feat(locator): introduce locator.page() getter (#11630) 2022-01-26 07:58:58 -08:00
Andrey Lushnikov 6a7a2971f2
fix(chromium): close all javascript dialogs when closing context (#11614)
Fixes #11581
2022-01-25 13:52:18 -08:00
Yury Semikhatsky 62bf59e310
browser(webkit): removed unused will/didCheckNewWindowPolicy (#11626) 2022-01-25 12:30:11 -08:00
Dmitry Gozman 800b813d4b
chore(test runner): prepare to per-fixture timeout (#11605)
This reworks DeadlineRunner to use exception to signal timeout. This way,
we'll be able to run fixtures against a shared deadline vs their own
deadline and still get an easy control-flow timeout handling.
2022-01-25 11:22:28 -08:00
Andrey Lushnikov 42876a0528
fix: support PWDEBUG=0 to disable debug (#11611)
Fixes #11606
2022-01-25 08:40:24 -08:00
Andrey Lushnikov e10cb4a619
devops: fix Firefox on Ubuntu 20.04 aarch64 (#11602)
Turns out Firefox 96 now requires libxtst6 on Ubuntu 20.04 aarch64.
2022-01-24 16:20:28 -08:00
Ross Wollman 64e7557fb9
fix: falsey behavior in route.continue, page.post, testInfo.attach (#11421)
In several of the Playwright APIs, falsey values were not handled correctly. This changeset adds tests (and some fixes):

- route.continue: If options.postData was the empty string, the continue failed to override the post data.
- page.post (application/json with options.data: false|''|0|null): Raw falsey values were getting dropped (i.e. you can't do the equivalent of curl --header application/json … -d 'false'). This has been fixed with most values across all browsers, but an additional fix is needed for 'null' which the channel serializer treats extra specially.
- testInfo.attach: This didn't get reported as an error when options.path was the empty string, but should have been.
#11413 (and its fix #11414) inspired this search as they are the same
class of bug.
2022-01-24 15:06:36 -08:00
Dmitry Gozman a5bc2efc18
chore: followRedirects in PlaywrightClient (#11599) 2022-01-24 12:41:27 -08:00
campersau 4d42f6a1c4
chore: remove unused _waitingForObject from Connection (#11474) 2022-01-24 18:58:57 +01:00
github-actions[bot] 5382a794fe
feat(chromium): roll to r960211 (#11487)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-01-24 08:40:45 -08:00
Max Schmitt f29a673b4c
fix: do not mute route handler exceptions (#11555) 2022-01-22 22:19:32 +01:00
Yury Semikhatsky ab9d5a0dc4
chore(tracing): add tracing to APIRequestContext (#11502) 2022-01-22 11:25:13 -08:00
Pavel Feldman baf0e5b47a
chore: implement lightweight test listing (#11551) 2022-01-21 19:11:22 -08:00
Yury Semikhatsky 295d0a65c3
fix(har): do not hang on cached resources (#11556) 2022-01-21 16:31:00 -08:00
Max Schmitt fb139cefac
fix: playwright.locator.hasText RegExp flag serialisation in Console API (#11516) 2022-01-21 01:05:37 +01:00
Yury Semikhatsky c510819407
fix(windows): hide child console window when running PrintDeps (#11468) 2022-01-19 10:38:51 -08:00
Pavel Feldman a65f7066d5
fix(webkit): improve orientation detection (#11481) 2022-01-19 10:07:38 -08:00
Dmitry Gozman 6928c84ac2
chore: move some files out of server/common (#11466)
This is a directory for sharing code between Node and Web.
2022-01-18 19:13:51 -08:00
github-actions[bot] bfe7b7cc20
feat(firefox): roll to r1314 (#11459)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-18 09:28:04 -08:00
Max Schmitt b79daec8e0
chore: make it possible to override Locator.dragTo(strict) (#11457) 2022-01-18 17:51:15 +01:00
Pavel Feldman 815e121445
feat(highlight): update highlight from raf (#11443) 2022-01-17 18:33:35 -08:00
Yury Semikhatsky cfb86a74fa
fix(webkit): filechooer interception after process swap (#11415) 2022-01-14 17:33:07 -08:00
Max Schmitt fb22c859d6
chore: add browser like UA to browser fetcher (#11006)
Drive-by: unify all Playwright user agents across the board.

Co-authored-by: Andrey Lushnikov <lushnikov@chromium.org>
2022-01-14 02:46:17 -08:00
Dmitry Gozman 9d5bf0e90d
fix(test runner): fixture teardown double error, testInfo.attach() (#11365)
- Use file path, not content to calculate the attachment hash.
- Always cleanup fixture from the list on teardown, to avoid reporting
  teardown error multiple times: from the test, and from the cleanup.
2022-01-13 10:38:47 -08:00
Pavel Feldman feb7148b3f
chore: don't write into stdout from the test runner, use reporters instead (#11367) 2022-01-12 19:52:40 -08:00
Pavel Feldman 853757930d
chore: don't log twice twice (#11361) 2022-01-12 11:37:49 -08:00
William Bergeron-Drouin a70f4e6410
fix(android): use isRegExp for a more robust check in different execution contexts (#11359) 2022-01-12 11:04:18 -08:00
Pavel Feldman a12e76b52b
chore: implement locator._highlight / playwright._hideHighlight (#11339) 2022-01-12 07:37:48 -08:00
Dmitry Gozman 359d523ec3
fix(selectors): allow :scope with additional css (#11338) 2022-01-11 18:40:29 -08:00
Dmitry Gozman 4efb30999f
feat(request): show request context methods as steps (#11337) 2022-01-11 17:33:41 -08:00
Dmitry Gozman 807f70bccf
fix(electron): remove timeout from electronApp.close (#11336)
We do not have a timeout for any other close method, such as
browserContext.close or browser.close, and hitting default
30 seconds is very realistic with large Electron apps.
2022-01-11 17:12:18 -08:00
github-actions[bot] d31f13468a
feat(webkit): roll to r1592 (#11261)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-01-10 05:02:07 -08:00
github-actions[bot] a423a4a9ed
feat(chromium): roll to r956323 (#11268)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-09 20:44:07 -05:00
Pavel Feldman dc07fa6da6
fix(locator.count): do not touch main workd when computing count (#11256) 2022-01-07 15:52:14 -08:00
Yury Semikhatsky 37a97c4201
feat(tracing): capture network failures (#11237) 2022-01-07 11:22:01 -08:00
Pavel Feldman e1772f15b5
fix(click): don't fail on stale context while clicking (#11228) 2022-01-06 15:15:11 -08:00
Dmitry Gozman 8e75dbffaa
fix(errors): waitForEvent/Request/Response should point to the api call (#11229) 2022-01-06 14:47:52 -08:00
Dmitry Gozman be896848bb
fix(selectors): properly determine visibility of display:contents (#11212) 2022-01-05 16:54:15 -08:00
Dmitry Gozman 1dbbcd1b37
fix(codegen): polyfill CSS.escape (#11181)
Some site (for example, fb.com) delete CSS.escape, so we should use the polyfill.
2022-01-04 17:24:53 -08:00
Andrey Lushnikov 13dd41c2e3
devops: fix self-hosted runner stack collection (#11169)
In case of self-hosted github runners, it's much easier to checkout
under `playwright-internal` folder name instead of a default
`playwright` name. This confuses our stack collection.

This patch makes it generic.
2022-01-04 06:23:28 -08:00
github-actions[bot] 0332b2a7a9
feat(chromium): roll to r954870 (#11163)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-04 04:54:59 -08:00
Dmitry Gozman 976dedda45
feat(input): restore modified layout shift check (#11032)
This changes previous layout shift attempt (see #9546)
to account for more valid usecases:
- On the first event that is intercepted we enforce the hit target. This
  is similar to the current mode that checks hit target before the action,
  but is better timed.
- On subsequent events we assume that everything is fine. This covers more
  scenarios like react rerender, glass pane on mousedown, detach on mouseup.

This check is enabled by default, with `process.env.PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK`
to opt out.
2022-01-03 17:46:04 -08:00
github-actions[bot] c0201f26b5
feat(chromium): roll to r954674 (#11147)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-03 09:48:35 -08:00
Andrey Lushnikov 237b4d5821
devops: download new MacOS 12 WebKit builds (#11066)
Drive-by: simplify management of executable paths since they are
the same for each platform.

References #11031
2021-12-29 20:40:45 -08:00
Andrey Lushnikov 056d310e20
feat(ffmpeg): roll ffmpeg to 1007 (#11081)
This build:
- Includes a native build for Mac Arm64
- Changes executable name for the linux arm64 build
2021-12-29 20:10:29 -08:00
github-actions[bot] d43f78f384
feat(firefox): roll to r1312 (#11124)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2021-12-29 17:47:32 -08:00
github-actions[bot] db47b3e392
feat(chromium): roll to r953978 (#11097)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-27 10:13:18 -07:00
Dmitry Gozman f933759ad1
chore(test runner): minor improvements (#11067)
- Types for fixture options and more.
- Refined type for deadline runner.
2021-12-22 09:59:58 -08:00
github-actions[bot] 97a43b4bed
feat(chromium): roll to r952821 (#11040)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-22 09:14:23 -08:00
github-actions[bot] 16ae0af0fd
feat(chromium): roll to r952597 (#11010)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-18 10:59:42 -08:00
Pavel Feldman 037baf0945
fix(trace-viewer): scroll action into view (#10978) 2021-12-17 12:20:01 -08:00
Yury Semikhatsky eb9c8a8f06
fix(tracing): check if source exists before adding to zip (#10986) 2021-12-17 11:52:28 -08:00
Dmitry Gozman 0d277fa589
fix(selenium): allow setting additional capabilities (#11000)
Also clarify docs about Selenium v4.
2021-12-17 11:33:24 -08:00
musou1500 7d39d345c2
fix(tracing): trace frame (#10846) 2021-12-17 10:43:19 -08:00
Dmitry Gozman dd57843404
fix(inspector): do not show internal calls (#10982)
Also mark setDefault{Navigation,}Timeout as always internal.
2021-12-16 17:17:24 -08:00
Andrey Lushnikov 773ebe04c6
chore: follow-up to handling docker corner cases (#10981) 2021-12-16 15:29:20 -08:00
Mario Nebl 70ed020c87
fix: handle docker edge cases (#10501)
## Before

* When docker wasn't running: crashed with a TypeError 
* When any image without `RepoTags` was present: crashed with TypeError
* Typo in recommended command ("playwight")
* No indication of `PW_TEST_IMAGE` env var in error output

<details>
<summary>Docker not running</summary>

```
Using config at ~redacted/playwright.config.ts
ERROR get /images/json 500 dial unix docker.raw.sock: connect: connection refused

TypeError: Cannot read property 'find' of null
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     test.ts:9:1 › some redacted description
ERROR get /images/json 500 dial unix docker.raw.sock: connect: connection refused

TypeError: Cannot read property 'find' of null
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js
```

</details>

<details>
<summary>Image without repo tags</summary>

```
Using config at ~redacted/playwright.config.ts
TypeError: Cannot read property 'includes' of undefined
    at ~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:55
    at Array.find (<anonymous>)
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     some-test.ts › some description
TypeError: Cannot read property 'includes' of undefined
    at ~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:55
    at Array.find (<anonymous>)
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  editor-editor-wysiwyg--editor-wysiwyg.vr.ts:9:1 › actual element matches expected element (26ms)


  1) some-test.ts › some description =====

    'Grid agent creation failed'


  1 failed
  some-test.ts › some description ======
```

</details>

## After

* Helpful error message if docker isn't running
* Doesn't crash when local-only images in list
* No typo in `playwright install docker-image` command
* When other playwright images are found they are listed and  `PW_TEST_IMAGE` is mentioned

### After: Docker not running

```
Using config at ~redacted/playwright.config.ts
Error fetching json: Error: connect ECONNREFUSED /var/run/docker.sock
Error:
╔═════════════════════════════════════════╗
║ Failed to list docker images            ║
║ Please ensure docker daemon is running. ║
║                                         ║
║ <3 Playwright Team                      ║
╚═════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:61:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     test.ts:9:1 › description
Error fetching json: Error: connect ECONNREFUSED /var/run/docker.sock
Error:
╔═════════════════════════════════════════╗
║ Failed to list docker images            ║
║ Please ensure docker daemon is running. ║
║                                         ║
║ <3 Playwright Team                      ║
╚═════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:61:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  test.ts:9:1 › description


  1) test.ts:9:1 › description =====

    'Grid agent creation failed'


  1 failed
    test.ts:9:1 › description ======
```

## After: No exact match found 

```
Using config at ~redacted/playwright.config.ts
Error:
╔════════════════════════════════════════════════════════════════════════════╗
║ Failed to find mcr.microsoft.com/playwright:v1.16.3-focal docker image.    ║
║                                                                            ║
║ Available images:                                                          ║
║ - mcr.microsoft.com/playwright:v1.16.3                                     ║
║ - mcr.microsoft.com/playwright:v1.16.2-focal                               ║
║                                                                            ║
║ Use available images via PWTEST_IMAGE_NAME environment variable:           ║
║     PWTEST_IMAGE_NAME=mcr.microsoft.com/playwright:v1.16.3 playwright test ║
║                                                                            ║
║ Alternatively, please pull docker image with the following command:        ║
║                                                                            ║
║     npx playwright install docker-image                                    ║
║                                                                            ║
║ <3 Playwright Team                                                         ║
╚════════════════════════════════════════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:92:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     editor-editor-wysiwyg--editor-wysiwyg.vr.ts:9:1 › actual element matches expected element
Error:
╔════════════════════════════════════════════════════════════════════════════╗
║ Failed to find mcr.microsoft.com/playwright:v1.16.3-focal docker image.    ║
║                                                                            ║
║ Available images:                                                          ║
║ - mcr.microsoft.com/playwright:v1.16.3                                     ║
║ - mcr.microsoft.com/playwright:v1.16.2-focal                               ║
║                                                                            ║
║ Use available images via PWTEST_IMAGE_NAME environment variable:           ║
║     PWTEST_IMAGE_NAME=mcr.microsoft.com/playwright:v1.16.3 playwright test ║
║                                                                            ║
║ Alternatively, please pull docker image with the following command:        ║
║                                                                            ║
║     npx playwright install docker-image                                    ║
║                                                                            ║
║ <3 Playwright Team                                                         ║
╚════════════════════════════════════════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:92:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  test.ts:9:1 › description


  1) test.ts:9:1 › description =====

    'Grid agent creation failed'


  1 failed
    test.ts:9:1 › description ======
```
2021-12-16 15:11:51 -08:00
Yury Semikhatsky 707befd6f7
fix(fetch): basic authentication without realm (#10979) 2021-12-16 13:40:52 -08:00
Yury Semikhatsky 921aa02ce4
feat(webkit): roll to r1588 (#10976) 2021-12-16 12:43:57 -08:00
Yury Semikhatsky 7c3629b72a
feat: export tagged pdf by default (#10915) 2021-12-16 11:46:02 -08:00
github-actions[bot] b606b5b8a0
feat(firefox): roll to r1311 (#10963)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-15 21:47:58 -08:00
Yury Semikhatsky fcccac0c08
fix(tracing): return early if no trace was produced (#10953)
This fixes [page/page-set-input-files.spec.ts](https://devops.aslushnikov.com/flakiness2.html#filter_spec=page%2Fpage-set-input-files.spec.ts&commits=50&test_parameter_filters=%5B%5B%22browserName%22%2C%5B%5B%22electron%22%2C%22exclude%22%5D%5D%5D%2C%5B%22platform%22%2C%5B%5B%22Android%22%2C%22exclude%22%5D%5D%5D%2C%5B%22video%22%2C%5B%5Btrue%2C%22exclude%22%5D%5D%5D%2C%5B%22trace%22%2C%5B%5Btrue%2C%22include%22%5D%5D%5D%5D&timestamp=1639590204582) failures.
2021-12-15 17:19:00 -08:00
Yury Semikhatsky 230e0b7049
fix(wheel): throw on wheel access in mobile WebKit (#10946) 2021-12-15 11:57:28 -08:00
github-actions[bot] 0b86fbde90
feat(chromium): roll to r950899 (#10930)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-12-15 11:23:01 -08:00
Max Schmitt bfc6cc2701
chore: do not make HEAD request when opening remote traces (#10948) 2021-12-15 11:12:31 -08:00
Max Schmitt 4fd8a40129
chore: fix wrong aligned protocol YAML (#10947) 2021-12-15 11:12:13 -08:00
Pavel Feldman 04e82ce71c
feat(api): make withText an option (#10922) 2021-12-14 15:37:31 -08:00
Max Schmitt 67b16497cc
chore: move setting PW User-Agent on connectOverCDP to the server side (#10899) 2021-12-13 17:20:04 -08:00
Pavel Feldman a82a3f1128
chore: move html report to package (#10898) 2021-12-13 16:38:26 -08:00
Pavel Feldman f166c67707
chore: more html reporter components (#10896) 2021-12-13 15:37:01 -08:00
Yury Semikhatsky a2a8967bed
chore: create trace.zip in driver for local runs (#10868) 2021-12-13 14:40:29 -08:00
Dmitry Gozman 9491f6652d
fix(steps): do not show unnecessary steps for internal waitForEventInfo (#10889) 2021-12-13 13:32:53 -08:00
Dmitry Gozman 9f2a040241
fix(chromium): workaround enable-automation infobar (#10869) 2021-12-13 10:35:39 -08:00
Pavel Feldman 6521a6f3ab
chore: split html report into files (#10876) 2021-12-12 14:56:12 -08:00
musou1500 81ab6b3fde
fix(tracing): overwrite attr value specifies charset other than utf-8 (#10848) 2021-12-12 14:54:00 -08:00
Mateusz Burzyński 8b5e146b90
test(mouse): add a test for pointerdown event with custom button (#10697) 2021-12-12 10:01:45 -08:00
Yury Semikhatsky aaa8b07770
chore(tracing): collect source names on server (#10862) 2021-12-10 14:07:22 -08:00
Ross Wollman fde427d890
feat(proxy): unify local network proxy behavior (#10719)
When configuring a proxy, Chromium requires a magic tokens to get some
local network requests to go through the proxy. This has tripped up a
few users, so we make the behavior default to the expected: proxy
everything including the local requests. This matches the other vendors
as well.

NB: This can be disabled via
`PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK=1`

Supercedes: #8345
Fixes: #10631
2021-12-10 14:01:56 -08:00
Max Schmitt 0b120c7f03
fix: use HTTP/2.0 instead of h2 as Response.httpVersion (#10812) 2021-12-10 11:24:52 -08:00
Yury Semikhatsky 976af162b0
feat(tracing): pack sources to trace on the driver side (#10815) 2021-12-09 17:21:17 -08:00
Dmitry Gozman a52c6219a7
fix(inspector): do not swallow keyup when not recording (#10842) 2021-12-09 17:15:38 -08:00
Dmitry Gozman 1d50db809d
fix(snapshot): render sandboxed iframes and svg iframes (#10835) 2021-12-09 17:10:31 -08:00
Max Schmitt 43b7e6c26d
chore: allow CLI version override (#10814) 2021-12-08 23:32:21 -08:00
Dmitry Gozman 4996e184bf
fix(electron): make recordVideo work (#10810) 2021-12-08 17:34:50 -08:00
Pavel Feldman c7193c7716
feat(trace): add a link to download trace (#10807) 2021-12-08 15:41:35 -08:00
github-actions[bot] 287a2eaee8
feat(webkit): roll to r1586 (#10775) 2021-12-08 07:52:25 -08:00
Max Schmitt 5ba7903ba0
devops: migrate from master to main branch (#10303) 2021-12-07 22:58:33 -08:00
Max Schmitt fdb633dc8b
fix: support regexp flags with locator.withText() (#10779) 2021-12-07 19:33:04 -08:00
Pavel Feldman a08a41f6c9
chore: render annotations in html report (#10774) 2021-12-07 18:35:06 -08:00
Pavel Feldman feb4c62da1
fix(html): html reporter fixes (#10770) 2021-12-07 16:47:47 -08:00
Max Schmitt 300a7f9b44
Revert "chore: validate client/server version match for remote connections (#10542)" (#10766)
This reverts commit 41070a2f55.
2021-12-07 14:45:05 -08:00
Pavel Feldman c9220801e7
feat(cli): add locator methods to the cli api (#10746) 2021-12-07 12:32:11 -08:00
Dmitry Gozman 6698f3277a
fix(traceViewer): calculate the number of filmstrip frames correctly (#10757)
We now fit evenly-spaced frames into available width (as intended before),
and then add one more last frame that could be cropped at the right.
2021-12-07 11:58:20 -08:00
Andrey Lushnikov a89fe3ec5c
fix: support shadow DOM with Vue and React selectors (#10742)
There were two issues:
- we did not find VDom roots inside shadow DOM
- we incorrectly relied on DOM's `contain` method to determine if
  VDom's rendered node belongs to requested scope.

Fixes #10123
2021-12-07 11:23:37 -08:00
Dmitry Gozman ec74fa6a76
feat(fill): support color and range input types (#10736) 2021-12-06 15:43:10 -08:00
Dmitry Gozman 516360be5f
fix(waitForEvent): include timeout value in the timeout message (#10738) 2021-12-06 15:42:57 -08:00
Max Schmitt 5610974312
chore: fix installing of branded browsers under non-root (#10640) 2021-12-06 14:49:22 -08:00
Pavel Feldman 7765131a14
feat(acceptDownload): revert acceptDownload (#10709) 2021-12-06 09:25:24 -08:00
github-actions[bot] 3a1201eb61
feat(chromium): roll to r947661 (#10712)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-04 08:00:55 -08:00
Yury Semikhatsky b7ba039436
fix: make APIRequest tracing work on node 16 (#10705) 2021-12-03 15:46:57 -08:00
Pavel Feldman aef0444ff5
fix(focus): make sure strictness is respected (#10685) 2021-12-03 10:22:50 -08:00
Pavel Feldman f583f1604c
feat(locator.withText): allow narrowing locators to those with text (#10688) 2021-12-03 09:27:06 -08:00
Yury Semikhatsky 8afd0b7d6a
feat(tracing): trace context APIRequest calls (#10684) 2021-12-02 15:53:47 -08:00
Pavel Feldman 5bde171657
fix(chromium): disable AutoExpandDetailsElement as it breaks the web (#10679) 2021-12-02 13:04:15 -08:00
Pavel Feldman 31e0a63fcd
feat(toBeChecked): allow passing checked: false (#10665) 2021-12-02 10:31:26 -08:00
Pavel Feldman 2ac9c08d0c
feat(inputValue): allow on labels, retarget (#10666) 2021-12-02 10:31:06 -08:00
Pavel Feldman b9731a904e
chore: add validations into check_deps (#10661) 2021-12-01 18:14:13 -08:00
Dmitry Gozman 6e00af3b2e
fix(click): revert layout shift logic (#10653) 2021-12-01 12:54:20 -08:00
Pavel Feldman 127dacf5d4
fix(toHaveText): normalize zero width white space (#10623) 2021-12-01 09:21:21 -08:00
Yury Semikhatsky d66b7aab3b
feat(expext): toBeOK for APIResponse (#10596) 2021-11-30 18:12:19 -08:00
Pavel Feldman 11cbdcf58a
fix(tracing): fix tracing + debugger test (#10619) 2021-11-30 17:32:29 -08:00
Henric Trotzig 1bfc473bc8
chore(chromium): Capture off-screen content without resizing viewport (#10606) 2021-11-30 14:11:15 -08:00
github-actions[bot] bdfe92f8a7
feat(chromium): roll to r945826 (#10597)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-11-30 21:58:28 +01:00
Max Schmitt e7f1fd5c56
chore: escape CSS selectors in codegen correctly (#10608) 2021-11-30 21:13:41 +01:00
Max Schmitt 41070a2f55
chore: validate client/server version match for remote connections (#10542)
* chore: validate client/server version match on connect

* only validate major and minor
2021-11-30 08:36:00 +01:00
Pavel Feldman 3997671ab7
fix(selectors): do not hide selector errors (#10595) 2021-11-29 17:13:24 -08:00
Saransh Miglani ca1064e6c1
download code re-organized (#10568) 2021-11-29 08:53:33 -08:00
github-actions[bot] f7da3c31f9
feat(chromium): roll to r945495 (#10560)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-11-27 08:53:11 +01:00
Max Schmitt da02c2e2c8
chore: add --dry-run to install-deps CLI command (#10520) 2021-11-25 01:04:42 +01:00
Pavel Feldman 5d19f16601
feat(esm): introduce experimental PW_EXPERIMENTAL_TS_ESM option (#10519) 2021-11-24 14:17:01 -08:00
Dmitry Gozman b8b6c7a220
fix(chromium): websocket handshake comes twice (#10518)
Sometimes we get "Network.webSocketWillSendHandshakeRequest" in Chromium.
Perhaps websocket is restarted because of chrome.webRequest extensions api?
Or maybe the handshake response was a redirect?

This reports websocket twice and triggers an assert.
2021-11-24 10:46:32 -08:00
Max Schmitt 85197e68c9
chore: support range requests in trace viewer http server (#10434) 2021-11-23 21:37:55 +01:00
Pavel Feldman 206a877cea
fix(trace-viewer): multiple iframe and UX fixes (#10486) 2021-11-23 11:36:18 -08:00
Max Schmitt 5a8010cf4f
fix: noncompliant Firefox User-Agents (#10492) 2021-11-23 18:56:22 +01:00
github-actions[bot] 2d4982e052
feat(chromium): roll to r943925 (#10484)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-11-23 11:21:15 +01:00
Joel Einbinder 6d3bb458f9
fix(firefox): round down mouse coordinates (#10483) 2021-11-23 02:55:32 -05:00
Dmitry Gozman 7d3672899f
fix(tracing): race in stopChunk (#10481)
Consider the following scenario:
- Tracing is started.
- API call is made (e.g. page.waitForResponse), almost finishes, and
  enters onAfterCall where it starts a snapshot.
- tracing.stopChunk is called, and waits for existing actions to finish.
  However, it does so by calling onAfterCall one more time.
- tracing.stopChunk removes instrumentation listener and returns
  to the client.
- Client starts zipping files.
- Original API call finishes the snapshot and saves it to the trace file.

This results in trace file being written to while the zip is still working.
2021-11-22 20:08:09 -08:00
Joel Einbinder d70e37de80
feat: locator.dragTo (#10287) 2021-11-22 20:27:26 +01:00
Joel Einbinder 06ab3c0fda
feat: consider fieldset and aria-disabled when checking if an element is enabled (#9927)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-11-22 20:25:06 +01:00
Max Schmitt 14471fd79f
chore: fix CLI --help when used in driver (#10412) 2021-11-22 18:34:22 +01:00
github-actions[bot] 2290232339
feat(chromium): roll to r943346 (#10452)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-11-21 00:43:30 +01:00
Yury Semikhatsky 9c23a78c32
chore: throw instead of returning error from fetch (#10451) 2021-11-19 20:32:29 -08:00
Pavel Feldman 103b6121b8
fix(trace-viewer): provide hints on how to open trace statically (#10450) 2021-11-19 16:29:27 -08:00
Pavel Feldman a73e6bbd0e
chore: drop wrapApiCall (2) (#10445) 2021-11-19 16:28:11 -08:00
Pavel Feldman 2a98800ac0
chore: drop wrapApiCall (1) (#10428) 2021-11-19 10:12:48 -08:00
Max Schmitt e87b56a2e5
chore: verify supported Node.js version during runtime (#10406) 2021-11-19 19:05:17 +01:00
Max Schmitt b8b0d7139c
chore: bump ESLint to version 8 (#10433) 2021-11-19 18:48:33 +01:00
Pavel Feldman b302152789
chore(zones): prepare to remove wrapApiCall, introduce zones (#10427) 2021-11-18 22:30:09 -08:00
divdavem 17a2454226
feat(cli): add --proxy-bypass option (#10181) 2021-11-18 15:41:16 -08:00
github-actions[bot] 24cc266de0
feat(chromium): roll to r941965 (#10372)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-11-18 18:46:44 +01:00
Yury Semikhatsky 0ca10da166
fix: compute file field mime type on the server (#10394) 2021-11-17 18:12:26 -08:00
Dmitry Gozman bd93fc499f
fix(html reporter): show missing attachments as warnings (#10400) 2021-11-17 18:03:13 -08:00
Dmitry Gozman ce2c0c59a7
feat(expect): show expect timeout in the error message (#10388)
Makes it easier to understand that expect does indeed have a separate timeout.

```
    Error: expect(received).toHaveCount(expected) // deep equality

    Expected: 0
    Received: 1

    Call log:
      - expect.toHaveCount with timeout 500ms
      - waiting for selector "span"
      -   selector resolved to 1 element
      -   unexpected value "1"
      -   selector resolved to 1 element
      -   unexpected value "1"
      -   selector resolved to 1 element
      -   unexpected value "1"
```
2021-11-17 17:28:30 -08:00
Pavel Feldman 70ede0d987
chore: use channel traits (#10389) 2021-11-17 15:26:01 -08:00
Yury Semikhatsky 7746cb52a7
fix: do not send Fetch.continueRequest twice for auth requests (#10382) 2021-11-17 11:42:06 -08:00
Andrey Lushnikov 93dbcefa46
fix: disable 'AcceptCHFrame' chromium field trial (#10380)
References #10376
2021-11-17 10:41:53 -08:00