Commit Graph

1660 Commits

Author SHA1 Message Date
Max Schmitt
dc7f7f9a8c
fix(chromium): handle backgroundPages() onClose (#6541) 2021-05-12 22:15:04 +02:00
Pavel Feldman
21cb726b7d
chore(tracing): expose tracing api (#6523) 2021-05-12 12:21:54 -07:00
Yury Semikhatsky
460cc31941
fix: propagate custom executable path to codegen (#6509) 2021-05-12 11:45:57 -07:00
Yury Semikhatsky
ab55918979
feat(firefox): bump to 1259 (#6510) 2021-05-12 09:03:15 -07:00
Pavel Feldman
45ee257a26
chore(test): fix some screencast tests (#6522) 2021-05-12 08:35:19 -07:00
Anx
1c10c4cbe8
fix: fix har entry time calculation (#6472) 2021-05-11 13:28:17 -07:00
Pavel Feldman
d08c50d277
feat(screencast): scale fixes (#6475) 2021-05-11 13:21:01 -07:00
Fili
f1a888de02
feat: support Moto G4 device in emulated devices for performance testing (#5946)
Adding Moto G4 to deviceDescriptors.
2021-05-10 09:33:11 -07:00
Andrey Lushnikov
5c1ddc7f0a
fix: fix method elementHandle.frameElement() for framesets (#6468)
Playwright clicks did not work in regular frames due to a bug
in `frameElement` method.

Fixes #6453
2021-05-08 21:25:12 -07:00
Pavel Feldman
a9523d9d8f
feat(ff): roll to 1256/1246 (#6466) 2021-05-08 11:35:36 -07:00
Andrey Lushnikov
5e4badd654
feat(firefox-beta): roll Firefox to 1254 - v89.0b9 (#6454) 2021-05-07 00:49:43 -07:00
Andrey Lushnikov
aab602cc3b
fix: use old screencast protocol calls for Mac 10.14 (#6440)
This is a quick workaround to be cherry-picked in the release branch.
We'll align protocols in a follow-up.

References #6439
2021-05-06 10:38:46 -07:00
Andrey Lushnikov
7906a8f2f5
feat: add best-effort support for Ubuntu 21.04 (#6429)
With this patch:
- `npx playwright install-deps` will install deps on Ubuntu 21.04
- launch doctor knows the package<->lib mapping for Ubuntu 21.04

**NOTE:** our webkit build, however, doesn't work on Ubuntu 21.04. Since
this is not LTS release, we're doing best-effort here.

Fixes #6405
2021-05-06 10:37:06 -07:00
Dmitry Gozman
b29b7df47e
fix(connect): handle disconnect in various situations (#6276)
There are a few ways for `connect()` to finish:
- `Browser.close()` from the client side.
- Browser on the server side did exit (e.g. crashed).
- Connection was dropped by either of the sides.

We reduce all the cases to the last one by dropping the
connection when client wants calls `Browser.close()` or
server-side browser exits.

In all these cases we should properly cleanup on the server side,
and ensure that all promises reject on the client side.
2021-05-06 09:34:06 -07:00
Max Schmitt
d902b06fd1
test: fixed flaky connectOverCDP tests (#6436) 2021-05-06 18:18:56 +02:00
Pavel Feldman
791443d71f
feat(webkit): roll to r1472 (#6425) 2021-05-05 15:35:10 -07:00
Michael Rienstra
8737207d5a
feat(devices): add more Android device descriptions (#6413)
Adds device descriptions for:
- Galaxy S8
- Galaxy S9+
- Galaxy Tab S4
- Pixel 3
- Pixel 4
These devices are regarded as worthy of targeting by BrowserStack.

Sources (both have identical data for these 5 devices):
1. https://github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199
2. https://www.danhendricks.com/2018/04/adding-iphone-galaxy-chrome-mobile-emulated-devices/#heading_device_data
2021-05-05 14:02:28 -07:00
Yury Semikhatsky
47cf9c3e8f
feat(chromium): bump to r878941 (#6216)
This roll was blocked by a few upstream bugs that were crashing Chromium on Windows.
- https://bugs.chromium.org/p/chromium/issues/detail?id=1198567#c33
- https://bugs.chromium.org/p/chromium/issues/detail?id=1200964
2021-05-05 09:47:34 -07:00
Max Schmitt
ab850afb45
fix: support relative downloadsPath directory for downloads (#6402) 2021-05-05 17:07:10 +02:00
Joel Einbinder
6219042c74
fix(webkit): swallow requests from detached frames (#6242) 2021-05-03 12:34:09 -07:00
Pavel Feldman
1a859ebe68
chore(electron): fix node/browser race conditions, expose browser window asynchronously (#6381) 2021-05-02 22:45:06 -07:00
Yury Semikhatsky
07fb81a4ef
fix(launcher): improve error message for missing channel distribution (#6380) 2021-04-30 19:39:52 -07:00
Gnome Bard
018f3146a8
fix(electron): deliver promised _nodeElectronHandle (#6348) 2021-04-30 18:46:27 -07:00
Pavel Feldman
934bc672f7
test(tracing): start adding tracing tests (#6369) 2021-04-30 07:40:22 -07:00
Max Schmitt
1c40c94ed7
chore: only throw the proxy on launch required on win/CR (#6350) 2021-04-30 00:02:48 +02:00
Dmitry Gozman
263a0fd2e1
fix: evaluate in utility for screenshots (#6364)
We use `waitForFunctionValue` in the main world that may be corrupted.

References #6356.
2021-04-29 14:53:53 -07:00
Pavel Feldman
434f474ce8
chore(evaluate): implement non-stalling evaluate (#6354) 2021-04-29 09:28:19 -07:00
Pavel Feldman
06a92684f3 Reapply #6363 w/ modification--amend 2021-04-28 22:18:05 -07:00
Pavel Feldman
0becd9428a Revert "Revert "fix: break require cycle (#6353)""
This reverts commit 17e966bc2e.
2021-04-28 22:16:53 -07:00
Pavel Feldman
17e966bc2e Revert "fix: break require cycle (#6353)"
This reverts commit 0bcfa92360.

Inspector no longer opens.
2021-04-28 22:10:50 -07:00
Dmitry Gozman
0bcfa92360
fix: break require cycle (#6353)
We have `CRBrowserContext` that extends `BrowserContext`, and
it sometimes fails beacause `BrowserContext` is undefined, depending
on the require order. Below is the require cycle.

```log
server/browserContext.ts
server/supplements/recorderSupplement.ts
server/supplements/recorder/recorderApp.ts
server/playwright.ts
server/android/android.ts
server/chromium/crBrowser.ts
server/browserContext.ts
```

Fixing this by using `require`.
2021-04-28 20:39:01 -07:00
Yury Semikhatsky
560bea5f8d
fix: do not close stream until all bytes have been read (#6351) 2021-04-28 14:54:51 -07:00
Pavel Feldman
922d9ce1fb
chore(tracing): fix some of the start/stop scenarios (#6337) 2021-04-27 11:07:07 -07:00
Yury Semikhatsky
5be005b1c6
Revert "fix: increas recent logs buffer (#6330)" (#6332)
This reverts commit 3c126024ca.
2021-04-26 16:20:49 -07:00
Yury Semikhatsky
b6b2366d2c
fix: browser logging (#6331) 2021-04-26 16:20:38 -07:00
Yury Semikhatsky
3c126024ca
fix: increas recent logs buffer (#6330) 2021-04-26 13:58:52 -07:00
Joel Einbinder
a51dc50d85
fix(accessibiltiy): ignore new roles that came with new chromium (#6329) 2021-04-26 12:02:54 -07:00
Pavel Feldman
be27f47309
feat(tracing): introduce context.tracing, allow exporting trace (#6313) 2021-04-24 20:39:48 -07:00
Pavel Feldman
a9219aa8b6
chore: start / stop context tracing (#6309) 2021-04-23 20:39:09 -07:00
Pavel Feldman
97cf86d20a
chore: make instrumentation per-context (#6302) 2021-04-23 18:34:52 -07:00
Yury Semikhatsky
fd31ea8b0d
feat: support extra http headers in browserType.connect() (#6301) 2021-04-23 14:52:27 -07:00
Yury Semikhatsky
cc4782a718
Revert "fix(chromium): force --use-gl=swiftshader on Windows (#6272)" (#6300)
This reverts commit 357224d6b1.
2021-04-23 10:09:55 -07:00
Pavel Feldman
0ed328f6de
chore(tracing): include events in the trace (#6285) 2021-04-23 09:28:18 -07:00
Yury Semikhatsky
357224d6b1
fix(chromium): force --use-gl=swiftshader on Windows (#6272) 2021-04-22 10:06:39 -07:00
Yury Semikhatsky
3a93c419f8
chore: remove stack from WaitForEventInfo (#6259) 2021-04-22 10:05:37 -07:00
Pavel Feldman
fe4fba4a16
chore: extract debugger model from inspector (#6261) 2021-04-21 20:46:45 -07:00
Max Schmitt
7053ac9097
chore(types): add channel to launchServer (#6256) 2021-04-21 21:23:08 +02:00
Dmitry Gozman
6bdc67ac6a
feat(actions): trial option that only performs the checks (#6246)
Available for check, click, dblclick, hover, tap, uncheck.
2021-04-21 12:22:19 -07:00
Dmitry Gozman
640b10c70f
fix(codegen): missing await before newPage.goto (#6253) 2021-04-21 07:59:38 -07:00
Pavel Feldman
85e2db2416
chore: push dispatcher guid into object, reuse it in trace (#6250) 2021-04-20 23:03:56 -07:00
Dmitry Gozman
06b0619260
fix(codegen): do not commit last action on mouse move (#6252)
On a slow page that does a lot of things before navigating upon click,
it is common to move mouse away from the click point. Previously,
we would commit the click action and record a `page.goto()` for the
navigation. Now we attribute any signals, even after accidental mouse move,
to the previous action, in the 5-seconds time window.
2021-04-20 18:45:52 -07:00
Dmitry Gozman
ad731c1535
feat(debug): PWDEBUG=console vs PWDEBUG=inspector (#6213)
This supports `PWDEBUG=console` that:
- runs headed;
- disables timeouts;
- adds `playwright` console helper.

When using `PWDEBUG=anything-but-console`, we open inspector.
Docs keep suggesting `PWDEBUG=1`.
2021-04-20 15:58:34 -07:00
Max Schmitt
9cd89ae052
fix: host dependency validation (#6227) 2021-04-20 18:54:53 +02:00
Pavel Feldman
f9af4c3755
chore(tracing): render error snapshot as Action (#6241) 2021-04-20 00:19:17 -07:00
Andrey Lushnikov
23dfaf9e9b
feat: start downloading firefox-stable channel (#6177)
This patch adds support for downloading and running Playwright with
firefox-stable channel.

References #5993
2021-04-19 21:26:33 -07:00
Pavel Feldman
033bc9bfcc
chore(tracing): sync timeline and list highlight (#6235) 2021-04-19 19:50:11 -07:00
Pavel Feldman
27e720f23a
feat(tracing): keyboard navigate lists (#6224) 2021-04-19 14:09:50 -07:00
Max Schmitt
8ca58e344e
fix(page): add name property to pageerror event (#5970) 2021-04-19 22:37:38 +02:00
Max Schmitt
7ec57c0c18
chore: read browsers.json with require (#6186)
This fixes the compatibility on Vercel with Next.js when it's used in
a serverless function.
Next.js uses https://github.com/vercel/nft to trace down the
dependencies which a serverless function is using which
is currently not capable of detecting the browsers.json in our current
setup. Previously we used require to load the browers.json which was
replaced by readFileSync in #5318. Since then it was broken.

Fixes #5862
2021-04-19 22:06:04 +02:00
Andrey Lushnikov
329980be2a
feat: use --no-service-autorun in Chromium (#6232)
See https://chromium-review.googlesource.com/c/chromium/src/+/2436773 for details
2021-04-19 13:01:41 -07:00
Dmitry Gozman
243ede5dfb
feat(waitForEvent): allow async predicate (#6201)
We await the predicate now. For synchronous predicates,
nothing should change becase the await will finish before
the next protocol message arrives (thanks to `makeWaitForNextTask`).
2021-04-19 10:32:51 -07:00
Pavel Feldman
90913160c4
chore: render wait for on trace timeline (#6222) 2021-04-18 20:02:34 -07:00
Yury Semikhatsky
17ead28285
fix(server): disconnect ws clients on server close (#6215) 2021-04-16 17:07:56 -07:00
Yury Semikhatsky
e4ae6503d7
fix(inspector): fall back to custom executable path for UI (#6214) 2021-04-16 15:19:44 -07:00
Dmitry Gozman
ce96914292
fix(remote): unregister selectors after client disconnect (#6195) 2021-04-16 11:14:57 -07:00
Dmitry Gozman
e81a3c5901
api: add option position to check/uncheck (#6153)
Since check/uncheck does click under the hood, sometimes it might
need to click at a different position. One example would be a long
label that contains links inside, and clicking in the center happens
to hit the link instead of the label itself.
2021-04-12 12:41:25 -07:00
Dmitry Gozman
fff1f3d45c
chore: simplify remote connection protocol (#6164)
This changes the root object from RemoteBrowser to Playwright,
similar to local driver connection. This way, any remote connection
gets a Playwright object.

This also starts reusing PlaywrightServer class, and introduces
`cli run-server` hidden command that runs ws server on the
specified port.

Previous structure:
```
RemoteBrowser
  - browser (using ConnectedBrowser for remote-specific behavior)
  - selectors (special instance for this remote connection)
```

New structure:
```
Playwright
  - ...
  - selectors (special instance for this remote connection)
  - preLaunchedBrowser (using ConnectedBrowser for remote-specific behavior)
```
2021-04-12 11:14:54 -07:00
Joel Einbinder
b3b87f6c69
fix(codegen): ignore AltGraph when typing (#6086) 2021-04-12 09:00:29 -07:00
Dmitry Gozman
b62a436041
feat(selectors): support max distance in layout selectors (#6172)
Supports `div:near(button, 120)` with configurable distance in pixels.
2021-04-10 15:20:26 -07:00
Ross Wollman
bba7ca34c8
feat(chromium): roll to r869727 (#6170)
Fixes #5952
Fixes #6016
2021-04-09 20:57:41 -07:00
Yury Semikhatsky
f3b44d18be
fix(screencast): wait for ffmpeg to finish before reporting video (#6167) 2021-04-09 14:09:45 -07:00
Dmitry Gozman
bd8433ba49
test: cleanup various testing env variables (#6155) 2021-04-09 07:59:09 -07:00
Yury Semikhatsky
f6606d505b
fix: finish all artifacts when browser exits (#6151) 2021-04-08 18:56:09 -07:00
Pavel Feldman
e6f5ce9044
chore: allow running multiple snapshotters for tests (#6147) 2021-04-08 17:27:55 -07:00
Joel Einbinder
63d0d466e3
feat(cdp): replace wsEndpoint with protocol neutral endpointURL (#6141) 2021-04-08 14:55:28 -07:00
Yury Semikhatsky
53d50f9b72
fix(screencast): properly stop screencast on context closure (#6146) 2021-04-08 14:01:05 -07:00
Joel Einbinder
779355ad51
feat(types): make the template on BrowserType optional (#6142)
This makes it much nicer to use `BrowserType` because it no longer has a template.

Technically a breaking change because of the rare edge case where someone used their own non-browser type inside the template, but I don't consider that intended behavior and think this is fine.
2021-04-08 10:27:24 -07:00
Dmitry Gozman
310692b101
test: run page tests on electron bot (#6122) 2021-04-08 10:26:26 -07:00
Pavel Feldman
d9546fd098
chore: read all traces from the folder (#6134) 2021-04-08 07:59:05 -07:00
Pavel Feldman
d0db4f6737
feat: include screencast in trace (#6128) 2021-04-07 14:32:12 -07:00
Yury Semikhatsky
09c175914e
feat(webkit): bump to 1460 (#6124) 2021-04-07 08:55:16 -07:00
Pavel Feldman
0dfde2e975
fix(screenshot): never throw page is navigating (#6103) 2021-04-06 16:01:38 -07:00
Andrey Lushnikov
112ac2f98c
feat(chromium): roll Chromium to r867878 (#6065)
This roll required us pass a new flag - `--allow-pre-commit-input`. Otherwise, keyboard tests won't pass.

Co-authored-by: Joel Einbinder <joel.einbinder@gmail.com>
2021-04-06 15:56:41 -07:00
Pavel Feldman
481034bd0d
chore: trace viewer actions sidebar (#6083) 2021-04-05 20:27:57 -07:00
Dmitry Gozman
5afe282fbb
test: move remaining files from old test/ directory (#6081) 2021-04-05 15:51:45 -07:00
Yury Semikhatsky
e9f0f6c894
fix: mark disposed dispatchers as such (#6051) 2021-04-05 11:50:28 -07:00
Dmitry Gozman
4f7e7450e2
test: migrate last tests to new folio (#6071) 2021-04-05 09:18:56 -07:00
Andrey Lushnikov
da1dafcadb
fix: start downloading firefox build for ubuntu 20.04 (#6064)
Custom firefox build for Ubuntu 20.04 fixes WebGL on headful.
2021-04-02 22:08:04 -07:00
Andrey Lushnikov
4da2d6e104
feat(firefox): roll Firefox to r1244 (#6052)
Fixes #5929
Fixes #6001
2021-04-02 15:41:54 -07:00
Yury Semikhatsky
561cb23e8d
fix: dispatch popup event on the client end (#6044) 2021-04-02 11:15:07 -07:00
Yury Semikhatsky
4f2827f302
fix(dom): click on links inside shadow dom (#5850) 2021-04-02 10:36:24 -07:00
Pavel Feldman
a7630c91d5
api: remove Chromium* classes (#6040) 2021-04-01 18:47:14 -07:00
Max Schmitt
d862deeadf
fix(deps): added missing unicode and emoji dependencies (#6039)
Fixes #6033
2021-04-01 17:54:19 -07:00
Dmitry Gozman
8f71f5971b
fix(input): do not retarget from input/textarea/select to an ancestor button (#6036)
Although such markup is not expected, it happens in the wild. Retargeting
in this case in unexpected, so we check/click/etc the control itself.
2021-04-01 12:30:05 -07:00
Yury Semikhatsky
16d98cb48a
chore(launcher): add more logging to processKill (#6025) 2021-03-31 12:17:16 -07:00
Andrey Lushnikov
f472c96129
feat: support webkit technology preview (#5885)
This patch adds support for `technology preview` webkit channel, which
we will keep close to the actual Safari Technology Preview releases.

This channel does not install by default. It is supposed to be installed
with the following CLI command:

```sh
$ npx playwright install webkit-technology-preview
```

Once the channel is installed, it can be used the following way:

```js
const browser = await playwright.webkit.launch({
  channel: 'technology-preview',
});
```

**NOTE:** if clients attempt using the channel without installing it,
it'll throw an error with a copyable instructions to install via CLI.

References #5884
2021-03-31 11:32:10 -07:00
Dmitry Gozman
9d9599c6a6
api(video): implement video.saveAs and video.delete (#6005)
These methods are safe to call while the page is still open, or when it is
already closed. Works in remotely connected browser as well.

Also makes video.path() to throw for remotely connected browser.

Under the hood migrated Download and Video to use the common Artifact object.
2021-03-31 10:38:05 -07:00
Yury Semikhatsky
9532d0bde0
feat(webkit): bump to 1457 (#6021) 2021-03-31 10:29:43 -07:00
Yury Semikhatsky
587682e024
feat(chromium): bump to r865012 (#5963)
References #5858

Co-authored-by: Andrey Lushnikov <lushnikov@chromium.org>
2021-03-31 09:51:18 -07:00
Pavel Feldman
85ab1dc7a4
feat(waitForURL): add a new waitForURL api (#6010) 2021-03-30 21:51:22 -07:00