-
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.
Create volume for caching playwright browsers
Playwright must download and install browsers before it can run any tests. Users can do this (inside their devcontainers) by running: npx playwright install [chromium [firefox]] Plenty of other browsers are available. You don't want to be doing this every time you build a devcontainer, so we'll cache the downloaded browsers in a named volume. The volume will still be available after devcontainer images have been torn down and rebuilt. The feature configures playwright to automatically use this volume by setting the PLAYWRIGHT_BROWSERS_PATH environment variable.
- Loading branch information
Showing
3 changed files
with
26 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
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,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
CACHE_DIR="/playwright/browsers" | ||
|
||
check "playwright-browsers volume is mounted" test -d "$CACHE_DIR" | ||
|
||
check "PLAYWRIGHT_BROWSERS_PATH is set" env | grep "PLAYWRIGHT_BROWSERS_PATH=$CACHE_DIR" |
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