Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/playwright/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ downloaded.
They live in `/usr/local/share/ms-playwright` rather than Playwright's default `$HOME/.cache`, and
`PLAYWRIGHT_BROWSERS_PATH` is set through `containerEnv` to match. Nothing to configure, and it
keeps working when `HOME` is replaced at run time.

`PLAYWRIGHT_MCP_BROWSER=chromium` is set for the same reason. Left alone, `playwright-cli` opens the
branded `chrome` channel and looks for it at `/opt/google/chrome/chrome`, which nothing installs —
so `playwright-cli open` would fail with *"Chromium distribution 'chrome' is not found"* despite a
perfectly good Chromium sitting in the image. Callers can still override it per command with
`--browser`.
6 changes: 6 additions & 0 deletions src/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ They live in `/usr/local/share/ms-playwright` rather than Playwright's default `
`PLAYWRIGHT_BROWSERS_PATH` is set through `containerEnv` to match. Nothing to configure, and it
keeps working when `HOME` is replaced at run time.

`PLAYWRIGHT_MCP_BROWSER=chromium` is set for the same reason. Left alone, `playwright-cli` opens the
branded `chrome` channel and looks for it at `/opt/google/chrome/chrome`, which nothing installs —
so `playwright-cli open` would fail with *"Chromium distribution 'chrome' is not found"* despite a
perfectly good Chromium sitting in the image. Callers can still override it per command with
`--browser`.


---

Expand Down
5 changes: 3 additions & 2 deletions src/playwright/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"containerEnv": {
"PLAYWRIGHT_BROWSERS_PATH": "/usr/local/share/ms-playwright"
"PLAYWRIGHT_BROWSERS_PATH": "/usr/local/share/ms-playwright",
"PLAYWRIGHT_MCP_BROWSER": "chromium"
},
"description": "Installs the Playwright CLI and Chromium. Requires the node feature.",
"id": "playwright",
Expand All @@ -16,5 +17,5 @@
"type": "string"
}
},
"version": "1.0.0"
"version": "1.1.0"
}
2 changes: 2 additions & 0 deletions test/playwright/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source \
dev-container-features-test-lib
check 'check if playwright-cli exists' bash -c "command -v playwright-cli"
check 'check if the browsers path is exported' bash -c "test \"${PLAYWRIGHT_BROWSERS_PATH:-}\" = /usr/local/share/ms-playwright"
check 'check if the default browser is chromium' bash -c "test \"${PLAYWRIGHT_MCP_BROWSER:-}\" = chromium"
check 'check if chromium was downloaded' bash -c "ls /usr/local/share/ms-playwright | grep -q chromium"
check 'check if the browsers are readable by the remote user' bash -c "test -r /usr/local/share/ms-playwright && test -x /usr/local/share/ms-playwright"
check 'check if the browser opens with no --browser flag' bash -c "PLAYWRIGHT_CLI_SESSION=featuretest playwright-cli open && PLAYWRIGHT_CLI_SESSION=featuretest playwright-cli close"
reportResults
Loading