-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install playwright browser dependencies
- Loading branch information
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "Playwright Test Dependencies", | ||
"id": "playwright", | ||
"version": "1.0.0", | ||
"description": "Install Playwright's dependencies and cache installed browsers", | ||
"keywords": ["playwright", "testing", "browser-testing"], | ||
"options": { | ||
"browsers": { | ||
"type": "string", | ||
"proposals": [ | ||
"chrome", | ||
"chrome-beta", | ||
"chromium", | ||
"firefox", | ||
"msedge", | ||
"msedge-beta", | ||
"msedge-dev", | ||
"webkit" | ||
], | ||
"default": "chromium", | ||
"description": "Browsers whose dependencies can be installed" | ||
}, | ||
}, | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/node" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
echo "Installing dependencies for ${BROWSERS}" | ||
|
||
su "${_CONTAINER_USER}" -c "npm install -g playwright" | ||
su "${_CONTAINER_USER}" -c "npx playwright install-deps ${BROWSERS}" | ||
su "${_CONTAINER_USER}" -c "npm uninstall -g playwright" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
check "npm is available" command -v npm | ||
|
||
DEPENDENCIES=( | ||
libcairo2 | ||
libcups2 | ||
fonts-freefont-ttf | ||
) | ||
|
||
check "browser dependencies are installed" dpkg --no-pager -l "${DEPENDENCIES[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
check "npm is available" command -v npm | ||
|
||
|
||
DEPENDENCIES=( | ||
libcairo2 | ||
libxrender1 | ||
fonts-freefont-ttf | ||
) | ||
|
||
check "browser dependencies are installed" dpkg --no-pager -l "${DEPENDENCIES[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"chromium_dependencies": { | ||
"image": "debian:latest", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"playwright": { | ||
"browsers": "chromium" | ||
} | ||
} | ||
}, | ||
"firefox_dependencies": { | ||
"image": "debian:latest", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"playwright": { | ||
"browsers": "chromium" | ||
} | ||
} | ||
} | ||
} |