@element-hq/element-web-playwright-common 2.2.4 → 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.4",
4
+ "version": "2.2.6",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "@axe-core/playwright": "^4.10.1",
33
33
  "@testcontainers/postgresql": "^11.0.0",
34
- "glob": "^13.0.0",
35
- "lodash-es": "^4.17.21",
34
+ "glob": "^13.0.1",
35
+ "lodash-es": "^4.17.23",
36
36
  "mailpit-api": "^1.2.0",
37
37
  "strip-ansi": "^7.1.0",
38
38
  "testcontainers": "^11.0.0",
@@ -8,13 +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
- # Fetch the playwright version
15
- # .data.version is for yarn classic
16
- # .children.Version is for yarn berry
17
- PW_VERSION=$(yarn info --manifest --json @playwright/test | jq -r '.data.version // .children.Version')
16
+ # Check the playwright version
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
18
23
  echo "with Playwright version $PW_VERSION"
19
24
 
20
25
  # Build image
@@ -61,7 +66,10 @@ while [[ $# -gt 0 ]]; do
61
66
  # It's a volume rather than a directory because otherwise things tend to start picking up
62
67
  # files from it in the native environment and break.
63
68
  --with-node-modules)
64
- 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)
65
73
  shift
66
74
  ;;
67
75
  # Sets a different entrypoint (in which case the default arguments to the script will be ignored)
@@ -86,7 +94,7 @@ popd > /dev/null
86
94
  for LINK in $SYMLINKS; do
87
95
  TARGET=$(readlink -f "node_modules/$LINK") || true
88
96
  if [ -d "$TARGET" ]; then
89
- if docker --version | grep -q podman; then
97
+ if [ -n "$docker_is_podman" ]; then
90
98
  echo -e "\033[31m" >&2
91
99
  cat <<'EOF' >&2
92
100
  WARNING: `node_modules` contains symlinks, and the support for this in