Node updated. Some todos.

This commit is contained in:
Norm Rasmussen
2024-09-23 20:52:09 -04:00
parent 8bfaca8375
commit f25622067f
2041 changed files with 124145 additions and 110445 deletions

View File

@ -8,8 +8,6 @@
![Pre-commit](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/pre-commit.yml/badge.svg)
[![codecov](https://codecov.io/gh/GoogleChromeLabs/chromium-bidi/branch/main/graph/badge.svg?token=LJSXSC9L09)](https://codecov.io/gh/GoogleChromeLabs/chromium-bidi)
This is an implementation of the
[WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) protocol with some
extensions (**BiDi+**)
@ -28,7 +26,7 @@ at [WPT WebDriver BiDi status](https://wpt.fyi/results/webdriver/tests/bidi).
```cddl
CdpSendCommandCommand = {
method: "cdp.sendCommand",
params: ScriptEvaluateParameters,
params: CdpSendCommandParameters,
}
CdpSendCommandParameters = {
@ -51,8 +49,8 @@ and returns the result.
```cddl
CdpGetSessionCommand = {
method: "cdp.sendCommand",
params: ScriptEvaluateParameters,
method: "cdp.getSession",
params: CdpGetSessionParameters,
}
CdpGetSessionParameters = {
@ -66,6 +64,25 @@ CdpGetSessionResult = {
The command returns the default CDP session for the selected browsing context.
### Command `cdp.resolveRealm`
```cddl
CdpResolveRealmCommand = {
method: "cdp.resolveRealm",
params: CdpResolveRealmParameters,
}
CdpResolveRealmParameters = {
realm: Script.Realm,
}
CdpResolveRealmResult = {
executionContextId: text,
}
```
The command returns resolves a BiDi realm to its CDP execution context ID.
### Events `cdp`
```cddl
@ -184,21 +201,14 @@ Use the `DEBUG_DEPTH` (default: `10`) environment variable to see debug deeply n
DEBUG_DEPTH=100 DEBUG=* npm run server
```
Use the CLI argument `--headless=false` to run browser in headful mode:
```sh
npm run server -- --headless=false
```
Use the `CHANNEL=...` environment variable or `--channel=...` argument with one of
the following values to run the specific Chrome channel: `stable`,
`beta`, `canary`, `dev`.
The requested Chrome version should be installed.
Use the `CHANNEL=...` environment variable with one of the following values to run
the specific Chrome channel: `stable`, `beta`, `canary`, `dev`, `local`. Default is
`local`. The `local` channel means the pinned in `.browser` Chrome version will be
downloaded if it is not yet in cache. Otherwise, the requested Chrome version should
be installed.
```sh
CHANNEL=dev npm run server
npm run server -- --channel=dev
```
Use the CLI argument `--verbose` to have CDP events printed to the console. Note: you have to enable debugging output `bidi:mapper:debug:*` as well.
@ -260,9 +270,24 @@ The E2E tests require BiDi server running on the same host. By default, tests
try to connect to the port `8080`. The server can be run from the project root:
```sh
npm run e2e # alias to to e2e-headless
npm run e2e-headful
npm run e2e-headless
npm run e2e # alias to to e2e:headless
npm run e2e:headful
npm run e2e:headless
```
This commands will run `./tools/run-e2e.mjs`, which will log the PyTest output to console,
Additionally the output is also recorded under `./logs/<DATE>.e2e.log`, this will contain
both the PyTest logs and in the event of `FAILED` test all the Chromium-BiDi logs.
If you need to see the logs for all test run the command with `VERBOSE=true`.
Simply pass `npm run e2e -- tests/<PathOrFile>` and the e2e will run only the selected one.
You run a specific test by running `npm run e2e -- -k <TestName>`.
Use `CHROMEDRIVER` environment to run tests in `chromedriver` instead of NodeJS runner:
```shell
CHROMEDRIVER=true npm run e2e
```
Use the `PORT` environment variable to connect to another port:
@ -271,6 +296,13 @@ Use the `PORT` environment variable to connect to another port:
PORT=8081 npm run e2e
```
Use the `HEADLESS` to run the tests in headless (new or old) or headful modes.
Values: `new`, `old`, `false`, default: `new`.
```sh
HEADLESS=new npm run e2e
```
#### Updating snapshots
```sh
@ -420,6 +452,43 @@ new command, add it to `_processCommand`, write and call processor for it.
### Publish new `npm` release
#### Release branches
`chromium-bidi` maintains release branches corresponding to Chrome releases. The
branches are named using the following pattern: `releases/m$MAJOR_VERSION`.
The new release branch is created as soon a new major browser version is
published by the
[update-browser-version](https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/.github/workflows/update-browser-version.yml)
job:
- the PR created by this job should be marked as a feature and it should cause the
major package version to be bumped.
- once the browser version is bumped, the commit preceding the version bump
should be used to create a release branch for major version pinned before the bump.
Changes that need to be cherry-picked into the release branch should be marked
as patches. Either major or minor version bumps are not allowed on the release
branch.
Example workflow:
```mermaid
gitGraph
commit id: "feat: featA"
commit id: "release: v0.5.0"
branch release/m129
checkout main
commit id: "feat: roll Chrome to M130 from 129"
commit id: "release: v0.6.0"
commit id: "fix: for m129"
checkout release/m129
cherry-pick id: "fix: for m129"
commit id: "release: v0.5.1 "
```
Currently, the releases from release branches are not automated.
#### Automatic release
We use [release-please](https://github.com/googleapis/release-please) to automate releases. When a release should be done, check for the release PR in our [pull requests](https://github.com/GoogleChromeLabs/chromium-bidi/pulls) and merge it.
@ -453,8 +522,7 @@ Otherwise submit an issue for a project maintainer.
2. Update the mapper version:
```shell
third_party/bidimapper/pull.sh
third_party/bidimapper/build.sh
third_party/bidimapper/roll_bidmapper
```
3. Submit a CL with bug `chromedriver:4226`.