1573 Commits

Author SHA1 Message Date
Andrey Lushnikov
946b4efa3b
fix(installer): create tmp directory inside browserPath (#2498)
`fs.rename` doesn't work across partitions, so we have to have
tmp folder next to our final destination.

Fixes #2494
2020-06-08 12:11:16 -07:00
Dmitry Gozman
bb4e959d2d
feat(debug): add note about DEBUG=pw:api to errors (#2496) 2020-06-08 11:41:09 -07:00
Dmitry Gozman
5c3a275270
feat(debug): improve api logs (#2481) 2020-06-06 20:59:06 -07:00
Andrey Lushnikov
3de0c087bc
feat: support atomic installation of browsers (#2489)
Currently, Ctrl-C while extracting browser might yield users in
a bad place.

This patch extracts browsers in a temp directory that is later
moved to a installer registry.
2020-06-05 16:26:32 -07:00
Dmitry Gozman
3ec79e17fc
chore: simplify timeout handling in progress (#2487) 2020-06-05 15:53:30 -07:00
Dmitry Gozman
300099734c
chore: migrate waitForEvent to Progress (#2483)
Drive-by: remove/simplify some helper code.
2020-06-05 14:14:19 -07:00
Pavel Feldman
fb058ffe0d
feat(proxy): allow specifying proxy (#2485) 2020-06-05 13:50:15 -07:00
Dmitry Gozman
87e0c96ef2
chore: inverse FrameTask callbacks/promises (#2478)
Alternative way to handle this indirection.
2020-06-05 10:06:59 -07:00
Dmitry Gozman
c08da50bb3
chore: introduce session.sendMayFail to ease error logging (#2480) 2020-06-05 07:50:26 -07:00
Dmitry Gozman
1d37a10558
chore: migrate navigations to Progress (#2463) 2020-06-04 16:43:48 -07:00
Dmitry Gozman
724d73c03b
feat(debug): chromium debugging port (#2246)
This exposes Chromium remote debugging pipe under the port PLAYWRIGHT_CHROMIUM_DEBUG_PORT.
2020-06-04 16:40:07 -07:00
Dmitry Gozman
d5c992e1db
chore: unify evaluations across browsers even more (#2459)
This moves all the logic around UtilityScript to javascript.ts.
Also uncovers a bug in WebKit where we cannot returnByValue after navigation.
2020-06-03 17:50:16 -07:00
Dmitry Gozman
8e6375f532
chore: reduce the number of evaluate methods, improve types (#2454)
Types can now handle non-trivial tuples with handles inside.
2020-06-03 13:22:05 -07:00
Dmitry Gozman
1accb5141d
chore: convert more actions to Progress (#2444) 2020-06-03 11:23:24 -07:00
Dmitry Gozman
f188b0a174
chore: migrate most actions to Progress (#2439) 2020-06-03 09:14:53 -07:00
Dmitry Gozman
a644f0a881
feat(fill): wait for the element to be enabled/writable/visible (#2435) 2020-06-01 18:56:49 -07:00
Dmitry Gozman
bf67245de6
feat(debug): stream logs from waitForSelector (#2434)
- we can now stream logs from InjectedScriptProgress to Progress;
- waitForSelector task uses it to report intermediate elements.
2020-06-01 15:48:23 -07:00
Dmitry Gozman
454411062b
fix(oopif): race between detachedFromTarget and frameAttached (#2419)
During remote -> local transition, these two events come in unpredictable order, so we try to handle both cases. Also, remote frame detach was not handled at all.
2020-06-01 13:47:02 -07:00
Dmitry Gozman
de0bbd3031
chore: remove page pause support (#2431) 2020-06-01 11:14:16 -07:00
Dmitry Gozman
b7df4d57a4
chore: migrate wait tasks to Progress (#2422) 2020-06-01 08:54:18 -07:00
Pavel Feldman
c001facffc
feat(firefox): allow passing user prefs at launch time (#2417) 2020-05-31 09:28:57 -07:00
Dmitry Gozman
8f350e4fe6
chore: make polling in page cancelable from node (#2399)
- unifies polling timeouts with everything else,
  based on the client time instead of the server time;
- prepares polling tasks for cancellation token
  behavior.

Unfortunately, RerunnableTask had to be rewritten almost
entirely.
2020-05-30 15:00:53 -07:00
Dmitry Gozman
acf059fe00
fix(click): wait for button, input and select to be enabled before clicking (#2414) 2020-05-30 13:29:46 -07:00
Dmitry Gozman
8e4a1e7c67
fix(text selector): do not match text inside <head> (#2413)
We already skip <script> and <style> tags because they are not
the page content. Similar reasoning applies to <head> that has
content that is never rendered on the page.
2020-05-29 15:28:27 -07:00
Dmitry Gozman
d980ed7e7e
chore: introduce Progress concept (#2350)
A progress roughly corresponds to an api call. It is used:

- to collect logs related to the call;
- to handle timeout;
- to provide "cancellation token" behavior so that cancelable process can either
  early-exit with progress.throwIfCanceled() or race against it with progress.race();
- to ensure resources are disposed in the case of a failure
  with progress.cleanupWhenCanceled();
- (possibly) to log api calls if needed;
- (in the future) to augment async stacks.
2020-05-29 14:39:34 -07:00
Andrey Lushnikov
fdd48f8940
chore: remove confusing logging from registry (#2397) 2020-05-28 22:36:08 -07:00
Andrey Lushnikov
7a785ac268
fix: properly rewrite error message (#2392)
Error message is included in error's stack, so we should
re-write stack as well.

Fixes #2373
2020-05-28 16:33:31 -07:00
Dmitry Gozman
fdbd4fe197
fix(selectors): fix selector parsing for css attributes and quotes (#2389)
- css attribute selector may contain spaces;
- >> escaping inside strings was sometimes incorrect.

See added test cases for more details.
2020-05-28 14:49:39 -07:00
Andrey Lushnikov
7981e4e3da
fix: support event source type in firefox (#2390)
References #2189
2020-05-28 14:38:47 -07:00
Pavel Feldman
6620008dcb
chore: follow up to address evaluation review comments (#2380) 2020-05-27 22:19:05 -07:00
Dmitry Gozman
ece4789165
feat(debug): expose playwright object in console (#2365)
- playwright.$ and playwright.$$ to query elements;
- playwright.inspect to reveal an element;
- playwright.clear to remove highlight.
2020-05-27 22:16:54 -07:00
Dmitry Gozman
4413138cc6
fix(fill): allow to clear number input (#2376) 2020-05-27 20:01:08 -07:00
Dmitry Gozman
057ae14adc
feat: make browserServer.kill() wait for the process to exit (#2375)
This ensures we cleaned everything up.
2020-05-27 19:59:03 -07:00
Max Schmitt
9dfe9348ac
feat: Request.postDataJSON (#2368) 2020-05-27 18:43:49 -07:00
Pavel Feldman
e168fddac8
fix(evaluate): consistently serialize json values (#2377) 2020-05-27 17:19:05 -07:00
Dmitry Gozman
609bc4cfb0
chore: add stack trace utilities and tests (#2371) 2020-05-27 14:26:44 -07:00
Dmitry Gozman
1e2b46437d
feat(debug): when debugging, use zero as default timeout (#2362)
Otherwise, operations always time out while stepping in debugger.
2020-05-27 13:25:57 -07:00
Dmitry Gozman
8f0f32b5e6
chore: move debug-related code to src/debug (#2309) 2020-05-26 14:08:32 -07:00
Dmitry Gozman
27d30fe162
chore: encapsulate more launching logic in BrowserType (#2339) 2020-05-22 16:06:00 -07:00
Dmitry Gozman
aac5bf24ec
fix(popups): do not override popup size from window features (#2139)
We usually force window size from the browser context. However,
popups that have window features insist on a specific window size,
so we respect that.
2020-05-22 15:56:37 -07:00
Dmitry Gozman
e2972ad5ba
feat(click): retry when the element it outside of the viewport (#2330)
The element might get animated into the viewport.
2020-05-22 11:15:57 -07:00
Dmitry Gozman
55d47fd48f
chore: unify launching server between browser types (#2338) 2020-05-22 07:03:42 -07:00
Dmitry Gozman
3aca21c13b
chore: simplify launch routine a bit more (#2336) 2020-05-21 19:16:13 -07:00
Pavel Feldman
5ee6494032
feat(evaluate): return user-readable error from evaluate (#2329) 2020-05-21 16:00:55 -07:00
Dmitry Gozman
aae3f1e75d
feat(default context): support selected options for default context (#2177) 2020-05-21 15:13:16 -07:00
Pavel Feldman
2ede4bce12
chore: further unify launching and connection (#2320) 2020-05-21 09:43:10 -07:00
Yury Semikhatsky
9154f4b6e0
feat(webktt): explicitly enable Playwright domain on start (#2315) 2020-05-21 08:44:57 -07:00
Pavel Feldman
f9b437a49e
chore: pull common functionality into the BrowserTypeBase (#2312) 2020-05-20 16:30:04 -07:00
Pavel Feldman
aa0d844c76
chore: introduce utility script for evaluate helpers (#2306) 2020-05-20 15:55:33 -07:00
Dmitry Gozman
48440f7ed7
test: unflake fixtures test (#2313)
Drive-by: ensure we call onkill before manually exiting the process.
2020-05-20 14:58:27 -07:00