From 82f185700e63063e1875a816546a2ebf2893c327 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 12 Feb 2026 14:54:33 +0000 Subject: [PATCH 1/4] Add --no-link-modules to playwright-screenshots.sh script --- .../playwright-screenshots.sh | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/packages/element-web-playwright-common/playwright-screenshots.sh b/packages/element-web-playwright-common/playwright-screenshots.sh index 5a3a014e2f..1fa0f537d9 100755 --- a/packages/element-web-playwright-common/playwright-screenshots.sh +++ b/packages/element-web-playwright-common/playwright-screenshots.sh @@ -56,6 +56,7 @@ RUN_ARGS=( ) DEFAULT_ARGS=(--grep @screenshot) +LINK_MODULES=true # Some arguments to customise behaviour so the same script / image can be # re-used for other screenshot generation. @@ -72,6 +73,11 @@ while [[ $# -gt 0 ]]; do RUN_ARGS+=(--mount "${mount_param}" -e YARN_INSTALL=true) shift ;; + # Disables the automatic detection & linking of node_modules which can clash with developer tooling e.g. pnpm-link + --no-link-modules) + LINK_MODULES=false + shift + ;; # Sets a different entrypoint (in which case the default arguments to the script will be ignored) --entrypoint) shift @@ -87,16 +93,17 @@ done build_image -# Ensure we pass all symlinked node_modules to the container -pushd node_modules > /dev/null -SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*") -popd > /dev/null -for LINK in $SYMLINKS; do - TARGET=$(readlink -f "node_modules/$LINK") || true - if [ -d "$TARGET" ]; then - if [ -n "$docker_is_podman" ]; then - echo -e "\033[31m" >&2 - cat <<'EOF' >&2 +if [[ $LINK_MODULES == true ]]; then + # Ensure we pass all symlinked node_modules to the container + pushd node_modules > /dev/null + SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*") + popd > /dev/null + for LINK in $SYMLINKS; do + TARGET=$(readlink -f "node_modules/$LINK") || true + if [ -d "$TARGET" ]; then + if [ -n "$docker_is_podman" ]; then + echo -e "\033[31m" >&2 + cat <<'EOF' >&2 WARNING: `node_modules` contains symlinks, and the support for this in `playwright-screenshots.sh` is broken under podman due to https://github.com/containers/podman/issues/25947. @@ -104,12 +111,13 @@ https://github.com/containers/podman/issues/25947. If you get errors such as 'Error: crun: creating ``', then retry this having `yarn unlink`ed the relevant node modules. EOF - echo -e "\033[0m" >&2 + echo -e "\033[0m" >&2 + fi + echo "mounting linked package ${LINK:2} in container" + RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" ) fi - echo "mounting linked package ${LINK:2} in container" - RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" ) - fi -done + done +fi # Our Playwright fixtures use Testcontainers [1], which uses a docker image # called Ryuk [2], which will clean up any dangling containers/networks/etc From f243b3dd5447722230e9bf6d965626b3ac28df08 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 12 Feb 2026 14:54:59 +0000 Subject: [PATCH 2/4] Enable corepack in playwright screenshots docker image --- packages/element-web-playwright-common/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/element-web-playwright-common/Dockerfile b/packages/element-web-playwright-common/Dockerfile index 5ae83e4bcf..d718dc5c25 100644 --- a/packages/element-web-playwright-common/Dockerfile +++ b/packages/element-web-playwright-common/Dockerfile @@ -6,6 +6,10 @@ WORKDIR /work # fonts-dejavu is needed for the same RTL rendering as on CI RUN apt-get update && apt-get -y install docker.io fonts-dejavu +# Set up corepack +RUN corepack enable +ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 + COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] From 2c73e09907293fefa9b74e6ad2efbf284f4e0df0 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 12 Feb 2026 14:55:12 +0000 Subject: [PATCH 3/4] Expose PLAYWRIGHT_COMMON_DOCKER envvar in playwright screenshots docker image --- packages/element-web-playwright-common/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/element-web-playwright-common/Dockerfile b/packages/element-web-playwright-common/Dockerfile index d718dc5c25..ef6bd176ed 100644 --- a/packages/element-web-playwright-common/Dockerfile +++ b/packages/element-web-playwright-common/Dockerfile @@ -10,6 +10,9 @@ RUN apt-get update && apt-get -y install docker.io fonts-dejavu RUN corepack enable ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 +# Add environment variable so consumers can skip developer-centric scripts +ENV PLAYWRIGHT_COMMON_DOCKER=1 + COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] From a604153ece4faf0c2050e006c7fd65532e593fa2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 12 Feb 2026 14:55:30 +0000 Subject: [PATCH 4/4] Bump playwright-common version --- packages/element-web-playwright-common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/element-web-playwright-common/package.json b/packages/element-web-playwright-common/package.json index ed6481c824..e6be5b6ea7 100644 --- a/packages/element-web-playwright-common/package.json +++ b/packages/element-web-playwright-common/package.json @@ -1,7 +1,7 @@ { "name": "@element-hq/element-web-playwright-common", "type": "module", - "version": "2.2.6", + "version": "2.2.7", "license": "SEE LICENSE IN README.md", "repository": { "type": "git",