Commit Graph

17 Commits

Author SHA1 Message Date
Alex Rudenko
7eaadafe19
feat: add waitForXPath to ElementHandle (#8329) 2022-05-10 12:45:20 +02:00
Alex Rudenko
c03429444d
feat: implement Element.waitForSelector (#7825)
Co-authored-by: Johan Bay <jobay@google.com>
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2021-12-09 11:51:14 +00:00
Henrik Skupin
4c3caaa3f9
chore: re-enable tests for Firefox related to fixed Input.dispatchMouseEvent issues (#7776)
Issues: #7115
2021-11-19 08:50:31 +01:00
Ron0115
54c4318016
feat: add threshold to Page.isIntersectingViewport (#6497) 2021-09-15 22:56:50 +02:00
Paul Adams
af2b5fca12
chore: clarify error message when node is not clickable (#6949) 2021-09-14 16:38:58 +00:00
Jack Franklin
523aa0aafa
chore: upgrade and pin prettier dependencies (#7232)
We're seeing odd failures with Prettier on some CI branches; my hunch is that they are installing different versions of the package and therefore getting formatting conflicts. This PR updates them all and pins them to specific versions - something we should probably consider generally, or remove our `package-lock.json` from the gitignore.
2021-05-12 16:48:30 +02:00
Jan Scheffler
8126101980
chore: disable flaky test on Firefox (#7207) 2021-05-05 12:21:14 +00:00
Johan Bay
729cdfe98a
chore: mark version v5.4.0 (#6542) 2020-10-23 16:28:38 +02:00
Jack Franklin
f04bec5a15
chore: update eslint & eslint plugins (#6487)
Updates ESLint, the TypeScript ESLint plugins, and updates code where
the rules have changed.
2020-10-12 10:30:35 +01:00
Jack Franklin
21552f8fe7
feat: page.waitForTimeout (#6268) 2020-07-28 10:37:49 +02:00
Johan Bay
e89e264a16
feat(chromium): roll Chromium to r782078 (#6250)
This corresponds to Chromium 85.0.4182.0.

This roll includes: 
- Enable SameSiteByDefaultCookies and CookiesWithoutSameSiteMustBeSecure
   https://crrev.com/c/2231445
- [FlexNG] Enable FlexNG by default
   https://crrev.com/c/2216595

Closes #6151.
2020-07-20 17:17:06 +02:00
Johan Bay
313774c553
feat: change QueryHandler to contain QueryOne and QueryAll methods (#6218)
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2020-07-17 07:29:42 +02:00
Jack Franklin
f1a6b8d66d
chore: vendor Mitt & update project structure (#6209)
* chore: vendor Mitt into src/common/third-party

As discussed in #6203 we need to vendor our common dependencies in so
that when we ship an ESM build all imports point to file paths and do
not rely on Node resolution (e.g. a browser does not understand `import
mitt from 'mitt'`).
2020-07-14 16:57:29 +01:00
Jack Franklin
ffec2475d0
chore: enforce file extensions on imports (#6202)
* chore: enforce file extensions on imports

To make our output agnostic it should include file extensions in the
output, as per the ESM spec. It's a bit odd for Node packages but makes
it easier to publish a browser build.
2020-07-13 10:22:26 +01:00
Jack Franklin
9b3005c105
feat(types): improve page.evaluate types (#6193) 2020-07-10 11:52:13 +01:00
Jack Franklin
8370ec88ae
feat(types): add (and fix) evaluateHandle types (#6130)
This change started as a small change to pull types from DefinitelyTyped over to
Puppeteer for the `evaluateHandle` function but instead ended up also fixing
what looks to be a long standing issue with our existing documentation.

`evaluateHandle` can in fact return an `ElementHandle` rather than a `JSHandle`.
Note that `ElementHandle` extends `JSHandle` so whilst the docs are technically
correct (all ElementHandles are JSHandles) it's confusing because JSHandles
don't have methods like `click` on them, but ElementHandles do.

if you return something that is an HTML element:

```
const button = page.evaluateHandle(() => document.querySelector('button'));
// this is an ElementHandle, not a JSHandle
```

Therefore I've updated the original docs and added a large explanation to the
TSDoc for `page.evaluateHandle`.

In TypeScript land we'll assume the function will return a `JSHandle` but you
can tell TS otherwise via the generic argument, which can only be `JSHandle`
(the default) or `ElementHandle`:

```
const button = page.evaluateHandle<ElementHandle>(() => document.querySelector('button'));
```
2020-07-01 12:44:08 +01:00
Jack Franklin
28797dee41
chore: migrate tests to TypeScript (#6075)
This CL migrates all the tests to TypeScript. The main benefits of this is that we start consuming our TypeScript definitions and therefore find errors in them. The act of migrating found some bugs in our definitions and now we can be sure to avoid them going forwards.

You'll notice the addition of some `TODO`s in the code; I didn't want this CL to get any bigger than it already is but I intend to follow those up once this lands. It's mostly figuring out how to extend the `expect` types with our `toBeGolden` helpers and some other slight confusions with types that the tests exposed.

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2020-06-23 07:18:46 +02:00