Commit Graph

522 Commits

Author SHA1 Message Date
Andrey Lushnikov
04fbbd7cf0
fix(network): relax request matching heuristic (#3775)
Drop requirement for matching "origin" and "content-type" headers
in requests and request interceptions. This way javascript redirects
that use form submission start working.

Fix #3684.
2019-01-15 11:37:53 -08:00
Andrey Lushnikov
9083c111ca
fix(frames): make sure evaluation does not hang in detached iframes (#3770)
Fix #3261
2019-01-14 17:23:53 -08:00
Brian Schiller
7fabf32172 feat(executioncontext): warn on nested js handle (#3591)
ExecutionContext.evaluateHandle accepts arguments that are either
serializable, or JSHandles. A potential confusion is that it *does not*
accept arguments that *contain* JSHandles.

This patch adds a log message warning when it encounters that situation.

Fixes #3562
2019-01-14 14:30:50 -08:00
Andrey Lushnikov
d346cb57b4
chore: cleanup puppeteer.connect({browserURL}) (#3766)
This patch:
- renames `browserUrl` into `browserURL`
- cleans up some code
- adds tests for error handling

References #3537
2019-01-14 14:30:03 -08:00
Łukasz Fiszer
15af75f9a2 feat(launcher): add browserUrl option to puppeteer.connect (#3558)
The `browserURL` option allows to connect to a browser that exposed it's remote debugging protocol on a known port.

Fixes #3537
2019-01-14 13:23:34 -08:00
Joel Einbinder
96adedf54f fix(screenshots): throw on 0x0 screenshots (#3756)
Fix #2672
2019-01-11 15:24:43 -08:00
Andrey Lushnikov
0505c81b52
test: add test for multiline waittask (#3753)
References #3723
2019-01-10 21:41:09 -08:00
Andrey Lushnikov
89fc2adff5
fix(page): consoleMessage.location() should work with workers (#3752)
This patch:
- refactors consoleMessage.location() implementation to
make it work for workers
- re-writes tests to avoid 5 second delay
2019-01-10 18:05:28 -08:00
Tom P
0c867631b0 feat(page): introduce consoleMessage.location() (#3365)
This patch adds a new consoleMessage.location() method that returns console message origins.

Fixes #3029
2019-01-10 16:51:13 -08:00
Andrey Lushnikov
16fc28bf06
test: make sure headful browser closes with beforeuload page (#3751)
This was fixed upstream at https://crrev.com/618425

Fixes #3673
2019-01-10 14:05:43 -08:00
Andrey Lushnikov
1899e7931c
feat: enable Network Service by default (#3738)
References #3471.
2019-01-09 15:47:08 -08:00
Andrey Lushnikov
3d82465f66
fix(page): fix repetitative setContent calls (#3666)
Fix #3665.
2018-12-13 13:33:42 -08:00
Andrey Lushnikov
8aaca4eb1e
feat(page): introduce "Popup" event (#3661)
This patch adds a new "popup" event for page.
"Popup" event is fired whenever page opens another page with
given opener.
2018-12-12 17:09:42 -08:00
Andrey Lushnikov
c90392bdf5
feat: introduce page.browserContext() (#3655) 2018-12-12 15:08:31 -08:00
Andrey Lushnikov
6656519560
test: split out dialog tests (#3586) 2018-11-20 20:18:57 -08:00
Andrey Lushnikov
309cbe625f
test: split out navigation tests (#3585) 2018-11-20 20:09:25 -08:00
Andrey Lushnikov
d61916b53e
test: split out evaluation tests (#3584) 2018-11-20 19:59:59 -08:00
Andrey Lushnikov
e83918987a
test: split input tests into keyboard, mouse and touchscreen (#3583) 2018-11-20 19:43:07 -08:00
Andrey Lushnikov
25f4f26851
test: extract clicking tests (#3582) 2018-11-20 19:34:57 -08:00
Andrey Lushnikov
a181bdde31
test: split out emulation tests (#3581) 2018-11-20 19:17:56 -08:00
Andrey Lushnikov
a5b1978190
test: split out waittask tests (#3580) 2018-11-20 18:57:28 -08:00
Andrey Lushnikov
e5830d1199
test: split queryselector tests into separate file (#3579) 2018-11-20 18:45:37 -08:00
Andrey Lushnikov
aa9fb82f14
test: split screenshot tests into separate file (#3578) 2018-11-20 18:32:42 -08:00
Andrey Lushnikov
927d0f443b
feat(page): support waitUntil option for page.setContent (#3557)
This patch teaches `page.setContent` to await resources in
the new document.

**NOTE**: This patch changes behavior: currently, `page.setContent`
awaits the `"domcontentloaded"` event; with this patch, we can now await
other lifecycle events, and switched default to the `"load"` event.

The change is justified since current behavior made `page.setContent`
unusable for its main designated usecases, pushing our client
to use [dataURL workaround](https://github.com/GoogleChrome/puppeteer/issues/728#issuecomment-334301491).

Fixes #728
2018-11-20 15:32:46 -08:00
Andrey Lushnikov
e2e43bc23d
fix(page): navigating 11 pages simultaneously should not throw warning (#3560)
NavigatorWatcher subscribes to Connection to get a `Disconnected` event,
causing us to hit the default max of 10 listeners constraint.

Technically we don't leak anything here and can safely bump
the maxListenersCount to Infinity.

However, we conveniently have `CDPSession`, and
can re-dispatch the event on it and keep the safety check in place.
2018-11-20 14:21:13 -08:00
Darío Kondratiuk
03d8746260 test(accessibility): Fix duplicated test (#3539) 2018-11-15 14:57:07 -08:00
Andrey Lushnikov
95a19c74bc
fix(page): dispatch errors into page (#3550)
Errors thrown on the node side of the `page.exposeFunction` callback
should be dispatched into the page.

Fixes #3549
2018-11-15 14:51:34 -08:00
Andrey Lushnikov
eb7bd9d7d3
test: setup sandbox on linux (#3530)
Drop all the `--no-sandbox` bits from tests and infrastructure. Instead, configure
Travis to enable user namespace clone.
2018-11-12 23:26:16 -08:00
Andrey Lushnikov
27ea226bbc
test: fix workers test (#3527) 2018-11-09 18:44:53 -08:00
Darío Kondratiuk
b9f2104f43 test(cookies): Remove duplicated test. (#3492)
We have the same test on line 130 https://github.com/GoogleChrome/puppeteer/blob/v1.10.0/test/cookies.spec.js#L130
2018-11-04 11:48:31 -08:00
Andrey Lushnikov
6b65407ab6
test: unflake cookie test on windows (#3489) 2018-11-02 13:23:44 -07:00
Joel Einbinder
9ba3261571 feat(accessibility): snapshot the accessibility tree (#3470)
This adds `page.accessibility.snapshot()`. It serializes and returns the accessibility tree for the page. By default, uninteresting nodes are filtered out of the snapshot.

fixes #2033
2018-11-01 18:54:51 -07:00
Andrey Lushnikov
eca3c6bed2
test(cookies): cookies from headful now work in headless (#3481)
This patch enables cookie test. The actual upstream patch
that fixed the issue:
- https://crrev.com/599696 - Headless: support cookie encryption

Fixes #921.
2018-11-01 18:51:56 -07:00
Andrey Lushnikov
3596c5f7e2
fix(page.evaluate): better function serialization (#3480)
References #1665
2018-11-01 16:43:21 -07:00
Andrey Lushnikov
3dd5c28f90
fix(pipe): dispatch "disconnected" event when browser is terminated (#3472) 2018-10-31 16:31:29 -07:00
Zeev Rosental
81edbbb58e fix(clicking): handle negative area results in computeQuadArea (#3413)
This patch fixes a case in which computeQuadArea calculates the area size correctly, but returns the area as a negative number.
This occurs when DOM.getContentQuads returns quads in a specific order.

E.g. the array: [ { x: 463, y: 68.5 },{ x: 437, y: 68.5 },{ x: 437, y: 94.5 },{ x: 463, y: 94.5 } ] will receive area size of -676.
2018-10-25 11:41:37 -07:00
Joel Einbinder
d025d1f959 fix(csscoverage): don't prematurely disable the CSS domain (#3418)
CSS stylesheets can still be parsed and added events emitted during the CSS.stopRuleUsageTracking call. It needs to be awaited before calling CSS.disable, otherwise the text content of those style sheets will be unavailable.
2018-10-16 16:55:17 -07:00
Joel Einbinder
0fd3bfb986 test(CSSCoverage): failing test when a stylesheet was recently added (#3400)
If nobody forces a layout, CSS coverage is inconsistent. This causes some flakes on the bots. The test in this PR fails 90% of the time on my local machine.
2018-10-12 13:49:59 -07:00
Joel Einbinder
6ac66c3547 feat: browser.waitForTarget (#3356)
This adds `browser.waitForTarget` and `browserContext.waitForTarget`. It also fixes a flaky test that was incorrectly expecting targets to appear instantly.
2018-10-09 14:16:53 -07:00
Andrey Lushnikov
8becb31754
test: add failing test for page.select (#3346)
References #3327.
2018-10-04 10:41:38 -07:00
Łukasz Usarz
842fee860b fix(page): full page screenshot when defaultViewport is null (#3306)
Fixes #3104
2018-09-27 10:50:21 -07:00
Andrey Lushnikov
85aca8e1a5
chore(testserver): prepare test server (#3294) 2018-09-24 12:46:39 -07:00
Andrey Lushnikov
4e48dfc7a1
feat(launcher): add experimental "transport" option to pptr.connect (#3265)
This patch:
- adds experimental "transport" option to pptr.connect
- uses "transport" option to make sure Puppeteer-Web works with
  Target.exposeDevToolsProtocol

Drive-by: add `browser.target()` to access browser target.
2018-09-20 11:55:23 -07:00
Andrey Lushnikov
5acf953104
feat(frame): introduce Frame.goto and Frame.waitForNavigation (#3276)
This patch introduces API to manage frame navigations.
As a drive-by, the `response.frame()` method is added as a shortcut
for `response.request().frame()`.

Fixes #2918.
2018-09-20 11:31:19 -07:00
Andrey Lushnikov
0b9d8a6271
feat: async stacks for all "async" public methods (#3262)
This patch traces all public async methods and wraps them
in a helper method that tags the sync stack trace.

Later on, if the method call throws an exception, we add
a captured stack trace to the original stack trace with the "--ASYNC--"
heading.

An example of a stack trace:

```
Error: net::ERR_ABORTED at http://localhost:8907/empty.html
    at navigate (/Users/lushnikov/prog/puppeteer/lib/Page.js:622:37)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  -- ASYNC --
    at Page.<anonymous> (/Users/lushnikov/prog/puppeteer/lib/helper.js:147:27)
    at fit (/Users/lushnikov/prog/puppeteer/test/page.spec.js:546:18)
    at process._tickCallback (internal/process/next_tick.js:68:7)
```
2018-09-19 13:54:58 -07:00
Andrey Lushnikov
a1a211d9e7
chore: nicer stack highlight (#3259)
Highlight part of the stack that points to where the actual
test failure happened.
2018-09-17 23:22:53 +01:00
Andrey Lushnikov
d547b9d24a
fix(browser): browser closing/disconnecting should abort navigations (#3245)
Fixes #2721.
2018-09-14 19:44:54 +01:00
Łukasz Usarz
d929f7e213 fix: set JPG background to white when omitBackground option is used (#3240)
Fixes #3234
2018-09-14 11:03:33 +01:00
Andrey Lushnikov
c644a3bbd3
test: make sure zero-width screenshots don't hang (#3214)
References #2672.
2018-09-11 19:07:57 +01:00
Andrey Lushnikov
d54c7edeae
fix(page): Page.goto should properly handle historyAPI in beforeunload (#3198)
Fixes #2764.
2018-09-05 22:59:29 +01:00