Commit Graph

1104 Commits

Author SHA1 Message Date
Dmitry Gozman
01a4060665
chore: move action instrumentation per-context (#3908)
This allows tracing to expose plugin-like api.

This also remove Progress -> ActionMetadata dependency, leaving
Progress a low-level utility.
2020-09-17 09:32:54 -07:00
Dmitry Gozman
dc06f0a75c
chore: introduce evaluateInUtility private api (#3907)
This is an experimental  client-side api. We'll experiment with it in plugins like tracing.
2020-09-16 16:07:49 -07:00
Dmitry Gozman
36f2420b0f
chore(trace): remove dependency on handle._previewPromise (#3906)
We now mark the target with '__playwright_target__' attribute and
let the trace viewer do whatever it wants.
2020-09-16 15:26:59 -07:00
Yury Semikhatsky
5507553173
fix(screencast): repeat previous frame instead of current (#3890) 2020-09-15 15:21:50 -07:00
Dmitry Gozman
592bae1cea
feat(trace): record goto, setContent, goBack, goForward and reload (#3883) 2020-09-15 09:46:36 -07:00
Max Schmitt
8bc09af458
fix(firefox): imply default ports for proxy (#3850) 2020-09-14 21:22:07 -07:00
Andrey Lushnikov
430f2bedaa
devops: stop relying on ubuntu stock ffmpeg (#3882)
This patch bakes ffmpeg-linux r1001 into our NPM package.

This increases NPM package size from 4.2MB to 6.7MB.

Fixes #3845
2020-09-14 19:22:00 -07:00
Yury Semikhatsky
459d857bc3
feat(screencast): add saveAs and createReadableStream (#3879) 2020-09-14 18:40:55 -07:00
Dmitry Gozman
2f0d2029ca
chore: refactor goBack/goForward/reload (#3859)
These methods are the only users of waitForNavigation and
waitForLoadState on the server side. This refactor lifts the
Progress wrapper to the top-most goBack/goForward/reload call
and leaves waitForNavigation/waitForLoadState as internal helpers.
This way we get a single Progress for the actual api call.
2020-09-14 16:43:17 -07:00
Dmitry Gozman
0a243c6792
fix(waitTask): remove rerunnable tasks from the context data upon success/failure (#3875) 2020-09-14 14:55:37 -07:00
Dmitry Gozman
7ab0c10d7b
fix(launchServer): do not throw when 'port' option is present (#3877)
We now use 'launch' under the hood, which erroneously throws
when 'port' is present.

Instead, moved validation to the client side where it belongs,
added tests for validation errors.
2020-09-14 14:43:39 -07:00
Dmitry Gozman
01198f8eef
fix($$): use utility context when possible (#3870)
This avoids the typical issue of overridden bulitins,
trading it for performance of one by one node adoptions.
2020-09-14 10:38:14 -07:00
Yury Semikhatsky
e5c6b19c00
fix(launcher): check for ffmpeg only when starting screencast (#3874) 2020-09-14 10:26:44 -07:00
Pavel Feldman
c20cbae529
chore: remove trace viewer (#3869) 2020-09-14 07:56:04 -07:00
Max Schmitt
beceeaf6a1
feat(browserContext): add BrowserContext.browser() (#3849) 2020-09-14 07:50:47 -07:00
Dmitry Gozman
5314512cbc
chore: inline page._runAbortableTask (#3861)
It does not do anything nowadays.
2020-09-11 23:33:38 -07:00
Yury Semikhatsky
40323aa94d
fix(screencast): use viewport as default size (#3844) 2020-09-11 15:14:31 -07:00
Dmitry Gozman
c4adeb66ce
fix(snapshot): do not let a single frame fail the whole snapshot (#3857)
Sometimes, we are unable to take a frame snapshot. The most common
example would be "frame is stuck during the navigation in Chromium",
where we cannot evaluate until the frame is done navigating.

In this case, use all other frames and just stub the failing ones
with "Snapshot is not available". Chances are, noone will even see
this frame because it's an invisible tracking iframe.
2020-09-11 15:13:37 -07:00
Max Schmitt
c175dad290
chore: fix compatibility to the domain module (#3851) 2020-09-11 14:40:49 -07:00
Dmitry Gozman
263aa06fa4
feat(trace): trace more actions (#3853) 2020-09-11 13:28:24 -07:00
Dmitry Gozman
16be357489
feat(trace): trace page open/close events (#3852) 2020-09-11 11:34:53 -07:00
Dmitry Gozman
38ed8de23d
feat(tracing): trace actions (#3825)
- Fill and click actions pass metadata to Progress.
- Progress reports success/failure through instrumentation.
- Tracer consumes ActionResult and ActionMetadata and records them.

Currently, only click and fill actions pass metadata to
contain the size of the change. Everything else should follow.
2020-09-10 21:42:09 -07:00
Dmitry Gozman
9e41518c92
feat(rpc): allow sending metadata with rpc calls (#3836)
Currently, metadata does only contain the stack trace,
and we send it from the JS client.
2020-09-10 19:25:44 -07:00
Philipp Mudra
1e600cb9d8
fix(windows): show details about missing dependencies (#3839) 2020-09-10 16:36:08 -07:00
Dmitry Gozman
46f9151795
fix(rpc): ensure better error messages when rpc misbehaves (#3838)
- Print parentGuid when it is not available for __create__.
  Some bots show generic "something is undefined" error - let's
  get better information about the failure.

- Ignore events on disposed objects outside of tests.
  Some bots show this happening for "previewUpdated" - let's see
  whether there are more important events that misbehave.
2020-09-10 16:20:12 -07:00
Dmitry Gozman
ed3b00efdf
chore: merge BrowserType and BrowserTypeBase, remove logName (#3837)
- We do not need the public BrowserType different from BrowserTypeBase anymore.
- Removing 'logName' parameter from runAbortableTask - it will
be used for metadata instead.
2020-09-10 15:34:13 -07:00
Dmitry Gozman
bf9c4a35f6
fix(snapshot): properly save textarea content (#3835) 2020-09-10 15:33:39 -07:00
Andrey Lushnikov
868740067b
refactor: consolidate ffmpeg-related files in third_party/ffmpeg (#3815)
This patch:
- moves ffmpeg binaries from `//bin/` to `//third_party/ffmpeg`
- adds [COPYING.GPLv3](https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.GPLv3)
ffmpeg license
- changes npm packaging to include `//third_party/ffmpeg` only in `playwright` and `playwrihgt-chromium` a
2020-09-09 09:51:28 -07:00
Andrey Lushnikov
e8cf89572a
feat(chromium): roll Chromium to r799411 (#3811) 2020-09-09 00:58:25 -07:00
Joel Einbinder
1791be6d16
fix(input): send keypress event for enter key in chromium (#3796) 2020-09-08 20:04:14 -07:00
Pavel Feldman
b28ed214ca
chore: remove highlight from PWDEBUG in favor of devtools one (#3800) 2020-09-08 20:02:58 -07:00
Andrey Lushnikov
638c77c8e2
devops: stop bundling FFMPEG with Chromium (#3806)
- This stops bundling FFMPEG with Chromium
- Stop supporting build numbers as fractional parts for Chromium
revisions
2020-09-08 17:05:21 -07:00
Yury Semikhatsky
af58c8acb2
fix(screencast): ensure that _videostarted is fired after newPage (#3807) 2020-09-08 17:01:00 -07:00
Yury Semikhatsky
8f81868b9c
fix(screencast): tune ffmpeg params for better quality (#3798) 2020-09-08 15:39:18 -07:00
Andrey Lushnikov
143adc1634
refactor: bake ffmpeg into npm instead of CDN (#3799) 2020-09-08 15:10:36 -07:00
Pavel Feldman
74f1a64e36
fix(debug): do not generate source urls for anonymous scripts (#3787) 2020-09-07 15:50:25 -07:00
Pavel Feldman
c83b2da54f
chore: revert isDevMode into isUnderTest (#3785) 2020-09-06 21:36:22 -07:00
Pavel Feldman
fea3ceb36c
chore: expose injectedScript.extend (#3784) 2020-09-06 18:19:32 -07:00
Yury Semikhatsky
66985fc5f6
feat(screencast): add expreimental public API on context (#3766) 2020-09-04 22:37:38 -07:00
Dmitry Gozman
675ce00432
chore: introduce "instrumentation" that is used for debug and trace (#3775) 2020-09-04 16:31:52 -07:00
Andrey Lushnikov
bbe2233f08
feat(chromium): use bundled ffmpeg instead of npm deps (#3771)
Fixes #3680
2020-09-04 04:17:51 -07:00
Andrey Lushnikov
a755d100b3
devops: encode build number together with Chromium revision (#3769)
This is an alternative approach to #3698 that was setting up a custom
mapping between chromium revisions and our mirrored builds. For example, we were
taking chromium `792639` and re-packaging it to our CDN as Chromium 1000.

One big downside of this opaque mapping was inability to quickly
understand which Chromium is mirrored to CDN.

To solve this, this patch starts treating browser revision as a fractional number,
with and integer part being a chromium revision, and fractional
part being our build number. For example, we can generate builds `792639`, `792639.1`,
`792639.2` etc, all of which will pick Chromium `792639` and re-package it to our CDN.

In the Playwright code itself, there are a handful of places that treat
browser revision as integer, exclusively to compare revision with some particular
revision numbers. This code would still work as-is, but I changed these places
to use `parseFloat` instead of `parseInt` for correctness.
2020-09-04 03:12:30 -07:00
Max Schmitt
190d16daa3
feat: add browser type to device descriptors (#3731) 2020-09-03 13:12:43 -07:00
Dmitry Gozman
c190310335
fix(setInputFiles): make it work with CSP enabled (#3756)
We used to do fetch() to decode the file buffer. However, this is
blocked by strict CSP policy. Instead, we can use explicit
string -> bytes conversion, and trade performance for CSP compliance.
2020-09-03 10:09:03 -07:00
Andrey Lushnikov
7671e8e8be
devops: remove warnings when running under root without sandbox (#3749)
As discussed offline, our testing scenarios assume running trusted
web content - so this warning is just a noise for this usecases.

When it comes to dealing with untrusted web content though, automation
authors need to make sure to not launch browsers under root in the first
place.
2020-09-02 18:02:11 -07:00
Andrey Lushnikov
2d46cd8105
feat(electron): automatically disable electron sandbox when run as root (#3747) 2020-09-02 17:30:10 -07:00
Yury Semikhatsky
0976732ec6
fix(screencast): remove white padding in headless chromium (#3746) 2020-09-02 17:28:08 -07:00
Dmitry Gozman
de547d7d65
fix(connect): make selectors.register work in connected browser (#3664)
This is a large rework of selectors:
- Each BrowserContext now has a separate Selectors instance that has its own registrations.
  Most of them share a single sharedSelectors instance, but contexts created for a connected
  browser have their own instance.
- Connected browser now gets a RemoteBrowser object that encapsulates Selectors and Browser.
  This Selectors object is registered with the api selectors.
- Public selectors.register api iterates over all registered Selectors channels
  and registers in each of them.
- createSelector testing method migrated to ElementHandle._createSelectorForTest.
2020-09-02 16:15:43 -07:00
Dmitry Gozman
be5eba0cd8
fix(rpc): improve internal error for unexpected rpc message (#3734)
Sometimes I see "cannot call emit on the undefined" error on the bots.
This change adds some more logging, so we could potentially identify where
the issue comes from.
2020-09-02 12:56:50 -07:00
Yury Semikhatsky
1e64efcad1
feat(screencast): autoscale to fit requested size (#3730) 2020-09-02 10:40:50 -07:00