Skip to content

port Wave 3a BRAT tests to Playwright - #17691

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

kevinushey merged 2 commits into
mainfrom
test/migrate-brat-wave-3a

Conversation

@kevinushey

@kevinushey kevinushey commented May 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Wave 3a of the BRAT-to-Playwright migration: ports chat.R, chat-satellite.R, projects.R, terminal.R, and suspend.R (12 tests total). Plus a Server fixture upgrade so it sandboxes its rserver-dev the same way the Desktop fixture sandboxes RStudio.app.

Tests ported

BRAT file Playwright target Notes
chat.R chat-pane-persistence.test.ts (2) no-refresh on Options dismiss + restart-survival
chat-satellite.R chat-satellite-commands.test.ts (1) Command-driven popOutChat/returnChatToMain; DOM-click variant already covered by detachable-sidebar; Chrome-reload WindowCloseMonitor test dropped (no user gesture)
projects.R create_projects.test.ts (+1 git case), project_id.test.ts (1) Git-enabled new-project + ProjectId regression around project_user_data_directory pref
terminal.R tests/panes/terminal/terminal.test.ts (2) Creation + visibility, run-command + sendTerminalToEditor
suspend.R tests/panes/misc/session_suspend.test.ts (2) @server_only

Fixture changes

  • fixtures/server.fixture.ts: when PW_RSTUDIO_SERVER_URL is unset, spawn a private rserver-dev per worker with HOME pointed at PW_SANDBOX/user-home, a unique --www-port, and per-worker --server-data-dir / RSTUDIO_CONFIG_HOME. This matches the per-worker isolation the Desktop fixture has had. Set PW_RSTUDIO_SERVER_URL to point at an external server (CI) to skip the spawn.
  • The server-data-dir is anchored under os.tmpdir() with a short prefix so the Unix-domain sockets stay under the macOS sockaddr_un.sun_path 104-char limit.
  • The login form is now optional: if the server runs with --auth-none, we skip filling credentials.
  • tests/projects/create_projects.test.ts: extended createProjectInNewDir with an optional withGit flag so the wizard's git checkbox can be toggled deterministically.

Test plan

  • Desktop: chat-pane-persistence.test.ts (2), chat-satellite-commands.test.ts (1), terminal.test.ts (2), project_id.test.ts (1), create_projects.test.ts git case (1) -- all passing
  • Server: session_suspend.test.ts (2) -- passing against the sandboxed rserver-dev
  • BRAT files deleted: 5 (chat, chat-satellite, projects, terminal, suspend)

Ports chat.R, chat-satellite.R, projects.R, terminal.R, and suspend.R to
Playwright. Updates the Server fixture to accept --auth-none mode so the
@server_only suspend tests can run against local rserver-dev.

- chat.R -> chat-pane-persistence.test.ts (2 tests: no-refresh on
  Options dismiss + restart-survival)
- chat-satellite.R -> chat-satellite-commands.test.ts (command-driven
  popOutChat/returnChatToMain; DOM-click variant already covered by
  detachable-sidebar; Chrome-reload WindowCloseMonitor test dropped as
  Unportable, no user gesture)
- projects.R -> create_projects.test.ts (new git-enabled new-project
  test) and project_id.test.ts (ProjectId regression around the
  project_user_data_directory pref)
- terminal.R -> tests/panes/terminal/terminal.test.ts (2 tests)
- suspend.R -> tests/panes/misc/session_suspend.test.ts (2 tests,
  @server_only)
@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.

When PW_RSTUDIO_SERVER_URL is unset, the Server fixture now launches its
own rserver-dev process with HOME pointed at PW_SANDBOX/user-home, a
unique www-port, and per-worker server-data-dir / RSTUDIO_CONFIG_HOME --
the same isolation the Desktop fixture has had. Set PW_RSTUDIO_SERVER_URL
to point at an external server to skip the spawn.

The server-data-dir is anchored under os.tmpdir() with a short prefix so
the Unix-domain sockets rserver writes there stay under the macOS
sockaddr_un.sun_path 104-char limit (PW_SANDBOX inside /var/folders/...
is already too long on its own).
@kevinushey
kevinushey merged commit 2877a98 into main May 20, 2026
2 of 7 checks passed
@kevinushey
kevinushey deleted the test/migrate-brat-wave-3a branch May 20, 2026 00:41
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