diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index adb8dfd..ce7e2d7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1 +1 @@ -FROM mcr.microsoft.com/devcontainers/base:1.0.20-bookworm +FROM mcr.microsoft.com/devcontainers/base:2.1.9-trixie diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 86816b4..a3a2cc0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,14 +1,8 @@ { "name": "PF dev-feat DEV", "build": { - "dockerfile": "Dockerfile", - "options": [ - "--add-host=host.docker.internal:host-gateway" - ] + "dockerfile": "Dockerfile" }, - "runArgs": [ - "--add-host=host.docker.internal:host-gateway" - ], "containerEnv": { "GOMODCACHE": "${containerWorkspaceFolder}/.go_cache" }, @@ -16,7 +10,9 @@ "ghcr.io/postfinance/devcontainer-features/go:1.0.0": { "version": "1.25.9" }, - "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { + "moby": false + }, "ghcr.io/devcontainers-extra/features/devcontainers-cli:1": {} }, "customizations": { @@ -26,4 +22,4 @@ ] } } -} \ No newline at end of file +} diff --git a/features/src/playwright-deps/NOTES.md b/features/src/playwright-deps/NOTES.md index 05dba33..3bcf5fb 100644 --- a/features/src/playwright-deps/NOTES.md +++ b/features/src/playwright-deps/NOTES.md @@ -26,3 +26,23 @@ Also don't forget to add `.ms-playwright` to your `.gitignore` file. ### Download URL from within Playwright To change the downloads that Playwright does to a custom remote, you can adjust the `PLAYWRIGHT_DOWNLOAD_HOST` environment variable to eg. `https://mycompany.com/artifactory/playwright-remote/`. You might also want to increase the `PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT` to something like `300000`. + +### Poor performance of `playwright test --ui` + +If you find the UI launched with `playwright test --ui` too slow, you can run +Playwright in server mode and connect from your host browser. + +For VS Code, you only need to launch Playwright in server mode: + +```sh +npx playwright test --ui-host 0.0.0.0 --ui-port 8085 +``` + +If you are using the devcontainer CLI to build the container: + +1. In your `devcontainer.json`, add a port forward: + ```json + "appPort": [ "32222:8085" ] + ``` +2. Launch Playwright in server mode: `npx playwright test --ui-host 0.0.0.0 --ui-port 8085` +3. Access Playwright from your host browser: diff --git a/features/src/playwright-deps/README.md b/features/src/playwright-deps/README.md index 4911d8a..e6708f3 100755 --- a/features/src/playwright-deps/README.md +++ b/features/src/playwright-deps/README.md @@ -50,3 +50,23 @@ Also don't forget to add `.ms-playwright` to your `.gitignore` file. ### Download URL from within Playwright To change the downloads that Playwright does to a custom remote, you can adjust the `PLAYWRIGHT_DOWNLOAD_HOST` environment variable to eg. `https://mycompany.com/artifactory/playwright-remote/`. You might also want to increase the `PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT` to something like `300000`. + +### Poor performance of `playwright test --ui` + +If you find the UI launched with `playwright test --ui` too slow, you can run +Playwright in server mode and connect from your host browser. + +For VS Code, you only need to launch Playwright in server mode: + +```sh +npx playwright test --ui-host 0.0.0.0 --ui-port 8085 +``` + +If you are using the devcontainer CLI to build the container: + +1. In your `devcontainer.json`, add a port forward: + ```json + "appPort": [ "32222:8085" ] + ``` +2. Launch Playwright in server mode: `npx playwright test --ui-host 0.0.0.0 --ui-port 8085` +3. Access Playwright from your host browser: diff --git a/features/src/playwright-deps/installer.go b/features/src/playwright-deps/installer.go index 7314bac..bc01076 100644 --- a/features/src/playwright-deps/installer.go +++ b/features/src/playwright-deps/installer.go @@ -353,6 +353,7 @@ var dependencies = map[string]map[string][]string{ "firefox": []string{ "libasound2t64", "libatk1.0-0t64", + "libavcodec60", "libcairo-gobject2", "libcairo2", "libdbus-1-3", @@ -431,8 +432,7 @@ var dependencies = map[string]map[string][]string{ "libavif16", }, }, - - "debian11": { + "ubuntu26": { "tools": []string{ "xvfb", "fonts-noto-color-emoji", @@ -448,20 +448,19 @@ var dependencies = map[string]map[string][]string{ "fonts-freefont-ttf", }, "chromium": []string{ - "libasound2", - "libatk-bridge2.0-0", - "libatk1.0-0", - "libatspi2.0-0", + "libasound2t64", + "libatk-bridge2.0-0t64", + "libatk1.0-0t64", + "libatspi2.0-0t64", "libcairo2", - "libcups2", + "libcups2t64", "libdbus-1-3", "libdrm2", "libgbm1", - "libglib2.0-0", + "libglib2.0-0t64", "libnspr4", "libnss3", "libpango-1.0-0", - "libwayland-client0", "libx11-6", "libxcb1", "libxcomposite1", @@ -472,18 +471,17 @@ var dependencies = map[string]map[string][]string{ "libxrandr2", }, "firefox": []string{ - "libasound2", - "libatk1.0-0", + "libasound2t64", + "libatk1.0-0t64", + "libavcodec62", "libcairo-gobject2", "libcairo2", "libdbus-1-3", - "libdbus-glib-1-2", "libfontconfig1", "libfreetype6", "libgdk-pixbuf-2.0-0", - "libglib2.0-0", - "libgtk-3-0", - "libharfbuzz0b", + "libglib2.0-0t64", + "libgtk-3-0t64", "libpango-1.0-0", "libpangocairo-1.0-0", "libx11-6", @@ -498,66 +496,62 @@ var dependencies = map[string]map[string][]string{ "libxi6", "libxrandr2", "libxrender1", - "libxtst6", }, "webkit": []string{ "gstreamer1.0-libav", "gstreamer1.0-plugins-bad", "gstreamer1.0-plugins-base", "gstreamer1.0-plugins-good", - "libatk-bridge2.0-0", - "libatk1.0-0", + "libicu78", + "libatomic1", + "libatk-bridge2.0-0t64", + "libatk1.0-0t64", + "libcairo-gobject2", "libcairo2", "libdbus-1-3", "libdrm2", - "libegl1", "libenchant-2-2", "libepoxy0", - "libevdev2", + "libevent-2.1-7t64", + "libflite1", "libfontconfig1", "libfreetype6", "libgbm1", "libgdk-pixbuf-2.0-0", "libgles2", - "libglib2.0-0", - "libglx0", + "libglib2.0-0t64", "libgstreamer-gl1.0-0", + "libgstreamer-plugins-bad1.0-0", "libgstreamer-plugins-base1.0-0", "libgstreamer1.0-0", - "libgtk-3-0", - "libgudev-1.0-0", + "libgtk-4-1", "libharfbuzz-icu0", "libharfbuzz0b", "libhyphen0", - "libicu67", - "libjpeg62-turbo", + "libjpeg-turbo8", "liblcms2-2", "libmanette-0.2-0", - "libnghttp2-14", - "libnotify4", - "libopengl0", - "libopenjp2-7", "libopus0", "libpango-1.0-0", - "libpng16-16", - "libproxy1v5", + "libpangocairo-1.0-0", + "libpng16-16t64", "libsecret-1-0", + "libvpx12", "libwayland-client0", "libwayland-egl1", "libwayland-server0", - "libwebp6", + "libwebp7", "libwebpdemux2", "libwoff1", "libx11-6", - "libxcomposite1", - "libxdamage1", "libxkbcommon0", - "libxml2", + "libxml2-16", "libxslt1.1", - "libatomic1", - "libevent-2.1-7", + "libx264-165", + "libavif16", }, }, + "debian12": { "tools": []string{ "xvfb", @@ -723,6 +717,7 @@ var dependencies = map[string]map[string][]string{ "firefox": []string{ "libasound2", "libatk1.0-0t64", + "libavcodec61", "libcairo-gobject2", "libcairo2", "libdbus-1-3", diff --git a/features/test/playwright-deps/scenarios.json b/features/test/playwright-deps/scenarios.json index d2dde65..b76cd44 100644 --- a/features/test/playwright-deps/scenarios.json +++ b/features/test/playwright-deps/scenarios.json @@ -1,10 +1,7 @@ { "install": { "build": { - "dockerfile": "Dockerfile", - "options": [ - "--add-host=host.docker.internal:host-gateway" - ] + "dockerfile": "Dockerfile" }, "features": { "./playwright-deps": { @@ -14,4 +11,4 @@ } } } -} \ No newline at end of file +} diff --git a/features/test/playwright-deps/test-images.json b/features/test/playwright-deps/test-images.json index baaeb21..531cc48 100644 --- a/features/test/playwright-deps/test-images.json +++ b/features/test/playwright-deps/test-images.json @@ -1,5 +1,6 @@ [ - "mcr.microsoft.com/devcontainers/base:debian-11", "mcr.microsoft.com/devcontainers/base:debian-12", - "mcr.microsoft.com/devcontainers/base:ubuntu-24.04" -] \ No newline at end of file + "mcr.microsoft.com/devcontainers/base:debian-13", + "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "mcr.microsoft.com/devcontainers/base:ubuntu-26.04" +]