fix(e2e): stabilize Linux UI tests on small Xvfb display#1003
Merged
wenytang-ms merged 2 commits intomainfrom May 6, 2026
Merged
fix(e2e): stabilize Linux UI tests on small Xvfb display#1003wenytang-ms merged 2 commits intomainfrom
wenytang-ms merged 2 commits intomainfrom
Conversation
The Linux-UI workflow was failing 6 steps across the two e2e plans on the 1024x768 Xvfb display used in CI. Three independent root causes: 1. Sticky pane-header click interception. The JAVA PROJECTS view is rendered inside the Explorer sidebar. With OUTLINE/TIMELINE/MAVEN sections also visible, the Java Projects pane has very little vertical space, and its sticky pane-header sits right on top of the first tree row. Playwright finds the my-app treeitem but the click is consumed by the section header (the Playwright call log shows the pane-header subtree intercepts pointer events). Fix: bump Xvfb to 1920x1080 and explicitly close the auxiliary (Chat) bar plus collapse OUTLINE, TIMELINE and the workspace root before interacting with the Java Projects tree. 2. Unsupported action syntax in java-dep-project-explorer.yaml. The strings "expand my-app tree item", "expand src/main/java tree item" and "expand com.mycompany.app tree item" do not match any pattern in autotest's ActionResolver (only "expandTreeItem <name>" is recognized). They silently fell back to the command palette and no-op'd, so the tree never actually expanded and the subsequent verifyTreeItem checks for "com.mycompany.app" and "App" timed out. Fix: use the "expandTreeItem <name>" form. 3. Hidden command-palette commands. java.view.package.linkWith FolderExplorer, unlinkWithFolderExplorer and revealInProjectExplorer all have "when": false on their commandPalette menu contribution and cannot be invoked via the command palette. They were no-ops in the previous plan (the reveal-in-project-explorer step was even opening the wrong "Create Java Project" picker). Fix: invoke them by command id with "executeVSCodeCommand". Also close the editor opened by the create-class step before the create-package step, so link-with-editor doesn't auto-expand the tree and push my-app under the sticky header again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…k/reveal
Once autotest >=0.6.6 ships clickViewTitleAction and contextMenuOnEditorTab,
exercise the actual VS Code UI affordances instead of dispatching the
extension commands by id:
- unlinkWithFolderExplorer / linkWithFolderExplorer → clickViewTitleAction
on the JAVA PROJECTS pane title bar (overflow menu when sync is on/off).
- revealInProjectExplorer → right-click the editor tab and pick
'Reveal in Java Project Explorer' from editor/title/context.
These were palette-hidden ('when: false') and therefore previously fell
back to executeVSCodeCommand. Verified locally end-to-end: 21/21 steps
pass on the project-explorer plan and 39/39 on file-operations with the
locally-built autotest.
closeAuxiliaryBar still uses executeVSCodeCommand intentionally — it is
a built-in VS Code helper (not extension UI under test) and now dispatches
through a real keybinding rather than the broken driver.executeCommand
path.
chagong
approved these changes
May 6, 2026
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.
Why CI Run #25417136374 Failed
The Linux-UI workflow on the run in question reported
❌ 27/31forJava Dependency — File Operationsand❌ 15/17forJava Dependency — Project Explorer. After downloading the screenshots artifact and reading the autotest source, I found three independent root causes, none of which was the extension code itself.1. Sticky pane-header intercepts clicks in the Java Projects tree
The
javaProjectExplorerview is contributed inside the standard Explorer container (seepackage.json"views": { "explorer": [...] }). On the CI Xvfb display of1024x768with the default sidebar layout (Maven explorer expanded, Outline + Timeline visible, plus VS Code's new Chat auxiliary bar on the right) the JAVA PROJECTS section ends up with ~140 px of vertical room. Its sticky pane-header (<div class="pane-header expanded" aria-label="Java Projects Section">) sits right on top of the first tree row.Playwright finds the
my-apptreeitem but the actual click is consumed by the section header. From the job log:The same effect causes the
clickTreeItemAction my-app New...step to register its click on the Collapse All codicon in the section header (thehitTargetlog showsaria-label="Collapse All"instead ofNew...), which dismisses the inline-action popover and breaks the rest of the create-package flow (select-package,select-source-folder-2,enter-package-nameall time out waiting for a Quick Pick that was never opened).This effect gets worse between iterations because
link-with-editorauto-expands the JAVA PROJECTS tree to follow the active editor — afterApp2.javais created, my-app's children push it right under the header.2. Unsupported action syntax in
java-dep-project-explorer.yamlThe plan used
expand <name> tree itemfor three steps. autotest'sActionResolveronly recognizesexpandTreeItem <name>(no spaces, camelCase). The fallback path runs the string through the command palette, which silently dismisses unknown commands — so the tree was never actually expanded:The same is true for
expand src/main/java tree itemandexpand com.mycompany.app tree item. Theverify-revealedstep at the end of the plan only passed by luck —open file AppToRename.javatriggered link-with-editor and pre-expanded the tree.3. Hidden command-palette commands
java.view.package.linkWithFolderExplorer,unlinkWithFolderExplorerandrevealInProjectExplorerare all registered with"when": falseon theircommandPalettemenu contribution:So
run command Java: Reveal in Java Project Explorercould not invoke the command. The screenshot34_verify-revealed_after.pngshows VS Code instead opening "Select the project type" (theJava: Create Java Projectpicker) — fuzzy match found a different command. Again, the verify step only passed becauseAppwas already visible in the tree from previous link-with-editor expansions.Fix in this PR
.github/workflows/linuxUI.yml1024x768→1920x1080. Gives the Java Projects pane real estate and removes the pane-header overlap class of failures.test/e2e-plans/java-dep-file-operations.yamlexecuteVSCodeCommand workbench.action.closeAuxiliaryBar,collapseSidebarSection OUTLINE,collapseSidebarSection TIMELINE,collapseWorkspaceRoot. Between the create-class and create-package iterations: close the editor that link-with-editor opened and re-collapse the workspace root, so my-app stays away from the sticky header. SamecollapseWorkspaceRootis repeated before each subsequent test (rename, delete) for the same reason.test/e2e-plans/java-dep-project-explorer.yamlexpand <name> tree itemwithexpandTreeItem <name>. Replace the three palette-hidden commands withexecuteVSCodeCommand <id>. Same startupcloseAuxiliaryBar+ collapse steps.Both plans pass
npx autotest validate.How to verify
This PR will trigger the same
linuxUI.ymlworkflow. Expected:locator.clicktimeouts onmy-app).com.mycompany.appandAppvisible after explicit expansion; link/unlink/reveal actually invoked).If the CI still flakes on a specific step we'll have stable, deterministic logs (no more silent fallbacks) and the screenshots will reflect what was actually attempted.
Recommended follow-ups (separate PRs in
microsoft/javaext-autotest)These would harden the framework so similar bugs are caught at write time instead of in CI:
ActionResolverfalls back to the command palette and VS Code reports no matching command, fail the step instead of silently succeeding. The current behavior masked all 6 of these issues.collapseTreeItem <name>— there'sexpandTreeItem(no-op if expanded) but no symmetric collapse, so plans currently rely onView: Collapse Allor full re-launches.clickTreeItem/clickTreeItemAction, afterscrollIntoViewIfNeeded()also checkdocument.elementFromPoint()against the target row; if the hit element belongs to a sticky pane-header, scroll the inner list further before clicking. This would make plans tolerant of small viewports without requiring callers to manually free space.AGENTS.mdthat hidden palette commands needexecuteVSCodeCommand.