Skip to content

Commit 578059f

Browse files
authored
fix(e2e): stabilize Linux UI tests on small Xvfb display (#1003)
* 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 <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. * test(plans): replace executeVSCodeCommand with real UI for link/unlink/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.
1 parent 952342e commit 578059f

3 files changed

Lines changed: 69 additions & 9 deletions

File tree

.github/workflows/linuxUI.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818
run: |
1919
sudo apt-get update
2020
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
21-
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
21+
# Use 1920x1080 so the Java Projects view (rendered inside the Explorer
22+
# sidebar) gets enough vertical space. With 1024x768 the sticky
23+
# pane-header overlapped tree rows and intercepted click events.
24+
sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
2225
sleep 3
2326
2427
- name: Set up JDK 21

test/e2e-plans/java-dep-file-operations.yaml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,32 @@ setup:
2525
timeout: 180
2626
settings:
2727
java.configuration.checkProjectSettingsExclusions: false
28+
workbench.startupEditor: "none"
2829

2930
steps:
30-
# ── Setup: wait for LS, focus Java Projects ──
31+
# ── Setup: wait for LS, free Explorer space, focus Java Projects ──
3132
- id: "ls-ready"
3233
action: "waitForLanguageServer"
3334
verify: "Java Language Server is ready"
3435
timeout: 180
3536

37+
# Free horizontal space (Chat panel can take ~210px on right side)
38+
- id: "close-aux-bar"
39+
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
40+
verify: "Auxiliary bar (Chat) closed"
41+
42+
# Free vertical space inside Explorer so JAVA PROJECTS gets room.
43+
# Without this the Java Projects pane-header overlaps tree rows on
44+
# 1024x768 CI displays and click events get intercepted by the sticky header.
45+
- id: "collapse-outline"
46+
action: "collapseSidebarSection OUTLINE"
47+
48+
- id: "collapse-timeline"
49+
action: "collapseSidebarSection TIMELINE"
50+
51+
- id: "collapse-workspace-root"
52+
action: "collapseWorkspaceRoot"
53+
3654
- id: "focus-java-projects"
3755
action: "run command Java Projects: Focus on Java Projects View"
3856
verify: "Java Projects view is focused"
@@ -68,11 +86,22 @@ steps:
6886
timeout: 15
6987

7088
# ── Test 2: create new package ──
89+
# Close the editor opened by the previous step. With link-with-editor on,
90+
# an open editor causes the JAVA PROJECTS tree to auto-expand, pushing
91+
# my-app right under the sticky pane-header where clicks get intercepted.
92+
- id: "close-editors-before-pkg"
93+
action: "run command View: Close All Editors"
94+
95+
- id: "collapse-workspace-root-2"
96+
action: "collapseWorkspaceRoot"
97+
7198
- id: "focus-java-projects-2"
7299
action: "run command Java Projects: Focus on Java Projects View"
100+
waitBefore: 1
73101

74102
- id: "click-project-node-2"
75103
action: "click my-app tree item"
104+
waitBefore: 1
76105

77106
- id: "trigger-new-resource-2"
78107
action: "clickTreeItemAction my-app New..."
@@ -99,6 +128,9 @@ steps:
99128
action: "open file AppToRename.java"
100129
waitBefore: 3
101130

131+
- id: "collapse-workspace-root-3"
132+
action: "collapseWorkspaceRoot"
133+
102134
- id: "focus-java-projects-3"
103135
action: "run command Java Projects: Focus on Java Projects View"
104136
waitBefore: 3
@@ -146,6 +178,9 @@ steps:
146178
action: "open file AppToDelete.java"
147179
waitBefore: 5
148180

181+
- id: "collapse-workspace-root-4"
182+
action: "collapseWorkspaceRoot"
183+
149184
- id: "focus-java-projects-4"
150185
action: "run command Java Projects: Focus on Java Projects View"
151186
waitBefore: 2

test/e2e-plans/java-dep-project-explorer.yaml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ setup:
2121
timeout: 180
2222
settings:
2323
java.configuration.checkProjectSettingsExclusions: false
24+
workbench.startupEditor: "none"
2425

2526
steps:
2627
# ── Wait for LS ready ──
@@ -29,6 +30,20 @@ steps:
2930
verify: "Java Language Server is ready"
3031
timeout: 180
3132

33+
# Free horizontal & vertical space so JAVA PROJECTS gets enough room.
34+
- id: "close-aux-bar"
35+
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
36+
verify: "Auxiliary bar (Chat) closed"
37+
38+
- id: "collapse-outline"
39+
action: "collapseSidebarSection OUTLINE"
40+
41+
- id: "collapse-timeline"
42+
action: "collapseSidebarSection TIMELINE"
43+
44+
- id: "collapse-workspace-root"
45+
action: "collapseWorkspaceRoot"
46+
3247
# ── Test 1: javaProjectExplorer.focus ──
3348
- id: "focus-java-projects"
3449
action: "run command Java Projects: Focus on Java Projects View"
@@ -45,11 +60,13 @@ steps:
4560
timeout: 15
4661

4762
# ── Test 2: linkWithFolderExplorer ──
63+
# NOTE: action resolver only matches "expandTreeItem <name>" — strings like
64+
# "expand my-app tree item" silently fall back to command palette and no-op.
4865
- id: "expand-project"
49-
action: "expand my-app tree item"
66+
action: "expandTreeItem my-app"
5067

5168
- id: "expand-src"
52-
action: "expand src/main/java tree item"
69+
action: "expandTreeItem src/main/java"
5370
waitBefore: 2
5471

5572
- id: "verify-package"
@@ -60,7 +77,7 @@ steps:
6077
timeout: 15
6178

6279
- id: "expand-package"
63-
action: "expand com.mycompany.app tree item"
80+
action: "expandTreeItem com.mycompany.app"
6481
waitBefore: 2
6582

6683
- id: "verify-app-class"
@@ -72,8 +89,12 @@ steps:
7289
timeout: 15
7390

7491
# ── Test 3: unlinkWithFolderExplorer ──
92+
# Click the title-bar action ("Unlink with Editor") in the JAVA PROJECTS pane.
93+
# When `config.java.dependency.syncWithFolderExplorer == true` (the default),
94+
# the package contributes the Unlink button to overflow_10@20 — clickViewTitleAction
95+
# locates it directly or via the "Views and More Actions..." overflow menu.
7596
- id: "unlink-editor"
76-
action: "run command Java: Unlink with Editor"
97+
action: 'clickViewTitleAction "Java Projects" "Unlink with Editor"'
7798
verify: "Editor unlinked from tree"
7899

79100
- id: "open-rename-file"
@@ -84,11 +105,12 @@ steps:
84105
verify: "Tree should not auto-expand to AppToRename"
85106

86107
- id: "relink-editor"
87-
action: "run command Java: Link with Editor"
108+
action: 'clickViewTitleAction "Java Projects" "Link with Editor"'
88109
verify: "Editor re-linked with tree"
89110

90111
# ── Test 4: revealInProjectExplorer ──
91-
# Collapse all tree nodes, then reveal App.java from editor
112+
# Collapse all tree nodes, then reveal App.java by right-clicking the editor tab
113+
# → "Reveal in Java Project Explorer" (contributed to editor/title/context).
92114
- id: "collapse-all"
93115
action: "run command View: Collapse All"
94116
verify: "Collapse tree to reset state"
@@ -98,7 +120,7 @@ steps:
98120
waitBefore: 2
99121

100122
- id: "reveal-in-project-explorer"
101-
action: "run command Java: Reveal in Java Project Explorer"
123+
action: 'contextMenuOnEditorTab "App.java" "Reveal in Java Project Explorer"'
102124
waitBefore: 2
103125

104126
- id: "verify-revealed"

0 commit comments

Comments
 (0)