fix(workbench): select RStudio tab and dismiss dialog defensively#418
Draft
ianpittwood wants to merge 2 commits into
Draft
fix(workbench): select RStudio tab and dismiss dialog defensively#418ianpittwood wants to merge 2 commits into
ianpittwood wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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 | ||
| ) |
|
Preview Links
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two deterministic failures in
test_runtime_versions.pyagainst current Workbench (2026.05.x), where the New Session dialog is tabbed per IDE, defaults to Positron, and#modalCancelBtnis no longer actionable.test_r_versions/test_python_versionstimed out dismissing the dialog via a direct#modalCancelBtnclick.test_r_version_in_sessionnever selected the RStudio tab, so the dialog launched its default IDE (Positron) and the#rstudio_containerassertion timed out after 60s.Changes
_open_dialog_with_rstudio_tab(page)— opens the dialog and activates the RStudio Pro tab viadialog.get_by_role("tab", name=...), waits for the Launch button, and skips gracefully when RStudio Pro is unavailable. Mirrorstest_ide_launch._start_session._dismiss_dialog(page)— best-effort teardown: short-timeout cancel click → Escape fallback → swallowednot_to_be_visibleassertion. Never lets dialog teardown fail an assertion-focused test. Mirrorstest_ide_launch._dismiss_dialog_and_skip.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 nowskiprather 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