Commit Graph

860 Commits

Author SHA1 Message Date
Pavel Feldman
c25fc4956d
chore(rpc): scope client-side handles (#2796) 2020-07-01 13:55:29 -07:00
Pavel Feldman
e467ea57e7
revert: testrunner: make environment a simple class (#2769) (#2790) 2020-07-01 10:56:19 -07:00
Joel Einbinder
e480ec3f59
feat(chromium): roll to r782078 (#2714)
Highlights:
- [Remove support for (prefers-color-scheme: no-preference).
](ed6b36f0b4)
- [DevTools: Add commands option to Input.dispatchKeyEvent
](3d3ee67f69)

#1067
2020-07-01 07:26:08 -07:00
Pavel Feldman
95538e73e7
chore(rpc): move classes around, fix tests, respect dispatcher scopes (#2784) 2020-06-30 22:21:17 -07:00
Pavel Feldman
87516cb3a3
chore(rpc): make dispatcher creation and lookup explicit (#2783) 2020-06-30 21:30:39 -07:00
Andrey Lushnikov
1605cb453c
testrunner: make environment a simple class (#2769)
This patch:
- makes environment a simple class with optional methods `beforeEach`, `afterEach`, `beforeAll`, `afterAll`, `globalSetup` and `globalTeardown`
- removes capability to have multiple hooks of the same name inside suite
- removes default environment for test. (`dit` now adds a `TraceTestEnvironment` to the test)
- extracts all environments that we use in our tests in `//test/environments.js`

Downsides:
- we no longer know hook locations for the environments. This, however, should not be a big deal since stack traces (if any) will still point into it.
- this also regresses hook locations for suites for simplicity. We can get them back, but it shouldn't be pressing since we now have only one hook of each kind in every suite.
2020-06-30 16:51:03 -07:00
Pavel Feldman
e29f7b9f58
chore(rpc): support workers, file chooser, browser server (#2766) 2020-06-30 10:55:11 -07:00
Pavel Feldman
5bb018e0e5
chore(rpc): attribute calles to page, ignore USES_HOOKS (#2764) 2020-06-29 18:58:09 -07:00
Dmitry Gozman
38236b4f29
fix(close): ensure close() can be called twice (#2744)
... without any exceptions.
2020-06-29 16:26:32 -07:00
Dmitry Gozman
1fa9d30992
fix(evaluate): awaitPromise when Promise is overwritten (#2759)
Firefox and WebKit require native promises to provide awaitPromise
functionality. When the Promise is overwritten, all evaluations
in the main world produce wrong Promise, so we wrap with async
function to get a native promise instead.
2020-06-29 16:25:52 -07:00
Dmitry Gozman
18f9b4a219
test: add failing test for navigation corner cases (#2746) 2020-06-29 10:39:03 -07:00
Pavel Feldman
e920fde9f7
chore(rpc): bootstrap demo for rpc (#2741) 2020-06-27 11:32:27 -07:00
Pavel Feldman
db12ddebb3
chore(rpc): clear the page test spec (#2736) 2020-06-26 21:22:03 -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
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
807dc1f324
fix(crash): improve documentation for crash, reject waitForEvent (#2694) 2020-06-25 09:53:56 -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
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
Yury Semikhatsky
2251f9bedb
feat(webkit): bump to 1290 (#2652) 2020-06-19 16:35:14 -07:00
Dmitry Gozman
53f7f4e4e7
test: add redirect+extraHTTPHeaders test (#2637) 2020-06-18 18:06:10 -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
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
Pavel Feldman
cc84506cbb
feat(electron): add a test for clipboard access (#2606) 2020-06-17 14:16:17 -07:00
Dmitry Gozman
4834e5653d
fix(firefox): bump firefox and fix network with service worker (#2610) 2020-06-17 14:13:56 -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
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
Dmitry Gozman
98544381b2
test: disable flaky cookie test on Chromium Win (#2562) 2020-06-12 15:03:30 -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
39019e8863
test: unflake interception test (#2558) 2020-06-12 12:13:17 -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
defeeb9cee
test: await all promises in upload test (#2557)
Otherwise, we get unhandled promise rejection sometimes.
2020-06-12 10:39:33 -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
Dmitry Gozman
5e97acde0c
fix(oopif): make Page.addInitScript and Page.exposeBinding work for oopifs (#2542) 2020-06-11 11:41:36 -07:00
Dmitry Gozman
c99f0d1f98
feat(debug): more logs while waiting for stable, enabled, etc. (#2531) 2020-06-10 18:45:18 -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
4faa1306b9
test: dump all logs in DEBUGP mode (#2517) 2020-06-09 18:55:57 -07:00