1573 Commits

Author SHA1 Message Date
Pavel Feldman
db12ddebb3
chore(rpc): clear the page test spec (#2736) 2020-06-26 21:22:03 -07:00
Pavel Feldman
6393407a6a
chore(rpc): support downloads, dialogs, persistent context (#2733) 2020-06-26 17:24:21 -07:00
Dmitry Gozman
b54303a386
fix(textContent): make page.textContent(selector) atomic (#2717)
We now query selector and take textContent synchronously. This
avoids any issues with async processing: node being recycled,
detached, etc.

More methods will follow with the same atomic pattern.

Drive-by: fixed selector engine names being sometimes case-sensitive
and sometimes not.
2020-06-26 16:32:42 -07:00
Dmitry Gozman
43f70ab978
test: add more failing tests with react recycle (#2731) 2020-06-26 16:31:51 -07:00
Pavel Feldman
02f7501725
chore(rpc): strongly-type the initializer, remove __init__ phase (#2729) 2020-06-26 12:28:27 -07:00
Pavel Feldman
18d6140d3e
chore(rpc): support routes and bindings (#2725) 2020-06-26 11:51:47 -07:00
Dmitry Gozman
064a0a1154
fix(webkit): do not swallow errors when returning by value (#2723)
We currently return undefined whenever we had an error trying
return the evaluation result by error. The most common error
is "execution context destroyed".

This produces very unexpected undefined from methods that do not
ever expect undefined. Instead, we should throw because we were
not able to return the result.
2020-06-26 09:50:57 -07:00
Pavel Feldman
71618a9e2b
chore(rpc): implement input, a11y, console (#2722) 2020-06-25 18:01:18 -07:00
Dmitry Gozman
ab6a6c9b82
chore: run most actions through page._runAbortableTask (#2721)
This introduces a single place for future snapshots.
2020-06-25 16:57:21 -07:00
Pavel Feldman
bab6833232
chore: introduce the experimental rpc implementation (#2720) 2020-06-25 16:05:36 -07:00
Dmitry Gozman
5d5cf26a0e
fix(logs): streaming logs from InjectedScriptPoll without exception (#2712)
We used to get undefined messages, because we were mistakenly
fulfilling the logs multiple times.
2020-06-25 13:13:10 -07:00
Dmitry Gozman
807dc1f324
fix(crash): improve documentation for crash, reject waitForEvent (#2694) 2020-06-25 09:53:56 -07:00
Pavel Feldman
bc3050776e
chore: prepare library types for rpc (#2706) 2020-06-25 08:30:56 -07:00
Dmitry Gozman
f111974ad6
chore: prepare parsed selectors to more tasks (#2696)
We currently have dispatchEventTask and waitForSelectorTask.
However, most selector-based operations make sense as tasks, to ensure
atomic execution, e.g. textContent(selector) or focus(selector).
This will fight hydration, elements recycling and other async issues.

In preparation, decouple tasks from selectors parsing so that
we can have common infrastructure for tasks.
2020-06-24 17:03:28 -07:00
Dmitry Gozman
39ce35e154
fix(errors): strict error handling around element operations (#2567)
- Gave all possible dom errors distinct names, and throw them on the node side.
- Separated errors into FatalDOMError and RetargetableDOMError.
  Fatal errors are unrecoverable. Retargetable errors
  could be resolved by requerying the selector.
- This exposed a number of unhandled 'notconnected' cases.
- Added helper functions to handle errors and ensure TypeScript catches
  unhandled ones.
2020-06-24 15:12:17 -07:00
Dmitry Gozman
355305d31d
feat(screenshot): accept timeout, migrate to Progress, wait for visible (#2679)
Element screenshot now waits for the element to become visible and
throws on detach.

Both screenshot methods accept a timeout and capture logs using Progress.
Also, carefully handling exceptions and restoring the viewport.
2020-06-24 10:16:54 -07:00
Pavel Feldman
fca514d74e
chore: move non-trivial types out of types.ts (#2680) 2020-06-23 14:51:06 -07:00
Dmitry Gozman
d0a6e1a64e
fix(dom): make selectText and scrollIntoViewIfNeeded wait for visible (#2628)
All other methods wait for the element to be visible, so we should make
them behave similarly.
2020-06-23 13:02:31 -07:00
Joel Einbinder
9000ccb3b2
fix(click): don't timeout when innerWidth is modified (#2669)
We were evaluating `innerWidth` in the main context, where it could be modified.
2020-06-22 14:03:31 -07:00
Pavel Feldman
eac7dab8b7
fix(cors): allow intercepting cors requests on chromium (#2643) 2020-06-19 17:14:32 -07:00
Dmitry Gozman
d0336ea5c2
fix(network): disallow intercepting redirects (#2617)
WebKit and Firefox are only able to continue redirects.
Firefox is faking it on the backend, so you can't even stall it.

Instead, we just do not fire routes for redirects on all browsers,
to avoid surprises.
2020-06-18 17:15:47 -07:00
Joel Einbinder
b88fabab13
test: add another test for browserContext.addInitScript (#2285) 2020-06-18 12:27:48 -07:00
Mike Tobia
63924d9a26
feat(install/download-hosts): allow multiple per browser (#2452)
In addition to `PLAYWRIGHT_DOWNLOAD_HOST` env variable, this patch adds a per-browser 
configuration:

- `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`
- `PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST`
- `PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST`
2020-06-18 11:20:43 -07:00
Dmitry Gozman
971bd88922
fix(chromium): do not bring page to front before screenshot (#2614) 2020-06-18 10:52:08 -07:00
Dmitry Gozman
f581e84829
fix(css selector): handle missing spaces between [] and > (#2612) 2020-06-17 23:20:12 -07:00
Dmitry Gozman
f9633ea9b7
fix(scrollIntoView): ensure similar behavior across browsers, handle errors (#2599) 2020-06-17 10:48:07 -07:00
Pavel Feldman
277d50e39c
feat(webkit): roll WebKit to 1286 - interception (#2601) 2020-06-17 08:34:42 -07:00
Pavel Feldman
c220fc7f46
chore(logs): rework logs for simplicity (#2592) 2020-06-16 17:11:19 -07:00
Pavel Feldman
59d0f8728d
test(recorder): add recorder sanity tests (#2582) 2020-06-16 10:15:08 -07:00
Pavel Feldman
1c7a8952b9
chore(cli): add recording mode (#2579) 2020-06-15 15:27:03 -07:00
Pavel Feldman
f2c47b1d33
feat(cli): introduce basic playwright CLI tool (#2571) 2020-06-14 17:24:45 -07:00
Pavel Feldman
61b11252b4
chore(debug): various debug mode improvements (#2561) 2020-06-13 13:17:12 -07:00
Dmitry Gozman
d4c466868b
chore: explicitly plumb various errors through the retries (#2554)
We are about to have more errors, so explicit plumbing helps with visibility.
2020-06-12 14:59:26 -07:00
Dmitry Gozman
c4e8720eb5
feat(debug): generate preview for ElementHandle (#2549)
This is a best-effort debugging feature - we try to generate preview asynchronously,
so it might not be available immediately.
2020-06-12 11:10:18 -07:00
Dmitry Gozman
1bf9e65ef5
fix(log): include log name in progress recording (#2550) 2020-06-12 09:48:56 -07:00
Pavel Feldman
894826dec0
chore: form the debug script for authoring hints / helpers (#2551) 2020-06-11 18:18:33 -07:00
Dmitry Gozman
7ddf66418a
test: add a failing test with React rerender (#2545) 2020-06-11 15:19:35 -07:00
Pavel Feldman
e287f19493
feat(debug): add basic recording helper infra (#2533) 2020-06-11 11:42:52 -07:00
Dmitry Gozman
5e97acde0c
fix(oopif): make Page.addInitScript and Page.exposeBinding work for oopifs (#2542) 2020-06-11 11:41:36 -07:00
Pavel Feldman
17433d1881
chore: verify launch options (#2530) 2020-06-10 20:48:54 -07:00
Andrey Lushnikov
89d1b52f43
chore: revert atomic install (#2534)
This reverts 2 commits:

- "fix(installer): create tmp directory inside `browserPath` (#2498)"
  commit 946b4efa3b55dd96396b1c34f1f159735beaaaea.

- "feat: support atomic installation of browsers (#2489)"
  commit 3de0c087bcc2592ae9fa65a79a29129e2b153e06.

This addresses installation issues we see in some CI environments.
2020-06-10 18:49:03 -07:00
Dmitry Gozman
c99f0d1f98
feat(debug): more logs while waiting for stable, enabled, etc. (#2531) 2020-06-10 18:45:18 -07:00
Pavel Feldman
903de2582a
chore(websocket): extract common socket part (#2506) 2020-06-10 16:33:27 -07:00
Dmitry Gozman
1bb33650b0
chore: remove ExtendedEventEmitter and inline waitForEvent (#2529) 2020-06-10 15:12:50 -07:00
Pavel Feldman
8ee19d53e7
feature(webkit): roll WebKit to 1273 (#2514) 2020-06-10 13:36:45 -07:00
Darío Kondratiuk
e3f34f6ae2
fix(selectOption): allow passing null to unselect all (#2405) 2020-06-10 09:37:29 -07:00
Dmitry Gozman
4d069dda0f
feat: avoid side effects after progress aborts (#2518)
Actions like click, focus or polling now avoid doing any work
with side-effects after their progress has been aborted.
2020-06-09 18:57:11 -07:00
Dmitry Gozman
80705ff5e9
chore: simplify logging a bit (#2512)
This merges a few classes and stops inheriting from InnerLogger.
2020-06-09 16:11:17 -07:00
Pavel Feldman
9aa9d6bc1d
feat(downloads): accept downloads in persistent, allow specifying the downloadsPath (#2503) 2020-06-08 21:45:35 -07:00
Dmitry Gozman
55cfff38c6
fix(waitForFunction): handle predicate that throws (#2488)
Currently, we fail when the predicate throws on the first call,
and timeout when it fails on any other call.

There are two possible ways to handle throwing predicates:
- Fail waitForFunction if predicate throws once. This is good
  since it gives you the error faster.
- Tolerate predicate exceptions. This is good because you do
  not have to worry about non-initialized state during load.

This change implements the former.
2020-06-08 16:29:29 -07:00