Commit Graph

30 Commits

Author SHA1 Message Date
Nikolay Vitkov
e254f746ee
chore: remove type castings (#12322) 2024-04-24 14:26:01 +02:00
jrandolf
e9f9f4c356
refactor: adopt the rest of bidi/core (#11836) 2024-02-12 16:28:21 +00:00
Nikolay Vitkov
280249ff2f
chore: flip test (#11707) 2024-01-22 10:13:53 +01:00
Nikolay Vitkov
864ebc86c9
chore: remove some instances of TS any (#11661) 2024-01-11 14:26:02 +00:00
Nikolay Vitkov
b6c5642cc9
chore: update license headers (#11563) 2024-01-03 10:11:33 +00:00
Nikolay Vitkov
0d4aab828a
chore: fix BiDi deserializer (#11264) 2023-10-30 13:02:04 +01:00
Julian Descottes
c49320ee87
test: upstream test and expectation for Firefox sync to puppeteer v21… (#10898) 2023-09-18 18:04:02 +02:00
jrandolf
f3c7499e67
chore: refactor handles to use realms (#10830) 2023-09-01 12:12:29 +00:00
jrandolf
7e74439c51
chore: enable 'return-await` (#10832) 2023-09-01 09:49:33 +02:00
jrandolf
900a1f227d
chore: turn on rulesdir/use-using (#10806) 2023-08-30 10:02:59 +00:00
jrandolf
5d34d42d15
feat: implement Locator.prototype.wait (#10629) 2023-07-25 16:43:18 +02:00
Nikolay Vitkov
de09b058ba
chore: update Prettier and other deps (#10555) 2023-07-17 10:52:54 +02:00
Nikolay Vitkov
d0d738d2fc
chore: readd browser setup hook (#10478) 2023-07-03 14:01:29 +02:00
Nikolay Vitkov
ff8529696d
ci: remove before hooks (#10431) 2023-06-21 19:41:09 +00:00
Junyan
b5a124ff73
feat: Page.removeScriptToEvaluateOnNewDocument (#10250)
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2023-05-26 07:56:45 +00:00
Nikolay Vitkov
070ee03d31
chore: network module for BiDi (#10159) 2023-05-22 14:52:31 +02:00
jrandolf
317fa732f9
feat: implement detailed errors for evaluation (#10114) 2023-05-10 10:23:29 +02:00
Nikolay Vitkov
5e79d53bd3
refactor: tests use toHaveLength and waitEvent (#10061) 2023-04-25 15:02:25 +02:00
Alex Rudenko
de86cafe3c
chore: reduce default timeout to 10s (#9906) 2023-03-24 09:35:45 +01:00
Nikolay Vitkov
3db7d55d26
chore: remove BigInt exists checks (#9744) 2023-02-24 19:26:29 +01:00
Nikolay Vitkov
eefe9583d0
chore: Add EsLint rule import/order (#9685) 2023-02-15 15:09:31 -08:00
Nikolay Vitkov
abcc1756dd
chore: Add BiDi Page.evaluate (#9609) 2023-02-02 15:14:28 +01: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
jrandolf
a238f5758d
chore: refactor JSHandle and ExecutionContext (#8773) 2022-08-11 11:45:35 +02:00
jrandolf
8100cbb295
fix: infer unioned handles (#8562) 2022-06-24 06:40:08 +00:00
jrandolf
26c3acbb07
feat!: type inference for evaluation types (#8547)
This PR greatly improves the types within Puppeteer:

- **Almost everything** is auto-deduced.
  - Parameters don't need to be specified in the function. They are deduced from the spread.
  - Return types don't need to be specified. They are deduced from the function. (More on this below)
  - Selections based on tag names correctly deduce element type, similar to TypeScript's mechanism for `getElementByTagName`.
- [**BREAKING CHANGE**] We've removed the ability to declare return types in type arguments for the following reasons:
  1. Setting them will indubitably break auto-deduction.
  2. You can just use `as ...` in TypeScript to coerce the correct type (given it makes sense).
- [**BREAKING CHANGE**] `waitFor` is officially gone.

To migrate to these changes, there are only four things you may need to change:
- If you set a return type using the `ReturnType` type parameter, remove it and use `as ...` and `HandleFor` (if necessary).
 `evaluate<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluate(a, b) => {...}, a, b)) as ReturnType`
 `evaluateHandle<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluateHandle(a, b) => {...}, a, b)) as HandleFor<ReturnType>`
- If you set any type parameters in the *parameters* of an evaluation function, remove them.  
 `evaluate(a: number, b: number) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
- If you set any type parameters in the method's declaration, remove them.
 `evaluate<(a: number, b: number) => void>((a, b) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
2022-06-23 11:29:46 +02:00
jrandolf
84712cbc28
chore: use Google's TS style guide's format config (#8542) 2022-06-22 15:25:44 +02:00
jrandolf
570087ea94
chore: use strict typing in tests (#8524)
* The testing tsconfig.json inherits from the base TS config.
  * A lot of type assertions have been inserted...a lot.
* All testing utilities have migrated to TS.
* text-diff is being replaced with diff for TS compatibility.
* ProtocolError has been added to PuppeteerErrors and PuppeteerErrors is no longer a record (it's been frozen).
* Fixes a small bug where null was an allowable media type in emulation (should be undefined).
2022-06-15 12:09:22 +02:00
jrandolf
80373f7a12
chore: use composite builds for tests (#8522) 2022-06-15 12:05:25 +02:00