Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: have Ubuntu 22 Docker image by default (#22356)
Max Schmitt336d2114c83d
diff --git a/docs/src/ci.md b/docs/src/ci.mdindex 96c10020bc..ed558d676c 100644--- a/docs/src/ci.md+++ b/docs/src/ci.md@@ -176,7 +176,7 @@ jobs:name: 'Playwright Tests'runs-on: ubuntu-latestcontainer:- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammysteps:- uses: actions/checkout@v3- uses: actions/setup-node@v3@@ -194,7 +194,7 @@ jobs:name: 'Playwright Tests'runs-on: ubuntu-latestcontainer:- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammysteps:- uses: actions/checkout@v3- name: Set up Python@@ -218,7 +218,7 @@ jobs:name: 'Playwright Tests'runs-on: ubuntu-latestcontainer:- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammysteps:- uses: actions/checkout@v3- uses: actions/setup-java@v3@@ -239,7 +239,7 @@ jobs:name: 'Playwright Tests'runs-on: ubuntu-latestcontainer:- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammysteps:- uses: actions/checkout@v3- name: Setup dotnet@@ -264,7 +264,7 @@ jobs:name: 'Playwright Tests - ${{ matrix.project }} - Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}'runs-on: ubuntu-latestcontainer:- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammystrategy:fail-fast: falsematrix:@@ -299,7 +299,7 @@ jobs:- deployment: Run_E2E_Testspool:vmImage: ubuntu-20.04- container: mcr.microsoft.com/playwright:v1.33.0-focal+ container: mcr.microsoft.com/playwright:v1.33.0-jammyenvironment: testingstrategy:runOnce:@@ -325,7 +325,7 @@ jobs:- deployment: Run_E2E_Testspool:vmImage: ubuntu-20.04- container: mcr.microsoft.com/playwright:v1.33.0-focal+ container: mcr.microsoft.com/playwright:v1.33.0-jammyenvironment: testingstrategy:runOnce:@@ -367,9 +367,9 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In```ymlexecutors:- pw-focal-development:+ pw-jammy-development:docker:- - image: mcr.microsoft.com/playwright:v1.33.0-focal+ - image: mcr.microsoft.com/playwright:v1.33.0-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.@@ -390,7 +390,7 @@ Sharding in CircleCI is indexed with 0 which means that you will need to overrid```ymlplaywright-job-name:- executor: pw-focal-development+ executor: pw-jammy-developmentparallelism: 4steps:- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npx playwright test -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}@@ -403,7 +403,7 @@ to run tests on Jenkins.```groovypipeline {- agent { docker { image 'mcr.microsoft.com/playwright:v1.33.0-focal' } }+ agent { docker { image 'mcr.microsoft.com/playwright:v1.33.0-jammy' } }stages {stage('e2e-tests') {steps {@@ -421,7 +421,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.md)).```yml-image: mcr.microsoft.com/playwright:v1.33.0-focal+image: mcr.microsoft.com/playwright:v1.33.0-jammy```### GitLab CI@@ -434,7 +434,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammyscript:...```@@ -450,7 +450,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammyparallel: 7script:- npm ci@@ -465,7 +465,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v1.33.0-focal+ image: mcr.microsoft.com/playwright:v1.33.0-jammyparallel:matrix:- PROJECT: ['chromium', 'webkit']diff --git a/docs/src/docker.md b/docs/src/docker.mdindex 4e3e3f03ef..94b661754f 100644--- a/docs/src/docker.md+++ b/docs/src/docker.md@@ -3,7 +3,7 @@ id: dockertitle: "Docker"----[Dockerfile.focal] can be used to run Playwright scripts in Docker environment. These image includes all the dependencies needed to run browsers in a Docker container, and also include the browsers themselves.+[Dockerfile.jammy] can be used to run Playwright scripts in Docker environment. These image includes all the dependencies needed to run browsers in a Docker container, and also include the browsers themselves.<!-- TOC -->@@ -18,19 +18,19 @@ This Docker image is intended to be used for testing and development purposes on### Pull the image```bash js-docker pull mcr.microsoft.com/playwright:v1.33.0-focal+docker pull mcr.microsoft.com/playwright:v1.33.0-jammy``````bash python-docker pull mcr.microsoft.com/playwright/python:v1.33.0-focal+docker pull mcr.microsoft.com/playwright/python:v1.33.0-jammy``````bash csharp-docker pull mcr.microsoft.com/playwright/dotnet:v1.33.0-focal+docker pull mcr.microsoft.com/playwright/dotnet:v1.33.0-jammy``````bash java-docker pull mcr.microsoft.com/playwright/java:v1.33.0-focal+docker pull mcr.microsoft.com/playwright/java:v1.33.0-jammy```### Run the image@@ -42,19 +42,19 @@ By default, the Docker image will use the `root` user to run the browsers. ThisOn 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 js-docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bash``````bash python-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v1.33.0-jammy /bin/bash``````bash csharp-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.33.0-jammy /bin/bash``````bash java-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.33.0-jammy /bin/bash```#### Crawling and scraping@@ -62,19 +62,19 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.33.0-focal /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 js-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bash``````bash python-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v1.33.0-jammy /bin/bash``````bash csharp-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.33.0-jammy /bin/bash``````bash java-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.33.0-focal /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.33.0-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:@@ -108,11 +108,12 @@ See our [Continuous Integration guides](./ci.md) for sample configs.See [all available image tags].Docker images are published automatically by GitHub Actions. We currently publish images with the-following tags (`v1.20.0` in this case is an example:):-- `:next` - tip-of-tree image version based on Ubuntu 20.04 LTS (Focal Fossa).-- `:next-focal` - tip-of-tree image version based on Ubuntu 20.04 LTS (Focal Fossa).-- `:v1.20.0` - Playwright v1.20.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).-- `:v1.20.0-focal` - Playwright v1.20.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).+following tags (`v1.33.0` in this case is an example:):+- `: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.33.0` - Playwright v1.33.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).+- `:v1.33.0-jammy` - Playwright v1.33.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).+- `:v1.33.0-focal` - Playwright v1.33.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).- `:sha-XXXXXXX` - docker image for every commit that changeddocker files or browsers, marked with a [short sha](https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#Short-SHA-1) (first 7 digits of the SHA commit).@@ -123,7 +124,7 @@ It is recommended to always pin your Docker image to a specific version if possi### Base imagesWe currently publish images based on the following [Ubuntu](https://hub.docker.com/_/ubuntu) versions:-- **Ubuntu 22.04 LTS** (Jammy Jellyfish), image tags include `jammy` (not published for Java)+- **Ubuntu 22.04 LTS** (Jammy Jellyfish), image tags include `jammy`- **Ubuntu 20.04 LTS** (Focal Fossa), image tags include `focal`#### Alpine@@ -138,10 +139,10 @@ Browser builds for Firefox and WebKit are built for the [glibc](https://en.wikipUse [`//utils/docker/build.sh`](https://github.com/microsoft/playwright/blob/main/utils/docker/build.sh) to build the image.```-./utils/docker/build.sh focal playwright:localbuild-focal+./utils/docker/build.sh jammy playwright:localbuild-jammy```-The image will be tagged as `playwright:localbuild-focal` and could be run as:+The image will be tagged as `playwright:localbuild-jammy` and could be run as:```docker run --rm -it playwright:localbuild /bin/bashdiff --git a/docs/src/test-snapshots-js.md b/docs/src/test-snapshots-js.mdindex 4581f8170e..9867c591ce 100644--- a/docs/src/test-snapshots-js.md+++ b/docs/src/test-snapshots-js.md@@ -43,7 +43,7 @@ The snapshot name `example-test-1-chromium-darwin.png` consists of a few parts:If you are not on the same operating system as your CI system, you can use Docker to generate/update the screenshots:```bash-docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.33.0-focal /bin/bash+docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bashnpm installnpx playwright test --update-snapshots```diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.shindex 3e78a338d5..abb0c37e60 100755--- a/utils/docker/publish_docker.sh+++ b/utils/docker/publish_docker.sh@@ -36,21 +36,21 @@ FOCAL_TAGS=("sha-${GITHUB_SHA}""next-focal""v${PW_VERSION}-focal"- "v${PW_VERSION}")if [[ "$RELEASE_CHANNEL" == "stable" ]]; then- FOCAL_TAGS+=("latest")FOCAL_TAGS+=("focal")fiJAMMY_TAGS=("next-jammy""v${PW_VERSION}-jammy"+ "v${PW_VERSION}")if [[ "$RELEASE_CHANNEL" == "stable" ]]; then- JAMMY_TAGS+=("jammy")+ FOCAL_TAGS+=("latest")+ FOCAL_TAGS+=("jammy")fitag_and_push() {