Skip to content

port debugger BRAT tests (4 of 8) to Playwright - #17710

Merged
kevinushey merged 2 commits into
mainfrom
test/migrate-brat-debugger
May 20, 2026
Merged

kevinushey merged 2 commits into
mainfrom
test/migrate-brat-debugger

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Summary

Adds `tests/panes/debugger/debugger_extras.test.ts` covering the four gaps the migration plan called out:

  • Multi-line input at `Browse[N]>` preserves browser state -- exercises the fix that stopped calling `setBrowserActive(false)` on every continuation prompt (`+ `). Uses `page.keyboard.insertText` (CDP-level raw insert) so R sees the block as one input and emits real continuation prompts, then walks through any nested debug step R drops into mid-parse before checking the `DBG isBrowserActive: TRUE envIsGlobal: FALSE` marker.
  • Clicking a gutter breakpoint marker toggles it off (breakpoints do not disappear on click #9450) -- complements the existing `Shift+F9` keyboard-toggle test by exercising the click path.
  • `Clear All Breakpoints` removes every marker (breakpoints do not disappear on click #9450, `@server_only`) -- Desktop's confirmation is a native Electron messagebox Playwright can't dismiss via DOM selectors; the Server build pops a real GWT dialog with `#rstudio_dlg_yes`.
  • Breakpoints fire inside S7 method definitions for S3 generics (Editor breakpoints in S7 methods ignored #16490) -- S7 installed on demand via `consoleActions.ensurePackages(['S7'])`; the test skips itself if the install fails.

Removes the BRAT tests that are already covered by the existing `debugger.test.ts` (braced-expression breakpoint #15072, top-level-breakpoint UI #17481, gutter toggle, etc.). The two package-build tests (#15201 and the #9450 package-rebuild half) stay in BRAT -- a full devtools build cycle (~minutes) doesn't fit the Playwright fixture model and the existing Playwright suite already covers the core stepping/breakpoint paths.

Test plan

  • `npx playwright test tests/panes/debugger/debugger_extras.test.ts --project=desktop` -- 3/3 pass (multi-line browser, gutter toggle, S7).
  • `npx playwright test tests/panes/debugger/debugger_extras.test.ts --project=server -g "Clear All"` -- 1/1 passes.

Adds tests/panes/debugger/debugger_extras.test.ts covering the four gaps
the migration plan called out:

  - multi-line input at the Browse[N]> prompt preserves browser state
    (.rs.isBrowserActive() / rs_getBrowserEnv -- the fix to not call
    setBrowserActive(false) on every continuation prompt)
  - clicking a gutter breakpoint marker toggles it off (#9450)
  - Clear All Breakpoints (#9450, @server_only -- Desktop's confirm is a
    native Electron messagebox Playwright can't drive)
  - breakpoints fire inside S7 method definitions for S3 generics
    (#16490) -- S7 installed on demand via ensurePackages

Multi-line submission at Browse[N]> uses keyboard.insertText (CDP-level
raw insert) so R sees one input and emits continuation prompts -- the
regression's whole point. A helper walks through any nested debug step
that R drops into mid-parse before checking for the DBG marker.

The four BRAT tests now covered by the existing debugger.test.ts
(braced-expression breakpoint #15072, top-level-breakpoint UI #17481,
gutter toggle, etc.) are removed. The two package-build tests (#15201
and the #9450 package-rebuild half) stay in BRAT -- a full devtools
build cycle doesn't fit the Playwright fixture model.
@kevinushey kevinushey added this to the Blue Plumbago milestone May 20, 2026
@posit-snyk-bot

posit-snyk-bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kevinushey
kevinushey merged commit ba8f545 into main May 20, 2026
@kevinushey
kevinushey deleted the test/migrate-brat-debugger branch May 20, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants