-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
Bug description
When using playwright-cli --config <file>, browser.initPage entries with relative paths (for example ./src/initPage.ts) do not run.
The command succeeds, but the init hook is not applied, and there is no visible error.
Reproduction
config.json:
{
"browser": {
"initPage": ["./src/initPage.ts"]
}
}src/initPage.ts:
export default async ({ page }) => {
await page.setViewportSize({ width: 50, height: 50 });
};Run:
playwright-cli --config config.json open https://demo.playwright.dev/todomvc/ --headed
playwright-cli eval "window.innerWidth"Actual
window.innerWidth remains the default (e.g. 1200), meaning initPage was not applied.
Expected
Relative browser.initPage paths should resolve (to cwd or config file directory), and the hook should run.
Notes
- Using an absolute path works:
Then
PLAYWRIGHT_MCP_INIT_PAGE="$(pwd)/src/initPage.ts" playwright-cli open https://demo.playwright.dev/todomvc/ --headedwindow.innerWidthis50. - This appears to fail silently (no user-facing error in normal output).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels