Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (03-07-24)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 3, 2024
1 parent 24faace commit 26bdc80
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 53 deletions.
12 changes: 8 additions & 4 deletions dotnet/docs/api/class-clock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ await Clock.InstallAsync(options);

**Arguments**
- `options` `ClockInstallOptions?` *(optional)*
- `TimeInt64|Time|TimeDate` [long]? | [string]? | [Date]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-install-option-time-int-64-time-time-date"/><a href="#clock-install-option-time-int-64-time-time-date" class="list-anchor">#</a>
- `Time|TimeDate` [string]? | [Date]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-install-option-time-time-date"/><a href="#clock-install-option-time-time-date" class="list-anchor">#</a>

Time to initialize with, current system time by default.

Expand All @@ -90,7 +90,9 @@ await page.Clock.PauseAtAsync("2020-02-02");
```

**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>
- `time` [Date] | [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>

Time to pause at.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-return"/><a href="#clock-pause-at-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -152,7 +154,7 @@ await page.Clock.SetFixedTimeAsync("2020-02-02");
```

**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>
- `time` [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>

Time to be set.

Expand All @@ -176,7 +178,9 @@ await page.Clock.SetSystemTimeAsync("2020-02-02");
```

**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>
- `time` [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>

Time to be set.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-return"/><a href="#clock-set-system-time-return" class="list-anchor">#</a>
Expand Down
6 changes: 5 additions & 1 deletion java/docs/api/class-clock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ page.clock().pauseAt("2020-02-02");

**Arguments**
- `time` [long] | [String] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>

Time to pause at.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-return"/><a href="#clock-pause-at-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -156,7 +158,7 @@ page.clock().setFixedTime("2020-02-02");
**Arguments**
- `time` [long] | [String] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>

Time to be set.
Time to be set in milliseconds.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-return"/><a href="#clock-set-fixed-time-return" class="list-anchor">#</a>
Expand All @@ -179,6 +181,8 @@ page.clock().setSystemTime("2020-02-02");

**Arguments**
- `time` [long] | [String] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>

Time to be set in milliseconds.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-return"/><a href="#clock-set-system-time-return" class="list-anchor">#</a>
Expand Down
6 changes: 5 additions & 1 deletion nodejs/docs/api/class-clock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ await page.clock.pauseAt('2020-02-02');

**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>

Time to pause at.

**Returns**
- [Promise]&lt;[void]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-return"/><a href="#clock-pause-at-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -155,7 +157,7 @@ await page.clock.setFixedTime('2020-02-02');
**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>

Time to be set.
Time to be set in milliseconds.

**Returns**
- [Promise]&lt;[void]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-return"/><a href="#clock-set-fixed-time-return" class="list-anchor">#</a>
Expand All @@ -178,6 +180,8 @@ await page.clock.setSystemTime('2020-02-02');

**Arguments**
- `time` [long] | [string] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>

Time to be set in milliseconds.

**Returns**
- [Promise]&lt;[void]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-return"/><a href="#clock-set-system-time-return" class="list-anchor">#</a>
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/ci-intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
18 changes: 9 additions & 9 deletions nodejs/docs/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ trigger:
pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.45.0-jammy
container: mcr.microsoft.com/playwright:v1.45.1-jammy
steps:
- task: NodeTool@0
Expand All @@ -230,7 +230,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-jammy-development:
docker:
- image: mcr.microsoft.com/playwright:v1.45.0-jammy
- image: mcr.microsoft.com/playwright:v1.45.1-jammy
```
Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures.
Expand All @@ -253,7 +253,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](
```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:v1.45.0-jammy' } }
agent { docker { image 'mcr.microsoft.com/playwright:v1.45.1-jammy' } }
stages {
stage('e2e-tests') {
steps {
Expand All @@ -270,7 +270,7 @@ pipeline {
Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)).
```yml
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
```
### GitLab CI
Expand All @@ -283,7 +283,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
script:
...
```
Expand All @@ -298,7 +298,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
parallel: 7
script:
- npm ci
Expand All @@ -313,7 +313,7 @@ stages:
tests:
stage: test
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
parallel:
matrix:
- PROJECT: ['chromium', 'webkit']
Expand All @@ -329,7 +329,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see
```yml
steps:
- name: mcr.microsoft.com/playwright:v1.45.0-jammy
- name: mcr.microsoft.com/playwright:v1.45.1-jammy
script:
...
env:
Expand All @@ -347,7 +347,7 @@ type: docker
steps:
- name: test
image: mcr.microsoft.com/playwright:v1.45.0-jammy
image: mcr.microsoft.com/playwright:v1.45.1-jammy
commands:
- npx playwright test
```
Expand Down
16 changes: 8 additions & 8 deletions nodejs/docs/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This Docker image is intended to be used for testing and development purposes on
### Pull the image

```bash
docker pull mcr.microsoft.com/playwright:v1.45.0-jammy
docker pull mcr.microsoft.com/playwright:v1.45.1-jammy
```

### Run the image
Expand All @@ -33,15 +33,15 @@ By default, the Docker image will use the `root` user to run the browsers. This
On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers.

```bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.45.0-jammy /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.45.1-jammy /bin/bash
```

#### Crawling and scraping

On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it.

```bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.45.0-jammy /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.45.1-jammy /bin/bash
```

[`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions:
Expand Down Expand Up @@ -76,10 +76,10 @@ See [all available image tags].
We currently publish images with the following tags:
- `:next` - tip-of-tree image version based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:next-jammy` - tip-of-tree image version based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.45.0` - Playwright v1.45.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.45.0-noble` - Playwright v1.45.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.45.0-jammy` - Playwright v1.45.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.45.0-focal` - Playwright v1.45.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).
- `:v1.45.1` - Playwright v1.45.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.45.1-noble` - Playwright v1.45.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.45.1-jammy` - Playwright v1.45.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.45.1-focal` - Playwright v1.45.1 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).

:::note
It is recommended to always pin your Docker image to a specific version if possible. If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables.
Expand All @@ -103,7 +103,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers]
```Dockerfile
FROM node:20-bookworm

RUN npx -y [email protected].0 install --with-deps
RUN npx -y [email protected].1 install --with-deps
```


Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/test-annotations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ You can also filter tests in the configuration file via [testConfig.grep](/api/c

## Annotate tests

If you would like to annotate your tests with something more substantial than a tag, you can do that when declaring a test. Annotations have a `type` and a `description` for more context, and will be visible in the test report.
If you would like to annotate your tests with something more substantial than a tag, you can do that when declaring a test. Annotations have a `type` and a `description` for more context and available in reporter API. Playwright's built-in HTML reporter shows all annotations, except those where `type` starts with `_` symbol.

For example, to annotate a test with an issue url:

Expand Down
12 changes: 8 additions & 4 deletions python/docs/api/class-clock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ clock.install(**kwargs)
```

**Arguments**
- `time` [long] | [str] | [Date] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-install-option-time"/><a href="#clock-install-option-time" class="list-anchor">#</a>
- `time` [float] | [str] | [Date] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-install-option-time"/><a href="#clock-install-option-time" class="list-anchor">#</a>

Time to initialize with, current system time by default.

Expand Down Expand Up @@ -132,7 +132,9 @@ await page.clock.pause_at("2020-02-02")
</Tabs>

**Arguments**
- `time` [long] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>
- `time` [float] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-option-time"/><a href="#clock-pause-at-option-time" class="list-anchor">#</a>

Time to pause at.

**Returns**
- [NoneType]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-pause-at-return"/><a href="#clock-pause-at-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -237,7 +239,7 @@ await page.clock.set_fixed_time("2020-02-02")
</Tabs>

**Arguments**
- `time` [long] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>
- `time` [float] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-fixed-time-option-time"/><a href="#clock-set-fixed-time-option-time" class="list-anchor">#</a>

Time to be set.

Expand Down Expand Up @@ -283,7 +285,9 @@ await page.clock.set_system_time("2020-02-02")
</Tabs>

**Arguments**
- `time` [long] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>
- `time` [float] | [str] | [Date]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-option-time"/><a href="#clock-set-system-time-option-time" class="list-anchor">#</a>

Time to be set.

**Returns**
- [NoneType]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="clock-set-system-time-return"/><a href="#clock-set-system-time-return" class="list-anchor">#</a>
Expand Down
30 changes: 16 additions & 14 deletions src/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Documentation {
renderLinksInNodes(nodes, classOrMember) {
if (classOrMember instanceof Member) {
classOrMember.discouraged = classOrMember.discouraged ? this.renderLinksInText(classOrMember.discouraged, classOrMember) : undefined;
classOrMember.deprecated = classOrMember.deprecated ? this.renderLinksInText(classOrMember.deprecated, classOrMember) : undefined
classOrMember.deprecated = classOrMember.deprecated ? this.renderLinksInText(classOrMember.deprecated, classOrMember) : undefined;
}
md.visitAll(nodes, node => {
if (!node.text)
Expand Down Expand Up @@ -208,7 +208,7 @@ class Documentation {
}
}

class Class {
class Class {
/**
* @param {Metainfo} metainfo
* @param {string} name
Expand Down Expand Up @@ -322,7 +322,7 @@ class Documentation {
for (const e of this.eventsArray)
e.visit(visitor);
}
};
}

class Member {
/**
Expand All @@ -345,7 +345,7 @@ class Member {
this.spec = spec;
this.argsArray = argsArray;
this.required = required;
this.comment = '';
this.comment = '';
/** @type {!Map<string, !Member>} */
this.args = new Map();
this.index();
Expand Down Expand Up @@ -473,8 +473,10 @@ class Member {
this.type.visit(visitor);
for (const arg of this.argsArray)
arg.visit(visitor);
for (const lang in this.langs.overrides || {})
this.langs.overrides?.[lang].visit(visitor);
}
};
}

class Type {
/**
Expand Down Expand Up @@ -509,9 +511,9 @@ class Type {
* @return {Type}
*/
static fromParsedType(parsedType, inUnion = false) {
if (!inUnion && !parsedType.unionName && isStringUnion(parsedType) ) {
if (!inUnion && !parsedType.unionName && isStringUnion(parsedType))
throw new Error('Enum must have a name:\n' + JSON.stringify(parsedType, null, 2));
}


if (!inUnion && (parsedType.union || parsedType.unionName)) {
const type = new Type(parsedType.unionName || '');
Expand Down Expand Up @@ -556,15 +558,15 @@ class Type {
/** @type {Member[] | undefined} */
this.properties = this.name === 'Object' ? properties : undefined;
/** @type {Type[] | undefined} */
this.union;
this.union = undefined;
/** @type {Type[] | undefined} */
this.args;
this.args = undefined;
/** @type {Type | undefined} */
this.returnType;
this.returnType = undefined;
/** @type {Type[] | undefined} */
this.templates;
this.templates = undefined;
/** @type {string | undefined} */
this.expression;
this.expression = undefined;
}

visit(visitor) {
Expand Down Expand Up @@ -645,7 +647,7 @@ class Type {
if (this.returnType)
this.returnType._collectAllTypes(result);
}
};
}

/**
* @param {ParsedType | null} type
Expand Down Expand Up @@ -931,7 +933,7 @@ function processCodeGroups(spec, language, transformer) {
* @param {string} codeLang
* @return {{ highlighter: string, language: string|undefined, codeGroup: string|undefined}}
*/
function parseCodeLang(codeLang) {
function parseCodeLang(codeLang) {
if (codeLang === 'python async')
return { highlighter: 'py', codeGroup: 'python-async', language: 'python' };
if (codeLang === 'python sync')
Expand Down
Loading

0 comments on commit 26bdc80

Please sign in to comment.