Skip to content

Commit

Permalink
Merge pull request #308 from Automattic/versioned-playwright
Browse files Browse the repository at this point in the history
feat(playwright): allow for specifying Playwright version
  • Loading branch information
sjinks authored Aug 8, 2024
2 parents f232e1a + 1615d91 commit 9c76e92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions features/src/playwright/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This feature is available only for Debian-based containers.

Alpine-based containers are **not** supported because the browsers used by Playwright are built against `libs`, not `musl`.
8 changes: 7 additions & 1 deletion features/src/playwright/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"id": "playwright",
"name": "Playwright",
"description": "Sets up Playwright into the Dev Environment",
"version": "1.0.0",
"documentationURL": "https://github.com/Automattic/vip-codespaces/tree/trunk/features/src/playwright",
"version": "1.1.0",
"options": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable Playwright"
},
"version": {
"type": "string",
"default": "latest",
"description": "Playwright version to install"
}
}
}
3 changes: 2 additions & 1 deletion features/src/playwright/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

: "${_REMOTE_USER:?"_REMOTE_USER is required"}"
: "${ENABLED:=}"
PLAYWRIGHT_VERSION="${VERSION:=latest}"

if [ "${ENABLED}" = "true" ]; then
echo '(*) Installing Playwright...'
Expand Down Expand Up @@ -47,7 +48,7 @@ if [ "${ENABLED}" = "true" ]; then
apt-get install -y nodejs
fi

npm i -g playwright-core
npm i -g "playwright-core@${PLAYWRIGHT_VERSION}"
playwright-core install-deps
su -s /bin/sh -c 'playwright-core install' "${_REMOTE_USER}"

Expand Down

0 comments on commit 9c76e92

Please sign in to comment.