Commit Graph

29 Commits

Author SHA1 Message Date
browser-automation-bot
4b8d20d0ed
feat: roll to Chrome 117.0.5938.62 (r1181205) (#10893)
Co-authored-by: Nikolay Vitkov <nvitkov@chromium.org>
2023-09-13 14:35:47 +00:00
jrandolf
690b1c2218
chore: use bindIsolatedHandle (#10810) 2023-09-01 15:13: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
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
Alex Rudenko
2961449391
test: misc test improvements (#10371) 2023-06-13 13:05:01 +00:00
Alex Rudenko
cf28dae775
chore: convert async describe to sync (#10238) 2023-05-24 12:08:36 +00: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
eefe9583d0
chore: Add EsLint rule import/order (#9685) 2023-02-15 15:09:31 -08:00
Nikolay Vitkov
b8ea891ab8
chore: Extract JSHandle to API (#9632) 2023-02-09 18:04:06 +01:00
Darío Kondratiuk
e3e9cc622a
fix(puppeteer-core): target interceptor is not async (#9430)
I found that the only call to `addTargetInterceptor` passes
`onAttachedToTarget` and is not async.
I also found a typo 🤓
2022-12-17 17:47:21 +00:00
jrandolf
9f4f43a28b fix!: deprecate indirect error imports (#9072) 2022-10-06 23:52:51 +02:00
jrandolf
f42336cf83
feat: separate puppeteer and puppeteer-core (#9023)
This PR moves the puppeteer source code into separate mono-repo packages:

- `puppeteer` and `puppeteer-core` are now separated into their own
packages.
- `puppeteer-core` has a new exports called `puppeteer-core/internal`
for internal usage.

Tests and various tools have been updated to accommodate the migration.
2022-10-05 14:17:03 +02: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
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
6e9a47a6fa
feat(chromium): roll to Chromium 106.0.5249.0 (r1036745) (#8869) 2022-08-31 15:27:59 +02:00
jrandolf
b49e742e30
chore: make execution context frame-independent (#8845) 2022-08-25 17:38:02 +02: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
8100cbb295
fix: infer unioned handles (#8562) 2022-06-24 06:40:08 +00:00
jrandolf
ebcb8a2760
chore: split JSHandle.ts (#8551) 2022-06-23 11:31:43 +02: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