Commit Graph

998 Commits

Author SHA1 Message Date
Alex Rudenko
31e7b608d5
chore: implement basic evaluate in BiDi (#8989)
Only the basic return values are supported.
The follow-up PRs will re-use the shared code
from the ExecutionContext and introduce Frame
in BiDi.
2022-09-21 08:10:50 +02:00
jrandolf
7efcb9ca3d
chore: remove unused code (#8977) 2022-09-19 12:48:14 +02:00
jrandolf
2a2af7134f
chore: incrementally erase cache on text change (#8961) 2022-09-15 18:48:55 +02:00
Alex Rudenko
fa084bcdcd
chore: extract CDPSession base class for easy mocking (#8950) 2022-09-15 13:50:12 +00:00
jrandolf
633e7cfdf9
feat: add text query handler (#8956) 2022-09-15 11:12:13 +00:00
jrandolf
ac9929d80f
fix!: fix bounding box visibility conditions (#8954) 2022-09-15 09:25:20 +02:00
jrandolf
7c4f41fadc
chore: use injections for wait tasks (#8943)
This PR refactors wait tasks to use injected scripts.
2022-09-15 08:22:20 +02:00
Alex Rudenko
8d5097d7f6
chore: split CI jobs to run in parallel (#8934) 2022-09-15 05:59:11 +00:00
Alex Rudenko
db28203e64 chore: support WebDriver BiDi browser instances (#8932)
This PR adds a basic support for WebDriver BiDi that currently includes only the ability to establish a connection and shutdown the browser. Therefore, the implementation is marked as internal and won't show up in the changelog as it's barely useful at the moment.

The API classes are kept as classes instead of interfaces so that clients relying on instanceof checks still work.
2022-09-15 02:15:15 +02:00
jrandolf
6fd05d963e
chore: use handle instead of globals for injection (#8946) 2022-09-13 14:06:40 +02:00
Alex Rudenko
504c7a1ae6
chore: implement custom mocha interface for the runner (#8929)
Instead of checking skipped tests in mocha-utils this PR
implements a custom mocha interface for better flexibility
when skipping tests. That should allow skipping tests without
running before and after hooks.
2022-09-09 11:12:18 +02:00
Alex Rudenko
d8830cbc55
chore: implement a test runner on top of mocha (#8866)
* chore: implement a test runner on top of mocha

This PR implements a test runner on top of mocha
that performs multiple mocha runs as defined in
TestSuites.json and compares the outcome of the runs
against TestExpectations.json. This allows us to
remove most of helpers from mocha-utils and be more
flexible when defining the test configurations.
2022-09-08 10:32:39 +00:00
Alex Rudenko
8b3caae8d1
chore: enable cookie restoration test (#8909)
Closes #4111
2022-09-07 09:42:06 +00:00
smithc
0c577b9bf8
fix: add missing code coverage ranges that span only a single character (#8911) 2022-09-07 07:10:07 +00:00
Alex Rudenko
260e428227
fix: support scale for screenshot clips (#8908)
Closes #5329
2022-09-07 05:27:40 +00:00
Alex Rudenko
a870c258bf
chore: update expectations for Firefox when evaluate fails (#8890) 2022-09-02 09:41:34 +00:00
jrandolf
6b4a99fcfa
chore: migrate addStyleTag (#8879)
* chore: remove unnecessary type signature

* chore: fix tests

* chore: migrate `addStyleTag`

* chore: fix tests

* chore: fix tests
2022-09-01 17:52:08 +02:00
jrandolf
8f11237a67
chore: migrate addScriptTag (#8878) 2022-09-01 17:09:57 +02:00
jrandolf
ae4c5ea031
chore: refactor build commands (#8874) 2022-09-01 01:05:20 +02:00
Alex Rudenko
61624d2695
chore: fix a flaky test in request interception (#8870) 2022-08-31 16:10:49 +02:00
Alex Rudenko
6e9a47a6fa
feat(chromium): roll to Chromium 106.0.5249.0 (r1036745) (#8869) 2022-08-31 15:27:59 +02:00
jrandolf
292216652b
chore: add injection framework (#8862)
* chore: add injection framework
2022-08-31 10:50:22 +02:00
jrandolf
b49e742e30
chore: make execution context frame-independent (#8845) 2022-08-25 17:38:02 +02:00
Alex Rudenko
2a0eefb99f
fix: handle service workers in extensions (#8807)
Closes #8800
2022-08-17 19:34:34 +02:00
jrandolf
51b2f0576d
chore: move Frame to Frame.ts (#8806) 2022-08-17 17:45:45 +02:00
jrandolf
bdcb748b98
chore: infrastructure for injecting scripts into DOMWorlds (#8801) 2022-08-17 14:39:41 +02:00
Alex Rudenko
3fad05d333
fix: custom sessions should not emit targetcreated events (#8788)
Closes #8787
2022-08-16 10:56:13 +00:00
jrandolf
ddbe88b887
chore: add custom rule for formatting comments (#8777) 2022-08-12 14:15:26 +02:00
Alex Rudenko
73221042db
chore: follow test:$browser[:$flavor] naming for tests + retries for Firefox (#8775) 2022-08-11 18:45:52 +00:00
jrandolf
a238f5758d
chore: refactor JSHandle and ExecutionContext (#8773) 2022-08-11 11:45:35 +02:00
Alex Rudenko
ee2540baef
fix: use targetFilter in puppeteer.launch (#8774)
Drive-by: adds Symbol.toStringTag to Target to simplify
debugging.

Closes #8772
2022-08-11 09:15:00 +00:00
Alex Rudenko
2580347b50
fix: resolve navigation flakiness (#8768)
Two main sources of flakiness addressed: 

1) we should dispose the lifecycle watcher after we waited for the navigation response (bad API? we need to refactor but I think it'd be valuable to stabilize tests first without too many changes).
2) we should wait for the navigation request's response if there is a navigation request in the watcher.

Closes #8644
2022-08-10 15:59:58 +00:00
Alex Rudenko
c23cdb73a7
fix: make sure there is a check for targets when timeout=0 (#8765)
Previously, if timeout is falsy, the targets would only
be checked if a browser-level event fires which lead to
a race: if the events arrived before waiting for a target,
the promise would never resolve.

Fixes #8763
2022-08-10 15:49:59 +02:00
Alex Rudenko
af78cc768f
chore: fix proxy-related tests (#8753) 2022-08-08 14:31:12 +00:00
Alex Rudenko
8cb5043868
fix: resolve target manager init if no existing targets detected (#8748)
Closes #8747
2022-08-06 15:35:42 +02:00
jrandolf
5cf9b4de8d
feat: use an xpath query handler (#8730) 2022-08-04 15:45:21 +02:00
Alex Rudenko
2abd772c9c feat: detect Firefox in connect() automatically (#8718)
This PR implements automatic detection of the Firefox product when the `.connect()` method is used. This partially undoes the breaking change in https://github.com/puppeteer/puppeteer/pull/8520 but it's also a breaking change on its own since we don't accept an explicit product name anymore (it does not look like it was used anyway).
2022-08-02 13:18:51 +00:00
Alex Rudenko
6f81b23728 fix: address flakiness in frame handling (#8688)
When we attach to a frame, we send a call to get
the page frame tree from CDP. Based on the tree data
we look up the parent frame if parentId is provided.
The problem is that the call to get the page frame
tree could take arbitrary time and the calls for the
parent and child frames might happen at the same time.
So the situation where the frame tree for the child frame
is resolved before the parent frame is known is fairly
common.

This PR addresses the issue by awaiting for the parent
frame id before attempting to register a child frame.
2022-08-02 13:18:47 +00:00
Alex Rudenko
2cbfdeb0ca feat: use CDP's auto-attach mechanism (#8520)
* feat: use CDP's auto-attach mechanism

In this PR, we refactor Puppeteer to make use of the CDP's auto-attach mechanism. This allows the backend to pause
new targets and give Puppeteer a chance to configure them properly. This fixes the flakiness related to dealing with
OOPIFs and should fix some other issues related to the network interception and navigations. If those are not fixed completely by this PR, the PR serves a solid base for fixing them.

Closes https://github.com/puppeteer/puppeteer/issues/8507, https://github.com/puppeteer/puppeteer/issues/7990
Unlocks https://github.com/puppeteer/puppeteer/issues/3667

BREAKING CHANGE: With Chromium, Puppeteer will now attach to page/iframe targets immediately to allow reliable configuration of targets.
2022-08-02 13:18:07 +00:00
Alex Rudenko
2abb9f0c14
fix: taking a screenshot with null viewport should be possible (#8680)
Closes #8673
2022-07-21 10:34:18 +02:00
Alex Rudenko
af08c5c903
feat: expose the page getter on Frame (#8657)
* feat: expose the page getter on Frame

Closes #8654

* test: add a test
2022-07-11 21:06:35 +02:00
Asen Bozhilov
b47f066c2c
fix(page): fix page.#scrollIntoViewIfNeeded method (#8631)
This patch fixes page.#scrollIntoViewIfNeeded, so that it works with devtools protocol.
Now it blocks the main thread and waits until the scrolling action finishes in Chrome.
Fallbacks to the old implementation if `DOM.scrollIntoViewIfNeeded` is not supported for Firefox.

Issues: #8627, #1805
2022-07-08 06:53:45 +00:00
Alex Rudenko
d0c4291995
fix: expose a RemoteObject getter (#8642)
Closes #8639
2022-07-07 13:04:28 +00:00
jrandolf
5ff205dc8b
fix: extends ElementHandle to Nodes (#8552)
* fix: extends `ElementHandle` to `Node`s (#8552)
2022-07-06 09:05:37 +02:00
jrandolf
28e236f1a6
chore: use --parallel (#8612) 2022-07-05 14:42:55 +02:00
jrandolf
32c9f3e6fb
chore: update contributing.md (#8616) 2022-07-01 16:29:21 +02:00
jrandolf
066f440ba7
feat: add documentation (#8593) 2022-07-01 11:52:39 +00:00
Levi Pesin
79e11985ba
feat: add fromSurface option to page.screenshot (#8496) 2022-06-27 12:37:37 +00:00
Alex Rudenko
329195011f
chore: fix chrome-headless ci (#8560) 2022-06-27 12:35:09 +02:00
jrandolf
7001322cd1
feat: export public types only (#8584) 2022-06-27 09:24:23 +02:00