Commit Graph

3113 Commits

Author SHA1 Message Date
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
Pavel Feldman
2d1cabdd3f
test: roll test runner to 0.3.18 (#3949) 2020-09-22 12:52:39 -07:00
Pavel Feldman
0e76316f82
fix(close): fix the browser.close race (#3956) 2020-09-22 12:50:39 -07:00
Yury Semikhatsky
c4a2732515
browser(webkit): another mac fix (#3948) 2020-09-21 19:03:44 -07:00
Yury Semikhatsky
ce51af0509
brower(webkit): add missing override markers (#3947) 2020-09-21 17:59:11 -07:00
Andrey Lushnikov
7925a51149
feat: support concurrent installation of browsers (#3929)
A few details on locking registry to prohibit concurrent access:
- locking is done by creating a `__dirlock` directory in the top-level
of our registry.
- since `__dirlock` directory does not match any of browser
directories, old versions of the installer will ignore it
- in case of concurrent access, installation will wait for a lock to be
released for 10 minutes, periodically trying to grab the lock. If it
fails to do so in 10 minutes, the installation will fail.

Fixes #3912
2020-09-21 16:09:11 -07:00
Yury Semikhatsky
2fbe767142
browser(webkit): roll to 09/21 (#3945) 2020-09-21 16:04:38 -07:00
Pavel Feldman
f1016c1fc1
fix(executablePath): throw unexpected platform error upon call (#3943) 2020-09-21 15:51:27 -07:00
Pavel Feldman
cd0a123e78
feat(chromium): roll to v808777 (#3942) 2020-09-21 15:51:14 -07:00
Andrey Lushnikov
ec26265359
feat(ffmpeg): roll FFMPEG to r1003 (#3944)
The r1003 build includes png encoder, image2 muxer, webm demuxer
and decoder. These will be used to split webm videos
into frame sequences.

This increases Playwright package size from 6.7MB to 7.1MB
2020-09-21 15:47:57 -07:00
Andrey Lushnikov
2693c162b8
devops(ffmpeg): compile zlib dependency that is needed for ffmpeg (#3940)
This patch adds zlib compilation that is required for ffmpeg.
2020-09-21 14:54:22 -07:00