From bc8d946cf7d35e3d5f7a42ebf77381f0427d40e2 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Wed, 6 May 2026 13:21:09 +0800 Subject: [PATCH 1/2] fix(e2e): stabilize Linux UI tests on small Xvfb display 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 " 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 " 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> --- .github/workflows/linuxUI.yml | 5 ++- test/e2e-plans/java-dep-file-operations.yaml | 37 ++++++++++++++++++- test/e2e-plans/java-dep-project-explorer.yaml | 31 +++++++++++++--- 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linuxUI.yml b/.github/workflows/linuxUI.yml index ac24e494..1ee20df0 100644 --- a/.github/workflows/linuxUI.yml +++ b/.github/workflows/linuxUI.yml @@ -18,7 +18,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 - sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + # Use 1920x1080 so the Java Projects view (rendered inside the Explorer + # sidebar) gets enough vertical space. With 1024x768 the sticky + # pane-header overlapped tree rows and intercepted click events. + sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & sleep 3 - name: Set up JDK 21 diff --git a/test/e2e-plans/java-dep-file-operations.yaml b/test/e2e-plans/java-dep-file-operations.yaml index b06d3532..bf8f1156 100644 --- a/test/e2e-plans/java-dep-file-operations.yaml +++ b/test/e2e-plans/java-dep-file-operations.yaml @@ -25,14 +25,32 @@ setup: timeout: 180 settings: java.configuration.checkProjectSettingsExclusions: false + workbench.startupEditor: "none" steps: - # ── Setup: wait for LS, focus Java Projects ── + # ── Setup: wait for LS, free Explorer space, focus Java Projects ── - id: "ls-ready" action: "waitForLanguageServer" verify: "Java Language Server is ready" timeout: 180 + # Free horizontal space (Chat panel can take ~210px on right side) + - id: "close-aux-bar" + action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar" + verify: "Auxiliary bar (Chat) closed" + + # Free vertical space inside Explorer so JAVA PROJECTS gets room. + # Without this the Java Projects pane-header overlaps tree rows on + # 1024x768 CI displays and click events get intercepted by the sticky header. + - id: "collapse-outline" + action: "collapseSidebarSection OUTLINE" + + - id: "collapse-timeline" + action: "collapseSidebarSection TIMELINE" + + - id: "collapse-workspace-root" + action: "collapseWorkspaceRoot" + - id: "focus-java-projects" action: "run command Java Projects: Focus on Java Projects View" verify: "Java Projects view is focused" @@ -68,11 +86,22 @@ steps: timeout: 15 # ── Test 2: create new package ── + # Close the editor opened by the previous step. With link-with-editor on, + # an open editor causes the JAVA PROJECTS tree to auto-expand, pushing + # my-app right under the sticky pane-header where clicks get intercepted. + - id: "close-editors-before-pkg" + action: "run command View: Close All Editors" + + - id: "collapse-workspace-root-2" + action: "collapseWorkspaceRoot" + - id: "focus-java-projects-2" action: "run command Java Projects: Focus on Java Projects View" + waitBefore: 1 - id: "click-project-node-2" action: "click my-app tree item" + waitBefore: 1 - id: "trigger-new-resource-2" action: "clickTreeItemAction my-app New..." @@ -99,6 +128,9 @@ steps: action: "open file AppToRename.java" waitBefore: 3 + - id: "collapse-workspace-root-3" + action: "collapseWorkspaceRoot" + - id: "focus-java-projects-3" action: "run command Java Projects: Focus on Java Projects View" waitBefore: 3 @@ -146,6 +178,9 @@ steps: action: "open file AppToDelete.java" waitBefore: 5 + - id: "collapse-workspace-root-4" + action: "collapseWorkspaceRoot" + - id: "focus-java-projects-4" action: "run command Java Projects: Focus on Java Projects View" waitBefore: 2 diff --git a/test/e2e-plans/java-dep-project-explorer.yaml b/test/e2e-plans/java-dep-project-explorer.yaml index 1bdb3656..3a5a30ec 100644 --- a/test/e2e-plans/java-dep-project-explorer.yaml +++ b/test/e2e-plans/java-dep-project-explorer.yaml @@ -21,6 +21,7 @@ setup: timeout: 180 settings: java.configuration.checkProjectSettingsExclusions: false + workbench.startupEditor: "none" steps: # ── Wait for LS ready ── @@ -29,6 +30,20 @@ steps: verify: "Java Language Server is ready" timeout: 180 + # Free horizontal & vertical space so JAVA PROJECTS gets enough room. + - id: "close-aux-bar" + action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar" + verify: "Auxiliary bar (Chat) closed" + + - id: "collapse-outline" + action: "collapseSidebarSection OUTLINE" + + - id: "collapse-timeline" + action: "collapseSidebarSection TIMELINE" + + - id: "collapse-workspace-root" + action: "collapseWorkspaceRoot" + # ── Test 1: javaProjectExplorer.focus ── - id: "focus-java-projects" action: "run command Java Projects: Focus on Java Projects View" @@ -45,11 +60,13 @@ steps: timeout: 15 # ── Test 2: linkWithFolderExplorer ── + # NOTE: action resolver only matches "expandTreeItem " — strings like + # "expand my-app tree item" silently fall back to command palette and no-op. - id: "expand-project" - action: "expand my-app tree item" + action: "expandTreeItem my-app" - id: "expand-src" - action: "expand src/main/java tree item" + action: "expandTreeItem src/main/java" waitBefore: 2 - id: "verify-package" @@ -60,7 +77,7 @@ steps: timeout: 15 - id: "expand-package" - action: "expand com.mycompany.app tree item" + action: "expandTreeItem com.mycompany.app" waitBefore: 2 - id: "verify-app-class" @@ -72,8 +89,10 @@ steps: timeout: 15 # ── Test 3: unlinkWithFolderExplorer ── + # The link/unlink/reveal commands are hidden from the command palette + # ("when": false in package.json), so we must invoke them by command id. - id: "unlink-editor" - action: "run command Java: Unlink with Editor" + action: "executeVSCodeCommand java.view.package.unlinkWithFolderExplorer" verify: "Editor unlinked from tree" - id: "open-rename-file" @@ -84,7 +103,7 @@ steps: verify: "Tree should not auto-expand to AppToRename" - id: "relink-editor" - action: "run command Java: Link with Editor" + action: "executeVSCodeCommand java.view.package.linkWithFolderExplorer" verify: "Editor re-linked with tree" # ── Test 4: revealInProjectExplorer ── @@ -98,7 +117,7 @@ steps: waitBefore: 2 - id: "reveal-in-project-explorer" - action: "run command Java: Reveal in Java Project Explorer" + action: "executeVSCodeCommand java.view.package.revealInProjectExplorer" waitBefore: 2 - id: "verify-revealed" From fb4c9ae30ad715a6f8f79db32ea5795169c7304e Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Wed, 6 May 2026 15:01:05 +0800 Subject: [PATCH 2/2] test(plans): replace executeVSCodeCommand with real UI for link/unlink/reveal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- test/e2e-plans/java-dep-project-explorer.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/e2e-plans/java-dep-project-explorer.yaml b/test/e2e-plans/java-dep-project-explorer.yaml index 3a5a30ec..cc0a0eea 100644 --- a/test/e2e-plans/java-dep-project-explorer.yaml +++ b/test/e2e-plans/java-dep-project-explorer.yaml @@ -89,10 +89,12 @@ steps: timeout: 15 # ── Test 3: unlinkWithFolderExplorer ── - # The link/unlink/reveal commands are hidden from the command palette - # ("when": false in package.json), so we must invoke them by command id. + # Click the title-bar action ("Unlink with Editor") in the JAVA PROJECTS pane. + # When `config.java.dependency.syncWithFolderExplorer == true` (the default), + # the package contributes the Unlink button to overflow_10@20 — clickViewTitleAction + # locates it directly or via the "Views and More Actions..." overflow menu. - id: "unlink-editor" - action: "executeVSCodeCommand java.view.package.unlinkWithFolderExplorer" + action: 'clickViewTitleAction "Java Projects" "Unlink with Editor"' verify: "Editor unlinked from tree" - id: "open-rename-file" @@ -103,11 +105,12 @@ steps: verify: "Tree should not auto-expand to AppToRename" - id: "relink-editor" - action: "executeVSCodeCommand java.view.package.linkWithFolderExplorer" + action: 'clickViewTitleAction "Java Projects" "Link with Editor"' verify: "Editor re-linked with tree" # ── Test 4: revealInProjectExplorer ── - # Collapse all tree nodes, then reveal App.java from editor + # Collapse all tree nodes, then reveal App.java by right-clicking the editor tab + # → "Reveal in Java Project Explorer" (contributed to editor/title/context). - id: "collapse-all" action: "run command View: Collapse All" verify: "Collapse tree to reset state" @@ -117,7 +120,7 @@ steps: waitBefore: 2 - id: "reveal-in-project-explorer" - action: "executeVSCodeCommand java.view.package.revealInProjectExplorer" + action: 'contextMenuOnEditorTab "App.java" "Reveal in Java Project Explorer"' waitBefore: 2 - id: "verify-revealed"