Commit Graph

1865 Commits

Author SHA1 Message Date
Pavel Feldman
17e9dd95f7
feat(trace): support loading trace from zip (#6551) 2021-05-12 21:31:34 -07:00
Pavel Feldman
a7ea00d02e
chore: show preview for page under cursor (#6548) 2021-05-12 20:54:17 -07:00
Pavel Feldman
cc43b0d23f
chore: remove storybook (#6549) 2021-05-12 19:55:49 -07:00
Pavel Feldman
1a39843df5
docs: follow up on adding trace dir, unify launch options (#6545) 2021-05-12 16:16:36 -07:00
Yury Semikhatsky
41df6607b0
fix: enable util world bindings in firefox (#6546) 2021-05-12 15:19:27 -07:00
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
Dmitry Gozman
98f1f715c5
chore: ensure we emit Page event before resoliving pageOrError (#6012)
Internal callers of pageOrError should be able to rely on the
Page being already reported.
2021-03-30 17:35:42 -07:00
Yury Semikhatsky
77993c3ebb
fix(installer): add libx11-xcb1 to the list of chromium deps (#6003) 2021-03-30 11:29:21 -07:00
Yury Semikhatsky
28b14fc5f7
feat(docker): use playwright install-deps for building docker image (#5995) 2021-03-29 23:48:54 -07:00
Pavel Feldman
f1c0d09765
feat(size): emulate window.screen size (#5967) 2021-03-29 14:10:58 -07:00
Yury Semikhatsky
8c6822bd32
fix(docker): update native deps and docker files for chromium (#5989) 2021-03-29 13:43:31 -07:00
Mosan
2262d8739f
Update nativeDeps.ts (#5988) 2021-03-29 12:19:34 -07:00
Yury Semikhatsky
0943af2806
fix: kill browser if process doesnt exit for 30s after close (#5968) 2021-03-27 09:59:04 -07:00
Max Schmitt
dfe07818e6
docs: fixed various typos (#5958) 2021-03-26 10:47:16 -07:00
Joel Einbinder
3ce02a95c8
fix(selectors): properly generate selectors for tricky ids (#5940) 2021-03-25 18:43:33 -07:00
Dmitry Gozman
6b3f4cd12b
chore: calculate video size in a single place (#5942) 2021-03-24 10:56:20 -07:00
Dmitry Gozman
8e97607389
fix(viedo): do not stall video in popups (#5941)
There are two problems, exposed by existing tests:

- We do not send Page.startScreeencast before Runtime.runIfWaitingForDebugger
  because we launch video recorder in between. This stalls when the page is busy
  immediately after resuming, e.g. with alert().
  Fixed by starting video recorder in advance.

- We wait for the first frame that may not come - for example, context-wide interception
  is blocking essential resource and first frame.
  Fixed by only waiting for the first frame before reporting the video, not the page.
2021-03-24 09:36:46 -07:00
Dmitry Gozman
2cf4caa4cf
chore: implement mixins in protocol.yml (#5932) 2021-03-24 06:37:10 -07:00
Pavel Feldman
543582b4ca
chore: expose channel name literals for types (#5922) 2021-03-23 13:21:03 -07:00
Andrey Lushnikov
ec6453d1b2
fix: installer compilation (#5908)
For some reason typescript can't find electron types when using
nested tsconfig - workaround the bug.

Drive-by: surface installer compilation problems.
2021-03-22 17:39:03 -07:00
Andrey Lushnikov
2064d27dc6
fix(installer): retain browsers installed via Playwrigth CLI (#5904)
Browser registry is responsible for 3 things:
1. Remove downloaded browsers if there are no packages that refer to them
2. Install default browsers needed for the current package
3. Install browsers on-demand when used through Playwright CLI

Currently, registry relies on a single "download" field in `browsers.json`
to carry both (1) and (2). However, browsers in (3) are marked as
`download: false` so that they aren't installed automatically in (2), so
auto-remove procedure in (1) removes them on subsequent installation.

One possible approach to fix this would be modifying package's `browsers.json` to
change `download: false` to `true` when browsers are installed with
Playwright CLI. This approach was explored here:
bc04a51800

We decided against this since we have a history of issues related to
package modifications after NPM installation. This breaks all
sorts of yarn/npm caching mechanisms.

Instead, this patch is a two-step refactor:
- remove the "download" field in `browsers.json`. Now, all registries
(including old ones from previously-released versions) will retain any
browsers that are mentioned in the `browsers.json`.
- add a new flag "installByDefault", that is **only used** for default
installation.

With this change, the registry tasks are done like this:
- (1) auto-removal: if browser has a back reference, it is retained,
otherwise it is removed from registry
- (2) default installation: use only `installByDefault` to carry default installations
- (3) CLI installation: simply installs browsers. Since we retain
everythings that's referenced in (1), browsers aren't removed.

Fixes #5902
2021-03-22 11:43:29 -07:00
Yury Semikhatsky
67c29e8155
chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
Andrey Lushnikov
9a50304dc1
fix: work-around electron's broken event loop (#5867)
Since `setImmediate` doesn't create a new task in Electron,
we have to fallback to `setTimeout` instead.

See https://github.com/electron/electron/issues/28261 for details.

Fixes #5228
2021-03-18 09:29:37 -07:00
Pavel Feldman
d53cea7029
fix(pageOrError): throw in launchPersistentContext if context page has errors (#5868) 2021-03-18 08:14:57 -07:00
Andrey Lushnikov
bb21faf450
fix: disable firefox's webrender on Darwin (#5870)
References #5721
2021-03-18 00:23:23 -07:00
Pavel Feldman
2367039a2c
chore(stable): throw user-friendly message when ffmpeg is missing (#5865) 2021-03-17 19:19:44 -07:00
Pavel Feldman
84efdfcbc9
chore(autowait): auto-wait for top level navigations only (#5861) 2021-03-17 14:47:51 -07:00
Pavel Feldman
5ae731a3fb
chore(evaluate): respect signals when evaluating on handle (#5847) 2021-03-17 12:03:21 -07:00
Pavel Feldman
7011e5737a
chore(evaluate): explicitly annotate methods that wait for signals (#5859) 2021-03-17 10:47:07 -07:00
Andrey Lushnikov
ae460f01fc
devops: start downloading webkit fork on Mac 10.14 (#5837)
References #5833
2021-03-17 09:34:09 -07:00
Andrey Lushnikov
e8a33c4039
feat(firefox): roll Firefox to r1237 (#5849)
This patch rolls Firefox to r1237. Upstream firefox still struggles
with crashes with certain videos: https://bugzilla.mozilla.org/show_bug.cgi?id=1697004

This PR also workarounds this crash by disabling webrender.

References #5721
2021-03-16 23:27:39 -07:00
Pavel Feldman
bf36b487fc
fix(rimraf): allow 10 retires when removing the profile folder (#5826) 2021-03-16 19:31:35 -07:00
Yury Semikhatsky
8df4dcb0de
feat(webkit): bump to 1446 (#5844) 2021-03-16 17:23:42 -07:00
Pavel Feldman
d81ebff414
fix(inspector): do not collect action signals while on pause (#5843) 2021-03-16 12:06:12 -07:00
Pavel Feldman
5cf13612cf
chore: pretty print storage state (#5830) 2021-03-15 19:03:09 -07:00
Pavel Feldman
c2db8da4df
fix(inspector): await inspector init to avoid races (#5829) 2021-03-15 19:02:38 -07:00
E
095ad6339c
chore: update error message when using userDataDir arg (#5814) 2021-03-15 16:58:46 -07:00
Pavel Feldman
ea32ad2b09
infra(channel): add edge stable bot (#5825) 2021-03-15 16:00:52 -07:00
Pavel Feldman
95affe9387
chore: do not delete unused browsers when PLAYWRIGHT_SKIP_BROWSER_GC is specified (#5827) 2021-03-15 16:00:18 -07:00
Joel Einbinder
defd1a33be
fix(chromium): fix crash if connecting to a browser with a serviceworker (#5803) 2021-03-15 09:50:17 -07:00
Pavel Feldman
1dd6bd3316
infra(channel): wire release channel to all tests (#5820) 2021-03-15 08:07:57 -07:00
Pavel Feldman
a96d6a7dbb
feat: allow to pick stable channel (#5817) 2021-03-13 14:02:39 -08:00
Pavel Feldman
c4578f19f2
chore: organize per-browser dependencies (#5787) 2021-03-11 20:22:50 -08:00
Oleg Lebedev
a185da9d14
chore: allow skipping host requirements validation (#5806) 2021-03-11 18:46:31 -08:00
Gilberto Saraiva
7fcb89269e
fix(firefox): ensure a exception catch when async send call to a dead object; (#5805) 2021-03-11 16:04:08 -08:00
Pavel Feldman
ad69b2af83
chore: unify recorder & tracer uis (#5791) 2021-03-11 11:22:59 -08:00
Yury Semikhatsky
ddfdf8a76a
fix: install chromium along with ffmpeg (#5774) 2021-03-10 14:01:35 -08:00
Pavel Feldman
fea6669473
feat(trace): highlight action target (#5776) 2021-03-10 11:43:26 -08:00
Pavel Feldman
1d6feb2ab8
fix(inspect): highlight on explore input change (#5726) 2021-03-09 07:44:10 -08:00
Max Schmitt
d311058245
fix(BrowserContext): race between continue and close (#5729) 2021-03-08 19:53:19 -08:00
Pavel Feldman
1a94ea5f6c
chore: refactor trace viewer to reuse snapshot storage (#5756) 2021-03-08 19:49:57 -08:00
Pavel Feldman
9e20566244
fix(postData): do not require content type when retrieving post data (#5736) 2021-03-05 21:25:14 -08:00
Dmitry Gozman
b3561e6c41
feat(chromium): bump to 857950 (#5742) 2021-03-05 18:09:38 -08:00
Yury Semikhatsky
976f35aaf7
fix: update codegen to produce set* instead of with* (#5738) 2021-03-05 14:05:48 -08:00
Yury Semikhatsky
26b7db964c
feat(cli): launch-server command (#5713) 2021-03-04 10:32:06 -08:00
Pavel Feldman
2af8b8ac74
chore: inspector snapshot nits (#5676) 2021-03-03 22:25:34 -08:00
Pavel Feldman
a9238ce2e1
feat(debug): introduce npx playwright debug (#5679) 2021-03-03 22:25:14 -08:00
Pavel Feldman
d3eff50386
feat(java): implement codegen (#5692) 2021-03-03 14:32:09 -08:00
Dmitry Gozman
d87522f2e6
fix(text selector): revert quoted match to match by text nodes only (#5690) 2021-03-03 10:51:10 -08:00
Dmitry Gozman
e4d33f56f4
fix(click): do not retarget from label to control when clicking (#5683)
And in other carefully considered cases.
2021-03-02 17:29:03 -08:00
Dmitry Gozman
ff243f1af5
fix(addInitScript): make it work on new pages without navigations (#5675) 2021-03-02 16:03:48 -08:00
Yury Semikhatsky
2cdb6b49cd
fix(inspector): inlcude sdkLang in the error (#5682) 2021-03-02 12:16:04 -08:00
Yury Semikhatsky
1a0ccc1383
feat(webkit): bump to 1443 (#5665) 2021-03-02 09:15:07 -08:00
Pavel Feldman
b253ee80c0
chore(snapshot): brush up, start adding tests (#5646) 2021-03-01 12:20:04 -08:00
Pavel Feldman
aeb2b2f605
feat(inspector): wire snapshots to inspector (#5628) 2021-02-26 14:16:32 -08:00
Andrey Lushnikov
c652794b5a
chore: bump webkit version (#5637)
Aligning with the latest Safari Technology Preview.
2021-02-26 12:15:15 -08:00
Yury Semikhatsky
4b541749ac
feat(webkit): bump to 1442 (#5622) 2021-02-25 23:39:48 -08:00
Pavel Feldman
992f808210
chore(snapshot): implement in-memory snapshot (#5624) 2021-02-25 13:09:26 -08:00
Dmitry Gozman
f7e5db4d6e
chore: remove ProgressController.abort (#5620)
It is used in a few places, but we can do a Promise.race.
This change will allow us to pass existing progress to
multi-step operations.
2021-02-25 10:00:54 -08:00
Pavel Feldman
2ff6d54f26
chore: extract snapshotter from trace viewer (#5618) 2021-02-25 09:33:32 -08:00
Pavel Feldman
af89ab7a6f
chore: make trace server generic (#5616) 2021-02-25 08:25:52 -08:00
Pavel Feldman
f72b098a04
chore: encapsulate parsed snapshot id in the trace viewer (#5607) 2021-02-24 19:29:16 -08:00
Dmitry Gozman
ca8998b11e
feat(log): prepend browser pid to browser logs (#5569)
To differentiate between multiple browsers.
2021-02-24 19:21:47 -08:00
Pavel Feldman
5ae2661134
chore: simplify overrides management in trace viewer (#5606) 2021-02-24 18:38:04 -08:00
Dmitry Gozman
0102e080f6
fix(text selector): make quoted selector match by text nodes (#5603)
This change turns quoted match to be case-sensitive (as before),
but not strictly full-string for the whole element's text.

This is a fix for a case where element contains text nodes and child elements:
```html
<div>text1<span>child node</span>text2</div>
```
We now match this div by `text="text1"` and `text="text2"`.
2021-02-24 16:32:38 -08:00
Pavel Feldman
8906ba332c
chore: spell overridden (#5605) 2021-02-24 15:11:34 -08:00
Pavel Feldman
c91159f3f7
chore: make stack filtering playwright dev-friendly (#5604) 2021-02-24 14:33:08 -08:00
Pavel Feldman
6bf3fe8432
chore: make trace model a class (#5600) 2021-02-24 14:22:34 -08:00
Pavel Feldman
f71bf9a42a
chore: move trace viewer into server (#5597) 2021-02-24 13:39:51 -08:00
Pavel Feldman
5fb77935ee
chore: move logic from sw to server (#5582) 2021-02-24 11:52:59 -08:00
Max Schmitt
070cfdcdb8
fix(inspector): skip stack trace playwright/src lines only under tests (#5594) 2021-02-24 11:34:48 -08:00
Max Schmitt
fefe37e96f
fix(inspector): stacktrace with browser specific NPM package (#5589) 2021-02-24 08:08:27 -08:00
Pavel Feldman
48c237b3cf
chore: move trace to server (#5565) 2021-02-23 22:08:14 -08:00
Joel Einbinder
8ef6cb731e
feat(codegen): use the name attribute for more elements (#5376) 2021-02-23 16:24:45 -08:00
Pavel Feldman
096ddab972
fix(inspector): hide drawer when recording (#5548) 2021-02-22 15:35:38 -08:00
Dmitry Gozman
b42c3690d3
fix(codegen): replace html lib with createElement (#5531)
We are not using html that much, since most of our UI moved
to the Recorder App. Getting rid of `innerHTML` assignment
fixes the TrustedTypes issue.
2021-02-22 11:38:49 -08:00
Andrey Lushnikov
eb9c8ce20c
feat(chromium): roll Chromium to Dev @ Feb 19, 2021 (#5536) 2021-02-22 11:17:55 -08:00
Pavel Feldman
6ec77dca9d
fix(inspector): fix the wait for event error rendering (#5517) 2021-02-20 14:36:19 -08:00
Yury Semikhatsky
1e327d4cb2
fix(bindings): unflake TestBrowserContextExposeFunction.shouldWork in java (#5532) 2021-02-19 18:58:32 -08:00
Pavel Feldman
600f731a67
feat(inspector): render api names from metainfo (#5530) 2021-02-19 18:12:33 -08:00
Pavel Feldman
f154a827c5
feat(inspector): send api names along with metainfo (#5518) 2021-02-19 16:21:39 -08:00
Dmitry Gozman
46c8c29f7a
fix(logs): restore pw:browser logs after launch has finished (#5527) 2021-02-19 16:09:38 -08:00
Yury Semikhatsky
5f9acfaccb
feat(webkit): bump to 1436 (#5513) 2021-02-19 13:47:47 -08:00
Zev Isert
cbcc609fa1
fix: return non-secure cookies with HTTPS URLs (#5507)
Cookies have a "Secure" attribute which tells the browsers
that a given cookie should only be sent via HTTPS. In it's
absense "Secure" is falsy and these cookies should be sent
with both HTTP and HTTPS requests. Playwright now returns
only the "Non-Secure" cookies for HTTP URLs, and both
"Secure" and "Non-Secure" cookies for HTTPS URLs.

Fixes #5504
2021-02-19 11:50:59 -08:00
Pavel Feldman
bb2b29631a
feat(inspector): pause on page/context close (#5319) 2021-02-19 09:33:24 -08:00
Dmitry Gozman
8a9048c2b5
feat(inspector): selector input (#5502) 2021-02-19 07:25:08 -08:00
Pavel Feldman
15833ee039
feat(inspector): render params and durations in log (#5489) 2021-02-17 22:10:13 -08:00
Dmitry Gozman
da135c2abb
fix(trace viewer): follow up with recent instrumentation changes (#5488)
- List all actions we are interested in
- Fix timeline hover flicker
- Extract tabbed pane component
- Preview snapshots without clicking on the action
2021-02-17 17:51:57 -08:00
Pavel Feldman
3248c2449c
feat(inspector): collapse completed items (#5484) 2021-02-17 17:28:02 -08:00
Dmitry Gozman
dc51536bca
feat(waitForResponse): print regex pattern when waiting for request/response (#5485) 2021-02-17 15:11:23 -08:00
Pavel Feldman
b2227c1bcf
feat(inspector): allow selecting file (#5483) 2021-02-17 14:05:41 -08:00
Naresh
cc749fe679
fix(android): added recent apps button (#5331) 2021-02-16 19:37:46 -08:00
Pavel Feldman
30e68f6d1f
chore: simplify code generation (#5466) 2021-02-16 18:13:26 -08:00
Andrey Lushnikov
b6bd7c0d6a
feat(chromium): roll Chromium to r851527 (#5434)
Fixes #5197
2021-02-16 14:21:47 -08:00
Andrey Lushnikov
f2b25fe6bd
fix: do not rely on $PATH when resolving executables (#5475)
Since CRON jobs reset $PATH to a very basic one, we should
use only direct paths to system executables.

Fixes #5469
2021-02-16 10:23:38 -08:00
Andrey Lushnikov
6b40d75d03
fix: allow setting input files for detached <input> elements (#5467)
Fixes #5403
2021-02-16 10:22:46 -08:00
Pavel Feldman
0c7da44465
test(inspector): add some tests (#5461) 2021-02-15 08:32:13 -08:00
Dmitry Gozman
1f3449c7da
fix(download): do not stall BrowserContext.close waiting for downloads (#5424)
We might not ever get the "download finished" event when closing the context:
- in Chromium, for any ongoing download;
- in all browsers, for failed downloads.

This should not prevent closing the context. Instead of waiting for the
download and then deleting it, we force delete it immediately and reject
any promises waiting for the download completion.
2021-02-14 16:46:26 -08:00
Pavel Feldman
8b9a2afd3d
feat(inspector): render errors (#5459) 2021-02-13 22:13:51 -08:00
Pavel Feldman
ae2ffb3fb9
feat(inspector): instrument wait for event (#5457) 2021-02-13 20:31:06 -08:00
Pavel Feldman
ecd15e6175
fix(inspector): restore point highlight (#5455) 2021-02-12 22:06:45 -08:00
Pavel Feldman
0782b25272
test: fix recorder downloads test (#5454) 2021-02-12 20:26:22 -08:00
Pavel Feldman
3c877374c7
feat: add replay log (#5452) 2021-02-12 18:53:46 -08:00
Dmitry Gozman
ac1599cc2c
fix(registry): handle relative registry path (#5406)
We get relative registry path when PLAYWRIGHT_BROWSERS_PATH or HOME is relative.
In this case, it would be good to resolve to the same absolute path
during installation and execution, and we can usually do that using INIT_CWD.
2021-02-12 11:12:06 -08:00
Pavel Feldman
aef052aecc
chore: pause on input in pwdebug mode (#5427) 2021-02-12 10:11:30 -08:00
Dmitry Gozman
3e7b8e3d74
test: add basic end-to-end driver test (#5426)
- Introduce internal "out of process" start()/stop() mode.
- This mode is used both in regular tests and installation tests.
- Emulate basic driver installation, browser download and running.
2021-02-12 09:05:32 -08:00
Pavel Feldman
449adfd3ae
chore(recorder): move recording output into the gui app (#5425) 2021-02-11 17:46:54 -08:00
Dmitry Gozman
99f8e1cf63
docs: document Android and friends (#5415)
These are experimental, currently available through `_android`.
2021-02-11 10:31:57 -08:00
Andrey Lushnikov
6113d4d50d
feat(chromium): roll Chromium to r846621 (#5413) 2021-02-11 07:43:43 -08:00
Joel Einbinder
d8f637c239
chore(typescript): enable esModuleInterop (#5409) 2021-02-11 06:36:15 -08:00
Pavel Feldman
6576bd8b31
chore: move before/after action instrumentation into dispatcher (#5416) 2021-02-10 21:55:46 -08:00
Pavel Feldman
6e6e36b565
chore: move progress log into the metadata (#5411) 2021-02-10 21:50:29 -08:00
Pavel Feldman
a164f2a810
chore: make instrumentation multiplexing proxy-based (#5410) 2021-02-10 21:44:22 -08:00
Pavel Feldman
a06cf70d28
chore: pass parsed stack in metainfo (#5407) 2021-02-10 18:52:28 -08:00
Joel Einbinder
dca70abbd3
feat(chromium): connect to a browser over cdp (#5207) 2021-02-10 14:00:02 -08:00
Yury Semikhatsky
a8ebe4d888
fix(screencast): support viewport with odd dimensions (#5399) 2021-02-10 13:37:27 -08:00
Dmitry Gozman
b4b14eab69
chore: refactor actionability checks (#5368) 2021-02-10 12:36:26 -08:00
Dmitry Gozman
38209c675c
fix(selector generator): correct nth-match, remove label treatment, performance (#5388)
- Remove label retargeting, as it does not play nicely with recorder.
- nth-match() is now correctly chained.
- Performance improvements around parent selectors and regex text matches.
2021-02-10 12:31:50 -08:00
Dmitry Gozman
78ab2955f3
fix(isVisible): do not wait for the selector to be resolved (#5393) 2021-02-10 07:12:43 -08:00
Dmitry Gozman
6a98241ac5
feat(selectors): speed up text selector (#5387)
- Do not check children when parent does not contain the text we look for.
- Minor caching improvements in evaluator.

This gives up to 5X performance boost on text-heavy pages.
2021-02-09 21:31:46 -08:00
Pavel Feldman
2e01fbdbec
chore: introduce instrumentation api (#5385) 2021-02-09 14:44:48 -08:00
Pavel Feldman
0652f3251f
chore: introduce sdk object base class (#5370) 2021-02-09 09:00:00 -08:00
Dmitry Gozman
0871a9cfd9
feat(codegen): improve selector generation (#5364)
- Snap to buttons, inputs, selects, etc.
- Try `<label>` selector in addition to the element.
- Use parent selectors when needed.
- Remove xpath fallback as it should be covered with css.
2021-02-08 21:53:17 -08:00
Dmitry Gozman
002d8ef5a7
chore: remove Progress.aborted (#5363)
Most places use Progress.cleanupWhenAborted instead.
2021-02-08 17:33:01 -08:00
Pavel Feldman
d49a1d8174
chore: kill electron process on ctrl+c (#5366) 2021-02-08 16:04:15 -08:00
Andrey Lushnikov
d499cf08d1
refactor: remove browserPaths in favor of Registry class (#5318)
This patch introduces a new Registry class that incapsulates
all logic regarding browsers and their paths.

Fixes #5278
2021-02-08 16:02:49 -08:00
Pavel Feldman
6680713e84
chore: don't reuse recorder app profile (#5365) 2021-02-08 16:02:23 -08:00
Dmitry Gozman
6d56a110ca
feat(proxy): throw when socks proxy is used with auth (#5358) 2021-02-08 12:07:45 -08:00
Yury Semikhatsky
bb0af314ba
fix(video): set default size to fit into 800x800 (#5333) 2021-02-08 10:59:48 -08:00
Max Schmitt
da4304a05c
chore: run recorder app in no sandbox (#5345) 2021-02-08 07:38:24 -08:00
Dmitry Gozman
983e04374a
chore: fix build/packaging for recorder and traceviewer (#5338) 2021-02-05 16:19:09 -08:00
Pavel Feldman
c0610ccef4
feat(recorder): remove recorder overlay toolbar (#5334) 2021-02-05 14:24:27 -08:00
Dmitry Gozman
9c0609b0ec
fix(trace viewer): do not render invisble tabs (#5322) 2021-02-05 12:56:45 -08:00
Dmitry Gozman
de30ee0aa8
fix(oopifs): account for various races between processes (#5320)
Consider the following situation (one among many possible).
- FrameA has an oopif child FrameB;
- FrameA navigates to same-process origin (e.g. about:blank);
- at the same time, FrameC is attached to the FrameB in the
  FrameB's process.

In this case, we get `frameNavigated` event for FrameA, immediately
followed by `frameAttached` event for FrameC. Since we detach all
FrameA's child frames on navigation, including the oopif FrameB,
there is no parent frame for FrameC to attach to.

In general, multiple processes coming from oopif may send their
events in wildly different order, and their view about the frame
tree may not always correspond to the "up to date" frame tree as
seen from the main frame's process. We try to keep our frame tree
aligned with what main process thinks, and ignore events that
reference frames absent in this tree.

Drive-by: handle filechooser exceptions because of async processing.
2021-02-05 11:30:44 -08:00
Dmitry Gozman
0cbb2c14e6
feat(text selector): match text in child nodes (#5293)
This changes `text=` and `:text()` selectors to match the element when:
- it's combined text content matches the text;
- combined text content of any immediate child does not match the text.

This allows the following markup to match "Some bold and italics text":
`<div>Some <b>bold</b> and <i>italics</i> text</div>`.

For the reference, "combined text content" is almost equal to `element.textContent`,
but with some changes like using value of `<input type=button>` or ignoring `<head>`.

This also includes some caching optimizations, meaningful in complex matches
that involve multiple calls to the text engine.

Performance changes (measured on large page with ~25000 elements):
- `:has-text()` - 14% faster.
- `text=` - 50% faster.
- `:text()` - 0-35% slower.
- `:text-matches()` - 28% slower.
2021-02-04 17:44:55 -08:00
Pavel Feldman
c1b08f1a8c
feat(recorder): allow dragging toolbar (#5316) 2021-02-04 14:41:53 -08:00
Yury Semikhatsky
997bd0827c
feat(webkit): bump to 1432 (#5300) 2021-02-04 08:53:00 -08:00
Pavel Feldman
c2b8718bae
fix(waitForFunction): process isFunction auto-detection (#5312) 2021-02-04 08:45:59 -08:00
Pavel Feldman
17986773f8
feat: remove chaining from trace viewer preview (#5265) 2021-02-04 06:24:53 -08:00
Pavel Feldman
dd9b51d68b
chore: friendlier install failure message (#5281) 2021-02-04 06:23:47 -08:00
Yury Semikhatsky
6ae2e576d8
fix: properly detect function literals (#5296) 2021-02-03 16:56:36 -08:00
Pavel Feldman
34adc28ed3
feat(pause): make page.pause public (#5288) 2021-02-03 16:01:51 -08:00
Dmitry Gozman
d8e0834562
fix(server): use setMaxListeners(0) on all internal event emitters (#5283) 2021-02-03 13:53:09 -08:00
Pavel Feldman
3d253c4e5c
feat: auto-detect expression/function in js server (#5284) 2021-02-03 13:49:25 -08:00
Dmitry Gozman
fa1cf4108b
fix(codegen): do not show recorder controls in iframes (#5282) 2021-02-03 13:42:29 -08:00
Dmitry Gozman
53ed35ef96
feat(dialogs): auto-dismiss dialogs when there are no listeners (#5269)
This makes dialogs disappear and prevents stalling.

Pros:
- No need to worry about dialogs for most users.
- Those that wait for a specific dialog still get to control it.

Cons:
- Those who use Playwright to show interactive browser will have
  to add an empty 'dialog' handler to prevent auto-dismiss.
  We do this in cli.
2021-02-03 10:34:45 -08:00
Andrey Lushnikov
cb1b64289c
devops: downloading ffmpeg during install step (#5249)
This patch starts downloading FFMPEG like we download our browsers
instead of bundling it in the NPM package.

With this patch, NPM size is reduced from 8.8MB to 1.7MB.

Consequences:
- `npx playwright` is drastically faster now
- playwright driver for language bindings is way smaller
- projects that bundle Playwright can pass Apple Notorization

Fixes #5193
2021-02-03 09:19:11 -08:00
Dmitry Gozman
4cad34509f
fix(oopifs): do not emulate focus in oopifs (#5270)
- We don't need this, since it should propagate from the main frame.
- Forcing focus in oopif immediately focuses it and blurs currently
  focused frame. This leads to undesired side effects, e.g. selects
  being closed.
2021-02-03 08:47:52 -08:00
Dmitry Gozman
1a464c732c
feat(video): switch vp8 in ffmpeg to realtime (#5260)
This switches vp8 to "realtime" mode that works fast, adapting to
the speed of incoming frames, and produces the best quality in can
given realtime constraints.

In practice, this gives 2x larger video files but no noticible quality
difference. It also eliminates huge delays for encoding the video.

Drive-by: document our ffmpeg option choices and add some links
to documentation for future use.
2021-02-02 17:14:39 -08:00
Pavel Feldman
8a8d8ea370
fix: update terminal size dynamically (#5250) 2021-02-02 14:25:51 -08:00
Dmitry Gozman
6c12f58058
feat(selectors): always make xpath relative (#5252)
This makes `/foo` and `//foo` match starting with the scope,
not the document, by turning them into `./foo` and `.//foo`.
2021-02-02 13:27:16 -08:00
Dmitry Gozman
9e09bd369d
fix(oopifs): ignore target closure when broadcasting across oopifs (#5246) 2021-02-02 10:21:42 -08:00
Dominik Deren
8c65871b25
fix(trace viewer): Bringing back the ability to display images in Network Tab in Trace Viewer. (#5232)
This fix restores the ability to display images in the Network Tab inside Trace Viewer. Previously data returned from the server was coming back as base64 encoded string, but now it is returned as a Buffer object. This required convertion to either base64 encoded string or utf8 encoded string on the frontend.

Co-authored-by: Dominik Deren <dominik.deren@live.com>
2021-02-01 22:56:53 -08:00
Andrey Lushnikov
276bbca3d1
fix: retry browser launch if it failed due to glibc error (#5247)
Fixes #5214
2021-02-01 15:23:57 -08:00
Pavel Feldman
1db5ef24a8
docs: document electron api (#5229) 2021-02-01 11:43:26 -08:00
Andrey Lushnikov
08e2b5b825
fix(installer): retry installer when hitting ETIMEDOUT as well (#5239)
Fixes #5233
2021-02-01 09:30:22 -08:00
Dmitry Gozman
a9de3d8fd2
feat(snapshots): switch MutationObserver to only observer attributes (#5220)
Everything but attributes in the light dom is manually compared during
DOM traversal, for example child nodes or scroll offset.

This way we get a bullet-proof solution that works with input values,
scroll offsets, shadow dom and anything else web comes up with.

We also restore scroll only on the document scrolling element, for
performance reasons. We should figure out the story around scrolling.

Changes stationary snapshots from ~0.5ms to ~2.5ms due to DOM traversal.
2021-01-31 19:20:20 -08:00
Pavel Feldman
bf8c30a88b
feat(ui): extract recorder sidebar into a window (#5223) 2021-01-31 16:37:13 -08:00
Pavel Feldman
975519150e
chore: centralize playwright creation, bind context listeners to instance (#5217) 2021-01-29 16:00:56 -08:00
Dmitry Gozman
7fe7d0ef32
feat(snapshots): make cssom overrides efficient (#5218)
- Intercept CSSOM modifications and recalculate overridden css text.
- When css text does not change, use "backwards reference" similar
  to node references.
- Set 'Cache-Control: no-cache' for resources that could be overridden.
2021-01-29 15:24:38 -08:00
Dmitry Gozman
69ca30834e
feat(snapshots): incremental snapshots (#5213)
- Switch from html to json ml format.
- Allow node reuse between snapshots with `[nSnapshotsBefore, nodeWithIndexM]`.
- Service worker now lazily serializes snapshot chunks into a single html.

This decreases total snapshot size on random scripts ~10x.
This also decreases snapshot collecting time on mostly static pages to ~0.3ms.

Unfortunate downside for now is that we have to intercept
`Element.prototype.attachShadow` to invalidate nodes. This
also temporary breaks scroll restoration. Needs more research.
2021-01-29 06:57:57 -08:00
Dmitry Gozman
5e934d0fbd
chore(trace viewer): split SnapshotServer (#5210)
- Move service worker under /snapshot/ instead of /.
- Fix stylesheet base uri bug, where we inherited the wrong base url.
- Introduce TraceServer and routes there, split the actual routes
  between snapshot, ui and action previews.
2021-01-28 15:09:20 -08:00
Pavel Feldman
79e00e4911
feat(ui): more recorder uis (#5208) 2021-01-28 14:25:10 -08:00
Dominik Deren
f8fbfe28fa
feat(trace viewer): Adds _debugName BrowserContextOption to let users define a name for their contexts (#5205)
This change is adding a new property on the BrowserContextOptions class called `_debugName`. This property allows defining a user-friendly name for the browser context, and currently it is being used in one place, the Trace Viewer. When user provides the new value in the following way:

```typescript
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({ _traceDir: __dirname, _debugName: 'My custom testcase name' });
  await context.close();
  await browser.close();
})();
```

The `_debugName` will be saved in the `*.trace` file for this browser context, on the `context-created` event, under the key `debugName`.

Later, when such a trace is displayed using Trace Viewer, the `debugName` will be displayed in the dropdown in the top right part of the app instead of the actual trace filename.

Fixes #5157.
2021-01-28 10:50:57 -08:00
Pavel Feldman
8d8fa4c322
chore: move trace viewer to the src/web (#5199) 2021-01-28 09:33:20 -08:00
Andrey Lushnikov
fe1302b47d
feat(installer): retry download if connection is interrupted (#5126)
Fixes #5110
2021-01-28 00:37:42 -08:00
Andrey Lushnikov
d1a2c87e88
chore: remove backward compatibility code from installer (#5168)
Installer has a code to download browsers from the old version of
playwright. This, however, is never needed, since installer only
installs browsers from its own version.
2021-01-27 22:32:25 -08:00
Dmitry Gozman
ce43e730f4
feat(traceviewer): use http server instead of interception (#5195)
This introduces an http server that serves our frontend and our snapshots. There is more work to untangle the big server into a few modules.

This change allows us:
- Maybe eventually serve the trace viewer as a web page.
- Rely on browser caches for fast snapshot rendering. This PR also adds "snapshot on hover" feature, subject to change.
2021-01-27 19:42:51 -08:00
Dmitry Gozman
e915e51ea9
chore: fix bad merge in codeGenerator.ts (#5196) 2021-01-27 17:45:27 -08:00
Dmitry Gozman
2793d14409
fix(codegen): do not forget to reset currentAction in didPerformAction (#5194) 2021-01-27 17:05:56 -08:00
Pavel Feldman
e50f11c5b1
feat(ui): more recorder uis (#5187) 2021-01-27 17:02:09 -08:00
Dmitry Gozman
321a873d8a
fix(codegen): add timeout to our actions, catch errors (#5188) 2021-01-27 15:57:28 -08:00
Pavel Feldman
ff6b2b1dd4
chore: make emulate media params be options (#5172) 2021-01-27 14:19:37 -08:00
Dmitry Gozman
527286683f
feat(codegen): prefer frame name over url when unique (#5175) 2021-01-27 13:19:36 -08:00
Dmitry Gozman
0108d2d41f
feat(snapshots): various improvements (#5152)
- Adopt "declarative shadow dom" format for shadow dom snapshots.
- Restore scroll positions.
- Render snapshot at arbitrary timestamp.
2021-01-26 15:09:17 -08:00
Dominik Deren
a3af0829ff
feat(trace viewer): Extending existing NetworkTab view (#5009)
feat(trace viewer): Extending existing NetworkTab view

Currently the network tab contains a limited amount of information on the resources that were loaded in the browser. This change proposes extending the details displayed for each resource, to include:

- HTTP method,
- Full url,
- Easily visible response content type,
- Request headers,
- Request & response bodies.

Such level of information could help quickly understand what happened in the application, when it was communicating with backend services. This can help debug tests quicker to figure out why they are failing.

This implementation still needs some clean up & tests improvement, but I wanted to propose such changes and gather your feedback before going too far.
2021-01-26 11:06:05 -08:00
Yury Semikhatsky
f3cc4dfe6d
feat(webkit): bump to 1428 (#5140) 2021-01-26 09:42:06 -08:00
Pavel Feldman
45f7d73470
chore: plumb terminal size and port language (#5149) 2021-01-25 19:01:04 -08:00
Dmitry Gozman
5033261d27
feat(trace): streaming snapshots (#5133)
- Instead of capturing snapshots on demand, we now stream them
  from each frame every 100ms.
- Certain actions can also force snapshots at particular moment using
  "checkpoints".
- Trace viewer is able to show the page snapshot at a particular
  timestamp, or using a "checkpoint" snapshot.
- Small optimization to not process stylesheets if CSSOM was not used.
  There still is a lot of room for improvement.
2021-01-25 18:44:46 -08:00
Pavel Feldman
87a3ccc49e
fix: do not return cookies with empty values (#5147) 2021-01-25 16:37:33 -08:00
Pavel Feldman
2e290be40b
chore: remove source maps in pwdebug mode (#5148) 2021-01-25 16:36:57 -08:00
Pavel Feldman
fdde9493ea
fix: don't parse potentially invalid urls in event handlers (#5090) 2021-01-25 14:49:51 -08:00
Pavel Feldman
01d6f83597
chore: introduce debug toolbar (#5145) 2021-01-25 14:49:26 -08:00
Dmitry Gozman
894abbfe28
feat(selectors): has-text pseudo-class (#5120)
This pseudo-class matches approximately when
`element.textContent.includes(textToSearchFor)`.
2021-01-25 14:19:07 -08:00
Dmitry Gozman
d78d337e29
feat(fill): make fill work when targeting elements inside the label (#5143) 2021-01-25 13:40:19 -08:00
Dmitry Gozman
beed9a79a3
feat(chromium): bump to 845618 (#5138) 2021-01-25 07:45:21 -08:00
Pavel Feldman
464fdc1800
chore: make recorder a supplement (#5131) 2021-01-24 19:21:19 -08:00
Pavel Feldman
be9bef513e
chore: move recorder to server side (#5128) 2021-01-24 08:44:11 -08:00
Joel Einbinder
3e4e511d84
feat(pause): page._pause to wait for user to click resume (#5050) 2021-01-22 18:47:02 -08:00
Andrey Lushnikov
74816e4000
fix(installer): release lock if things go south (#5125)
References #5110
2021-01-23 04:27:33 +03:00
Dmitry Gozman
3e1c72ac5f
fix(reload): do not throw when reload is racing with navigation (#5113)
When `page.reload()` is racing against the renderer-initiated
navigation, we might end up with `waitForNavigation()` being rejected
before the reload implementation is able to catch it.

To avoid that, carefully use Promise.all and await `waitForNavigation`
from the get go.

Same happens to `page.goForward()` and `page.goBack()`.
2021-01-22 15:58:53 -08:00