Commit Graph

3223 Commits

Author SHA1 Message Date
Dmitry Gozman
133de10a47
browser(firefox): start screencast in existing pages upon setScreencastOptions (#4045)
This makes it work in persistent context.

To achieve this, we have to move screencast logic into PageTarget and
make PageHandler listen to an event.
2020-10-02 17:16:49 -07:00
Pavel Feldman
1f16ce2632
test: remove failing expectations from a passing test (#4036) 2020-10-02 11:01:04 -07:00
Andrey Lushnikov
ec36eef3a2
feat(firefox): roll Firefox to r1179 (#4044)
References #3995
2020-10-02 09:27:24 -07:00
Andrey Lushnikov
2c11b10598
browser(firefox): remove multisession logic (#4039)
This patch:
1. Changes `SimpleChannel` to buffer messages to the namespace that
   hasn't been registered yet. This allows us to create `SimpleChannel`
   per target on the browser side right away.
2. Removes multisession support. Now there's only one `PageAgent` in the
   content process, which talks to a single `PageHandler` on the browser
   side. Both ends can be created as-soon-as-needed; thanks to
   `SimpleChannel` bufferring, no messages will be lost and all messages
   will be delivered in proper order. (This is currently the reason why
   build 1178 flakes on windows).
3. Straightens up the target reporting. Targets are reported as soon
   as they appear on the browser side.

**NOTE:** this doesn't yet remove sessions from protocol.

References #3995
2020-10-02 04:13:42 -07:00
Dmitry Gozman
5e42029fce
api: allow exposeBinding to pass handles (#4030)
This adds an option `{ handle: true }` to pass a single handle instead of arbitrary json values.
2020-10-01 22:47:31 -07:00
Tom Jenkinson
c2171218fa
test: add a test for request interception with redirects (#3994) 2020-10-01 19:55:39 -07:00
Pavel Feldman
81c1daed73
test: roll test runner 0.9.17 (#4035) 2020-10-01 13:32:52 -07:00
Max Schmitt
318ab28171
chore: include api.json in NPM package (#4034) 2020-10-01 12:47:16 -07:00
Dmitry Gozman
4a77363af7
api: update videos api, hide tracing (#4015) 2020-10-01 11:06:19 -07:00
Dmitry Gozman
920cc7c886
test: run crash tests with chromium wire (#4026) 2020-10-01 05:30:27 -07:00
Andrey Lushnikov
b74a6b78ef
browser(firefox): do not double-attach session to the same target (#4027)
We currently might double-attach to the target in `BrowserHandler` since we iterate over all targets, and then subscribe to the additional event when target is getting initialized.

This patch fixes this race condition and should unblock the roll to r1177.

References #3995
2020-09-30 23:50:02 -07:00
Dmitry Gozman
f885d07cb9
fix(close): fix a race during context.close and page.close (#4018)
There is a race between "close" event coming from the server and
"close" command issued from the client.

This is similar to calling close after disconnect, so added tests.
2020-09-30 21:17:30 -07:00
Andrey Lushnikov
b9dcfb9909
test: minor fixes (#4024)
- missing await
- missing `defaultBrowserOptions` that's important to respect `FFPATH` (and other custom browsers)
2020-09-30 17:23:13 -07:00
Dmitry Gozman
13d48da84a
test: record trace/videos on retries (#4009) 2020-09-30 16:52:21 -07:00
Andrey Lushnikov
974358442d
browser(firefox): move user agent emulation to browser side (#4016)
References #3995
2020-09-30 08:02:22 -07:00
Dmitry Gozman
ab2714ed29
test: unflake click-timeout-4 (#4012)
We used to animate for 5 seconds, and also timeout after 5 seconds.
Presumably, this made the click work sometimes due to different timeout
schedulers in node vs browser.
2020-09-30 04:42:08 -07:00
Dmitry Gozman
ccc827cd87
test: add a test for screen.avail{Width,Height} emulation (#4011)
This currently does not work in WebKit.
2020-09-30 04:14:29 -07:00
Andrey Lushnikov
e28083974d
browser(firefox): simplify PageTarget lifecycle (#4014)
As of today, we create `PageTarget` instances whenever we get a
sync IPC from the content process. This, however, breaks an invariant
that `browserContext.pages` always has all pages (and *browsing contexts* - not to be confused with *browser contexts*), associated with browser context. This invariant will be especially important when we move
user agent emulation to browser-side.

This patch makes `PageTarget` lifecycle symmetrical:
- `PageTarget` instance is created when tab is opened
- `PageTarget` is destroyed when tab is crashed or closed

This should also fix a bunch of race conditions with persistent mode, since sometimes we arrive to the window after its
initialization.

Drive-by: straighten viewport management and put a nice descriptive comment.
2020-09-30 02:10:34 -07:00
Andrey Lushnikov
24bc0e39b8
browser(firefox): remove the hack around setting viewport size (#4010)
Juggler code had a bug where we subscribed to window and tab
events, but did not iterate collections of current windows and tabs.

As a result, we were sometimes failing to set viewport size for the
initial window, and implemented an artificial promise to workaround
the problem.

This patch:
- starts calling `onOpenWindow` and `onOpenTabListener` callbacks
  for *all* windows and tabs - current and future, eliminating the
  race condition.

This worked too well and we started overriding window sizes that
were set by users with `window.open(url, 'width=300;height=400')` (we
have a test for this). To fix this, we now plumb `CHROME_WITH_SIZE`
flag from appWindow and override viewport iff this flag is not set.

After this patch, we will use the `onTabOpened` event to move user
agent emulation to the browser-side.

References #3995
2020-09-30 00:36:46 -07:00
Andrey Lushnikov
a20c0e0adb
roll(firefox): roll Firefox to r1174 (#4005)
The r1174 starts using cross-process frameIds. This
simplifies Juggler a lot, but regresses a rare usecase:
network requests from workers from subframes are attributed
to main frame.

This adds a test to annotate this regression. Note that this
doesn't also work in Chromium.

References #3995
2020-09-29 21:07:25 -07:00
Pavel Feldman
d658b687ca
chore: refactor screencast tests (#4007) 2020-09-29 18:52:30 -07:00
Pavel Feldman
20b83ee0b4
fix(electron): do not use --require to throttle startup (#4006) 2020-09-29 18:01:14 -07:00
Pavel Feldman
6dccd2735a
fix(wire): fix the wire mode (#4008) 2020-09-29 18:00:56 -07:00
Pavel Feldman
7ccdc5176d
chore: include api.json into the Playwright package (#4003) 2020-09-29 13:48:24 -07:00
Pavel Feldman
c30b894f27
chore: add missing image test expectation (#4004) 2020-09-29 13:47:57 -07:00
Pavel Feldman
de1e63dff1
test: roll test runner 0.9.16 (#3998) 2020-09-29 11:51:00 -07:00
Andrey Lushnikov
2631e1a809
browser(firefox): use browsingContextID for frame IDs (#3999)
BrowsingContextIDs are consistent across the processes, so we can use
them to target frames in both browser and content processes. This will
aid browser-side navigation.

As a nice side-effect, we can drop a round-trip to the content process
for every `requestWillBeSent` event since we *almost* always can
attribute all network events to the proper parent frames.

I say "almost", because we in fact **fail** to correctly attribute requests
from workers that are instantiated by subframes. This, however, is
not working in Chromium ATM, so I consider this to be a minor regression
that is worth the simplification.
2020-09-29 11:22:00 -07:00
Dmitry Gozman
b3497b333e
fix(actions): wait for some time before retrying the action (#4001)
This saves some CPU cycles while waiting for the page to
change the state, e.g. for animations to complete.

Note that retrying logic is only applicable in rare
circumstances like unexpected scroll in the middle of an
action, or some overlay blocking the click. Usually,
action times out in this cases while retrying.
2020-09-29 10:28:19 -07:00
Pavel Feldman
109688a066
chore: split playwright.fixtures into files (6) (#3988) 2020-09-26 16:05:58 -07:00
Pavel Feldman
423485e0a4
chore: split playwright.fixtures into files (5) (#3986) 2020-09-26 14:16:22 -07:00
Pavel Feldman
0ee9050f1b
chore: split playwright.fixtures into files (4) (#3985) 2020-09-26 10:59:27 -07:00
Pavel Feldman
cef27d620b
chore: split playwright.fixtures into files (3) (#3984) 2020-09-25 23:30:46 -07:00
Pavel Feldman
76be9540d1
chore: split playwright.fixtures into files (2) (#3983) 2020-09-25 21:43:52 -07:00
Pavel Feldman
5b9f489e55
chore: split playwright.fixtures into files (#3982) 2020-09-25 19:27:09 -07:00
Pavel Feldman
59daaab1c6
chore: roll @playwright/test-runner to 0.9.14 (#3981) 2020-09-25 17:54:50 -07:00
Pavel Feldman
6102052832
Revert "chore: don't hold sourcemap reference in prod build (#3959)" (#3979)
I like my tests showing TS source lines more!
2020-09-25 15:25:54 -07:00
Pavel Feldman
970b011cba
chore: roll @playwright/test to 0.9.6 (#3977) 2020-09-25 12:52:06 -07:00
Pavel Feldman
49bcf6efce
chore: roll test runner to 0.9.1 (#3972) 2020-09-24 13:04:09 -07:00
Yury Semikhatsky
989709b102
chore: delete unused screencast hacks (#3964) 2020-09-24 12:16:24 -07:00
Thomas Chaplin
76d08cefc2
chore(types): add return type to advancePosition (#3961) 2020-09-24 11:30:18 -07:00
Pavel Feldman
a42cd4b9aa
test: mark screencast tests as flaky until ffmpeg migation (#3968) 2020-09-24 10:45:20 -07:00
Shawn Jaques
49779d5657
Update showcase.md (#3969)
Added Root Cause OSS under tools.
2020-09-24 08:47:10 -07:00
Pavel Feldman
1bb44e4cf2
test: roll test runner to 0.3.29 (#3966) 2020-09-24 08:45:41 -07:00
Dmitry Gozman
fe41bbd303
test: enable videos on tracing bots (#3930) 2020-09-24 04:38:01 -07:00
Pavel Feldman
e15ac44ead
test: roll test runner to 0.3.25 (#3965) 2020-09-23 23:30:05 -07:00
Max Schmitt
6d5ab534d9
chore: don't hold sourcemap reference in prod build (#3959) 2020-09-23 22:19:45 -07:00
Max Schmitt
967f3b7505
devops(docker): push focal images to CR (#3950)
This will end up in the following Docker tags:
- focal <- new
- bionic < old as before
- latest <- old as before, keep bionic for now until EOL is reached
- v1.4 <- old as before, is bionic
- v1.4-focal <- new, is focal

Depends on https://github.com/aslushnikov/devops.aslushnikov.com/pull/3 to ensure it works.
Relates to https://github.com/microsoft/playwright/issues/3791.
2020-09-23 15:10:43 -07:00
Pavel Feldman
4aaf3b7596
test: roll test runner to 0.3.20 (#3963) 2020-09-23 14:52:06 -07:00
Yury Semikhatsky
1d21c1e4bd
feat(webkit): bump to 1347 (#3955) 2020-09-22 16:38:05 -07:00
Dmitry Gozman
18809b3902
fix(listeners): avoid "too many listeners" problem (#3931)
We currently spawn a process per page when recording
video in Chromium. This triggers "too many listeners" on the
process object once you have enough pages open.
2020-09-22 13:45:57 -07:00