Commit Graph

387 Commits

Author SHA1 Message Date
Yury Semikhatsky
53404ad167
test: request method is overridden (#15089) 2022-06-24 16:26:12 -07:00
Dmitry Gozman
660516d22a
fix(network): make allHeaders wait until all headers are available (#15094)
fix(network): make allHeaders wait until all header are available

Before, calling `allHeaders()` from `page.on('request')` would yield
provisional headers instead.

With these changes:
- In Firefox, all headers are available immediately.
- In Chromium, all headers are available upon requestWillBeSentExtraInfo.
- In WebKit, all headers are available upon responseReceived.
- In all browsers, intercepted requests use "provisional" headers
  as all headers, since there is no network stack to change the headers.

Drive-by: migrated Chromium to `hasExtraInfo` flags that simplifies
the logic quite a bit.
2022-06-24 13:51:09 -07:00
Pavel Feldman
ae6f48c4b8
fix(route): match against updated url while chaining (#15112) 2022-06-24 10:48:16 -07:00
Dmitry Gozman
033c250f6d
fix(har): remove types/har.d.ts, update har.ts per spec (#15046)
Drive-by: typo fix in `notFound` option name.
2022-06-22 12:16:29 -07:00
Max Schmitt
d40761541f
test: update accessibility test expectations (#15029) 2022-06-22 09:20:51 +02:00
Ross Wollman
25bc4c4ac7
tests: async fallback handlers (#15027) 2022-06-21 16:53:36 -07:00
Yury Semikhatsky
f2b3491705
test: skip page-click-scroll on linux headed too (#15025) 2022-06-21 14:51:23 -07:00
Pavel Feldman
3fa5d1d8ec test(har): suppress route after failure on android & electron 2022-06-21 09:16:50 -07:00
Dmitry Gozman
e3da3ebfa4
feat(har): do not expose HAR types, remove HARResponse fulfill (#14992) 2022-06-20 15:19:54 -07:00
Pavel Feldman
e9069bef6b
fix(body): fetch body explicitly for prefetched scripts (#14941) 2022-06-16 22:07:43 -07:00
Dmitry Gozman
cdb862767f
fix(page): "load" event should fire before "waitForLoadState" resolves (#14897)
Currently, `loadstate` and `load` are two separate events in the protocol,
and are fired in this order. As a result, `waitForLoadState()` sometimes
resolves before the `'load'` event is fired, which is unexpected.

Also fixes a flaky test that assumed `load` event comes after `domcontentloaded`
for the empty page, which is not always a case in Chromium.
2022-06-16 09:35:53 -07:00
Yury Semikhatsky
c349c1d57f
feat: newContext.har (#14892)
Replaced {Page,BrowserContext}.(un)routeFromHar with browser.newContext.har.
2022-06-15 16:35:44 -07:00
Pavel Feldman
225ab68d1c
fix(test): fix the route test (#14890) 2022-06-15 16:15:45 -07:00
Yury Semikhatsky
259c8d64a5
feat: Page.routeFromHar (#14870) 2022-06-15 08:41:46 -07:00
Yury Semikhatsky
e00a26a11d
feat(route): fulfill with HARResponse (#14865) 2022-06-14 15:07:22 -07:00
Pavel Feldman
9cf068ad06
feat(fallback): allow falling back w/ overrides (#14849) 2022-06-13 17:56:16 -07:00
Pavel Feldman
dcdd3c3cdb
feat(route): explicitly fall back to the next handler (#14834) 2022-06-13 12:30:51 -07:00
Max Schmitt
e23960e8b2 test: make Electron bots green 2022-06-13 12:20:57 +02:00
Pavel Feldman
c7b3f4646f
fix(strict): escape css class names when generating selectors (#14810) 2022-06-12 09:39:30 -07:00
Dmitry Gozman
7c0bff15ca
feat(fulfill): improve fulfilling from har (#14789)
- `har` option is now an object `{ path, fallback }`.
- Allows falling back to `abort()`, `continue()` or throwing.
- Matches based on url + method.
- Follows redirects in the HAR file.
- Nice error/stack when throwing.
- Tests.
2022-06-10 14:26:45 -07:00
Pavel Feldman
7a568a2952
feat(route): chain routes (#14771) 2022-06-10 09:06:39 -07:00
Playwright Service
a98394033c
feat(chromium-tip-of-tree): roll to r1014 (#14742)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-06-10 15:59:49 +02:00
Dmitry Gozman
652ec2f1fa test: split accname, fix select preventing context closure 2022-06-09 13:58:22 -07:00
Yury Semikhatsky
7ce17a97b1
test: capture canvas changes test passes after last roll (#14760) 2022-06-09 13:55:46 -07:00
Max Schmitt
98c34ac270 test: make Android green 2022-06-09 22:53:37 +02:00
Pavel Feldman
0711a8b169 test(ff): narrow down bounding box skips 2022-06-09 13:47:58 -07:00
Pavel Feldman
211fae295f test(electron): skip fromServiceWorker 2022-06-09 13:40:42 -07:00
Pavel Feldman
833d332fa3
test(ff): fix headed tests (#14764) 2022-06-09 12:56:07 -07:00
Max Schmitt
b4c8db68d2
test: fix electron tests (#14744) 2022-06-09 14:54:51 +02:00
Dmitry Gozman
e975aef961
feat(route): fulfill from har (#14720)
feat(route): fulfill from har

This allows to use pre-recorded HAR file to fulfill routes.
2022-06-08 20:29:03 -07:00
Pavel Feldman
067d5ac81a test(electron): revert bogus fix 2022-06-09 01:33:11 -08:00
Pavel Feldman
13762c82f9
tests: nuke the failing/flaky test (#14724) 2022-06-08 17:21:19 -08:00
Max Schmitt
de22c9341e
test: skip test on electron to make it green (#14722) 2022-06-09 00:48:54 +02:00
Pavel Feldman
48ab172bda
tests(fixit): garden win/webkit/input tests (#14721)
Bumping images to 300+ to work around the non-sensible minimal size.
2022-06-08 14:13:39 -08:00
Ross Wollman
fccee89b41
feat: add Response.fromServiceWorker flag (#14715)
Resolves #14666.

Relates #1090.
Supercedes #14321.
2022-06-08 17:34:19 -04:00
Dmitry Gozman
fdcdd58d7f
feat(har): introduce urlFilter (#14693)
This is a glob or regex pattern that filters entries recorder in the HAR.
2022-06-07 18:09:47 -07:00
Yury Semikhatsky
7596379e63
test: intercept multipart request body (#14630) 2022-06-07 09:00:51 -07:00
Dmitry Gozman
94a0d669b6
browser(firefox): expose Response.fromServiceWorker (#14606)
This property is "true" when network response was fulfilled
by the service worker.
2022-06-02 17:16:19 -07:00
Andrey Lushnikov
e185082a47
tests: mark failing android tests (#14542) 2022-06-02 04:34:05 -07:00
Yury Semikhatsky
abced7223c
fix: filechooser interception in OOPIFs (#14432) 2022-05-27 13:04:58 -07:00
Pavel Feldman
8c17704244 fix(edge): improve the anchor test 2022-05-24 11:39:37 -07:00
Pavel Feldman
a1324bd935
fix(route): support route w/ async handler & times (#14317) 2022-05-21 21:55:46 -07:00
Ross Wollman
fbb364c1cd
fix: page.locator.focus() and page.locator(…).type(…) (#14267)
Fixes focus and blur management when `page.locator(…).focus()`  and  `page.locator(…).type(…)` are used which was regressed by 7a5b070 (#13510).

#13510 relied on an implicit assumption that this (conditional) [`blur`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L672)) call would always be followed by a call that resulted in a newly focused element via this [`focus`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L674)) call.

However, some elements are [not focusable](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area), so we were blurring incorrectly, and losing focus that we should have maintained.

Two regression tests were added that pass on the commit prior to 7a5b070e95 (and match manual testing/expectations):

* `page.locator(…).focus()`: _keeps focus on element when attempting to focus a non-focusable element_
* `page.locator(…).type(…)`: _should type repeatedly in input in shadow dom_

Additionally, a third test (_should type repeatedly in input in shadow dom_) was added to check the invariant from #13510 that states:

> This affects [contenteditable] elements, but not input elements.

and allows us to introduce the targeted fix (contenteditble check before blur) without breaking FF again.

And _should type repeatedly in contenteditable in shadow dom with nested elements_ was added to ensure the above fix works with nest contenteditble detection.

Fixes #14254.
2022-05-19 14:31:56 -07:00
Max Schmitt
57966333b5
test: skip large file upload tests on Android (#14283) 2022-05-19 18:24:20 +03:00
Max Schmitt
4af778fa46
test: fix 'should climb up to a anchor' test in Firefox (#14275) 2022-05-19 16:23:31 +03:00
Pavel Feldman
b5beeab98b
fix(click): climb the hit target hierarchy to anchor (#14235)
fix(click): climb the hit target hierarcchy to anchor
2022-05-18 10:01:34 -07:00
Dmitry Gozman
0e2855348c
feat(locators): remove layout locators (#14129) 2022-05-12 18:50:19 +01:00
Dmitry Gozman
f562058805
test: make wheel event work on different host dsf (#14123)
Turns out, different mac bots have different device scale factor.
2022-05-12 17:29:03 +01:00
Dmitry Gozman
28cd3a1c5e
test: rebaseline wheel tests according to new chromium (#14110) 2022-05-12 10:05:44 +01:00
Pavel Feldman
cf89a36181
chore: serialize circular objects (#14045) 2022-05-09 18:51:53 -07:00