Skip to content

fix(workbench): select RStudio tab and dismiss dialog defensively#418

Draft
ianpittwood wants to merge 2 commits into
mainfrom
fix/workbench-runtime-versions
Draft

fix(workbench): select RStudio tab and dismiss dialog defensively#418
ianpittwood wants to merge 2 commits into
mainfrom
fix/workbench-runtime-versions

Conversation

@ianpittwood

Copy link
Copy Markdown
Contributor

Summary

Fixes two deterministic failures in test_runtime_versions.py against current Workbench (2026.05.x), where the New Session dialog is tabbed per IDE, defaults to Positron, and #modalCancelBtn is no longer actionable.

Changes

  • Add _open_dialog_with_rstudio_tab(page) — opens the dialog and activates the RStudio Pro tab via dialog.get_by_role("tab", name=...), waits for the Launch button, and skips gracefully when RStudio Pro is unavailable. Mirrors test_ide_launch._start_session.
  • Add _dismiss_dialog(page) — best-effort teardown: short-timeout cancel click → Escape fallback → swallowed not_to_be_visible assertion. Never lets dialog teardown fail an assertion-focused test. Mirrors test_ide_launch._dismiss_dialog_and_skip.
  • Route all three steps (check_r_versions_in_dialog, check_python_versions_in_dialog, start_rstudio_with_r_version) through the new helpers.

Note for reviewers

The two version-availability tests now also pin to the RStudio Pro tab. This makes the dropdown reads deterministic (the dropdown IDs are #rstudio_label_*), but on a deployment that offers Positron but not RStudio Pro these tests now skip rather than reading from the default tab. Flagging as a deliberate scope choice beyond #415's stated ask.

Closes #415
Closes #416

🤖 Generated with Claude Code

The runtime version tests opened the New Session dialog without selecting
an IDE tab and dismissed it via a direct #modalCancelBtn click. On current
Workbench the dialog defaults to Positron and #modalCancelBtn is no longer
actionable, so the version checks timed out dismissing the dialog (#415)
and the in-session test launched Positron and timed out waiting for
#rstudio_container (#416).

Add a shared _open_dialog_with_rstudio_tab helper that activates the
RStudio Pro tab (skipping gracefully when unavailable) and a best-effort
_dismiss_dialog helper that falls back to Escape and never fails an
assertion-focused test, mirroring the patterns in test_ide_launch.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 22:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Workbench runtime-version BDD steps to reliably interact with the tabbed “New Session” dialog on current Workbench versions by explicitly selecting the RStudio Pro tab and dismissing the dialog defensively, addressing deterministic timeouts and incorrect-IDE launches.

Changes:

  • Added _open_dialog_with_rstudio_tab(page) to open the New Session dialog, select the RStudio Pro tab, and skip when unavailable/unusable.
  • Added _dismiss_dialog(page) to close the dialog best-effort (quick cancel → Escape fallback) without letting teardown fail assertion-focused tests.
  • Routed the R/Python version dialog checks and the “launch RStudio with expected R” step through the new helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +182 to +183
dialog = page.locator(NewSessionDialog.DIALOG)
expect(dialog).to_be_visible(timeout=TIMEOUT_DIALOG)
Comment on lines +195 to +197
page.locator(NewSessionDialog.LAUNCH_BUTTON).wait_for(
state="visible", timeout=TIMEOUT_QUICK
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants