Repository navigation
fix(cli): restrict profile deletion to the exact session - #43928
Conversation
Test results for "MCP"1 failed 5193 passed, 616 skipped Merge workflow run. |
🟢 The CI failure is a pre-existing flakeHi, I'm the Playwright bot. I checked the failure against this PR's changes and refreshed CI history. DetailsThe latest merged report has one failing test. It is unlikely to be caused by this PR ( Pre-existing flake
The same test, project and Ubuntu bot hit the same timeout on
The refreshed results database records 17 failed and 733 passed run attempts for this exact test on Ubuntu Chromium across other runs from October 8 to November 5, excluding this PR. This PR changes CLI profile deletion in CI failures checked by the Playwright bot - agent run Triaged by the Playwright bot - agent run |
## ✨ Highlights - **🪟 Let agents use your logged-in browser without taking over your screen** ([microsoft/playwright#42973](microsoft/playwright#42973)) — `PLAYWRIGHT_MCP_BACKGROUND=1 playwright-cli attach --extension=chrome` keeps controlled tabs and the browser window in the background. You can also set `"background": true` in your CLI config. ([microsoft/playwright#43864](microsoft/playwright#43864)) - **🎬 Record the whole viewport in headless Chrome and Edge** — `playwright-cli video-start` no longer loses the bottom of the page to browser-toolbar sizing in the new headless mode. Trace screenshots benefit too. ([microsoft/playwright#43904](microsoft/playwright#43904)) - **🧭 Snapshots keep the names agents need** ([microsoft/playwright#43809](microsoft/playwright#43809)) — `playwright-cli snapshot` preserves identifying names on dialogs, landmarks, tables and column headers, even when their heading or caption also appears below them. ([microsoft/playwright#43810](microsoft/playwright#43810)) - **👁️ Ignore hidden duplicate elements by default** ([microsoft/playwright#43855](microsoft/playwright#43855)) — set `"browser": { "contextOptions": { "locateOnlyVisible": true } }` in your CLI config, then run `playwright-cli open --config=cli.config.json`. Locators resolve only visible matches, avoiding strict-mode failures from hidden, cached UI. This is opt-in. ([microsoft/playwright#43903](microsoft/playwright#43903)) - **🗂️ Keep your tab strip free of agent-created groups** ([microsoft/playwright#43038](microsoft/playwright#43038)) — set `"tabGroup": false` in your CLI config and use `playwright-cli attach --extension=chrome --config=cli.config.json`. Extension sessions can control tabs without creating a Chrome tab group or changing your existing groups. ([microsoft/playwright#43814](microsoft/playwright#43814)) ## 🐛 Fixes - `fix(cli): use ordinal filenames for repeated downloads` — repeated downloads of `report.csv` become `report-1.csv`, `report-2.csv`, and so on instead of silently overwriting earlier files. ([#514](#514), [microsoft/playwright#44011](microsoft/playwright#44011)) - `fix(cli): restrict profile deletion to the exact session` — `playwright-cli -s=work delete-data` no longer deletes the persistent profile of `work-test`. ([#499](#499), [microsoft/playwright#43928](microsoft/playwright#43928)) - `fix(cli): report command failures in text and JSON modes` — invalid arguments and startup failures produce a readable error, or an `{ "isError": true, "error": "..." }` object with `--json`, and exit with code 1 instead of exposing an unhandled rejection. ([#502](#502), [#522](#522)) - `fix(cli): use CLI command names in error messages` — validation errors and recovery hints name commands you can actually run, such as `requests` and `recording-start`, rather than MCP tools, and avoid doubled `Error:` prefixes. ([#515](#515), [microsoft/playwright#43932](microsoft/playwright#43932)) - `fix(cli): avoid killing Windows process enumerators` — `playwright-cli kill-all` correctly reports the daemons it stopped on Windows instead of saying none were found. ([#525](#525), [microsoft/playwright#44008](microsoft/playwright#44008)) - `fix(mcp): preserve non-JSON evaluation results` — `playwright-cli eval '() => 10n'`, circular objects, regular expressions and special numeric values are represented without turning successful evaluations into serialization errors or losing their values. JSON-compatible results retain their existing format. ([microsoft/playwright-mcp#1838](microsoft/playwright-mcp#1838), [microsoft/playwright#43973](microsoft/playwright#43973)) - `fix(mcp): resolve config file paths relative to their source` — relative profile, storage-state, executable and output paths now resolve next to the config file, including `.playwright/cli.config.json` and `~/.playwright/cli.config.json`, rather than the working directory. Paths supplied through flags or environment variables remain relative to the working directory. ([microsoft/playwright-mcp#1836](microsoft/playwright-mcp#1836), [microsoft/playwright#43970](microsoft/playwright#43970)) - `fix(mcp): validate device names and preserve device descriptors` — an unknown `--device` reports a clear error instead of silently disabling emulation; context overrides no longer mutate shared device presets. ([microsoft/playwright-mcp#1834](microsoft/playwright-mcp#1834), [microsoft/playwright#43971](microsoft/playwright#43971)) - `fix(mcp): bound settle waits when page timers cannot run` — commands such as `eval` and `click` no longer hang during their post-action wait on CSP-sandboxed pages or pages with paused clocks. ([microsoft/playwright#43752](microsoft/playwright#43752), [microsoft/playwright#43767](microsoft/playwright#43767)) - `fix(mcp): report event listener exceptions as console errors` — exceptions in page or context listeners registered with `run-code` appear in console output instead of terminating the session. ([microsoft/playwright#43770](microsoft/playwright#43770), [microsoft/playwright#43686](microsoft/playwright#43686)) - `fix(mcp): report one-based console source lines` — `playwright-cli console` reports line numbers that match editors and DevTools. ([microsoft/playwright-mcp#1839](microsoft/playwright-mcp#1839), [microsoft/playwright#43975](microsoft/playwright#43975)) - `fix(extension): report lost tab instead of crashing` — losing the last controlled tab produces an actionable error instead of an undefined-property exception, with guidance when another extension's frame may have caused debugger detachment. ([microsoft/playwright#43230](microsoft/playwright#43230), [microsoft/playwright#43863](microsoft/playwright#43863)) - `fix(chromium): honor Linux config directories for channel connections` — browser discovery and attachment respect `CHROME_CONFIG_HOME` and `XDG_CONFIG_HOME`; CDP connections also use the WebSocket path recorded by Chrome instead of failing with a 404. ([microsoft/playwright#43880](microsoft/playwright#43880), [microsoft/playwright#43884](microsoft/playwright#43884)) - `fix(chromium): preserve fonts when connecting with noDefaults` — attaching to an existing headless browser preserves its font settings and page layout. ([microsoft/playwright#43715](microsoft/playwright#43715), [microsoft/playwright#43773](microsoft/playwright#43773)) - `fix(chromium): preserve HTTP navigations across HTTPS upgrade modes` — explicit HTTP URLs and HTTP route mocks stay on HTTP instead of being unexpectedly upgraded or failing in Chromium, Chrome and Edge. ([microsoft/playwright#43871](microsoft/playwright#43871), [microsoft/playwright#43877](microsoft/playwright#43877)) - `fix(screenshot): support full-page SVG documents` — `playwright-cli screenshot --full-page` captures standalone SVG documents instead of timing out. ([microsoft/playwright#43962](microsoft/playwright#43962), [microsoft/playwright#43972](microsoft/playwright#43972)) - `feat(actionability): wait for elements to be non-inert` — clicks, fills and option selection wait for inert subtrees to become interactive. Inert elements and content outside modal dialogs remain available in snapshots and role locators. ([microsoft/playwright#43792](microsoft/playwright#43792), [microsoft/playwright#43850](microsoft/playwright#43850), [microsoft/playwright#43851](microsoft/playwright#43851)) - `fix(selectors): support labels for form-associated custom elements` — label locators and accessible names recognize labels associated with custom form controls. ([microsoft/playwright#43898](microsoft/playwright#43898), [microsoft/playwright#43900](microsoft/playwright#43900)) - `fix(aria): match mixed-case selected options in accessible names` — embedded comboboxes contribute their selected option's name even with values such as `aria-selected="True"`. ([microsoft/playwright#43785](microsoft/playwright#43785), [microsoft/playwright#43787](microsoft/playwright#43787)) - `fix(selector generator): do not throw when css fallback path is not unique` — ambiguous matches in slotted web components report a useful strict-mode error instead of a `TypeError`. ([microsoft/playwright#43701](microsoft/playwright#43701), [microsoft/playwright#43705](microsoft/playwright#43705)) - `fix(frames): reject context waits when page closes` — pending operations on an iframe whose document has not loaded fail when its page closes instead of waiting indefinitely. ([microsoft/playwright#43647](microsoft/playwright#43647), [microsoft/playwright#43650](microsoft/playwright#43650)) - `fix(install): report missing dependencies for all browsers` — `playwright-cli install-browser` reports missing Linux dependencies across browsers in one pass, including package names for Vulkan and Graphene. ([microsoft/playwright#43747](microsoft/playwright#43747), [microsoft/playwright#43750](microsoft/playwright#43750)) ## 📦 Upgrading ```bash npm install -g @playwright/cli@0.1.24 ``` Co-authored-by: microsoft-playwright-automation[bot] <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
delete-datamatched profile directories by session-name prefix, so deletingworkalso removedwork-test's persistent storage. Match the exact generated directory name using the browser token recorded in the session instead. Deletion is limited to that browser's generated profile, not custom profile paths.Extend the existing named-session deletion test to verify that the target profile is removed while another session's stored data survives a restart. The regression fails before the fix in Chrome, Chromium, Firefox and WebKit; all 232 checks in the five related CLI test files pass after the fix. Build and flint pass.
Fixes microsoft/playwright-cli#499
Triaged on Linux by the Playwright bot - agent run