@element-hq/element-web-playwright-common 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -6,4 +6,6 @@ WORKDIR /work
6
6
  # fonts-dejavu is needed for the same RTL rendering as on CI
7
7
  RUN apt-get update && apt-get -y install docker.io fonts-dejavu
8
8
 
9
- ENTRYPOINT ["npx", "playwright", "test", "--update-snapshots", "--reporter", "line"]
9
+ COPY docker-entrypoint.sh /docker-entrypoint.sh
10
+
11
+ ENTRYPOINT ["/docker-entrypoint.sh"]
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ if [[ "$YARN_INSTALL" == "true" ]]; then
6
+ yarn install --frozen-lockfile
7
+ fi
8
+
9
+ npx playwright test --update-snapshots --reporter line "$@"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@element-hq/element-web-playwright-common",
3
3
  "type": "module",
4
- "version": "2.2.5",
4
+ "version": "2.2.6",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@axe-core/playwright": "^4.10.1",
33
33
  "@testcontainers/postgresql": "^11.0.0",
34
- "glob": "^13.0.0",
34
+ "glob": "^13.0.1",
35
35
  "lodash-es": "^4.17.23",
36
36
  "mailpit-api": "^1.2.0",
37
37
  "strip-ansi": "^7.1.0",
@@ -8,11 +8,18 @@ SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
8
8
 
9
9
  IMAGE_NAME="element-web-playwright-common"
10
10
 
11
+ if docker --version | grep -q podman; then docker_is_podman=1; fi
12
+
11
13
  build_image() {
12
14
  echo "Building $IMAGE_NAME image in $SCRIPT_DIR"
13
15
 
14
16
  # Check the playwright version
15
- PW_VERSION=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name | split("@") | last')
17
+ PM=$(cat package.json | jq -r '.packageManager')
18
+ if [[ $PM == "pnpm@"* ]]; then
19
+ PW_VERSION=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[].devDependencies["@playwright/test"].version')
20
+ else
21
+ PW_VERSION=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name | split("@") | last')
22
+ fi
16
23
  echo "with Playwright version $PW_VERSION"
17
24
 
18
25
  # Build image
@@ -59,7 +66,10 @@ while [[ $# -gt 0 ]]; do
59
66
  # It's a volume rather than a directory because otherwise things tend to start picking up
60
67
  # files from it in the native environment and break.
61
68
  --with-node-modules)
62
- RUN_ARGS+=(--mount "type=volume,src=ew-docker-node-modules,dst=/work/node_modules,volume-nocopy")
69
+ mount_param="type=volume,src=ew-docker-node-modules,dst=/work/node_modules"
70
+ # podman doesn't support `volume-nocopy`
71
+ if [ -z "$docker_is_podman" ]; then mount_param+=",volume-nocopy"; fi
72
+ RUN_ARGS+=(--mount "${mount_param}" -e YARN_INSTALL=true)
63
73
  shift
64
74
  ;;
65
75
  # Sets a different entrypoint (in which case the default arguments to the script will be ignored)
@@ -84,7 +94,7 @@ popd > /dev/null
84
94
  for LINK in $SYMLINKS; do
85
95
  TARGET=$(readlink -f "node_modules/$LINK") || true
86
96
  if [ -d "$TARGET" ]; then
87
- if docker --version | grep -q podman; then
97
+ if [ -n "$docker_is_podman" ]; then
88
98
  echo -e "\033[31m" >&2
89
99
  cat <<'EOF' >&2
90
100
  WARNING: `node_modules` contains symlinks, and the support for this in