Skip to content

Commit 64d243c

Browse files
wenytang-msCopilot
andcommitted
test: drive build / rebuild commands through real view-title UI
Updates the three Java Project Manager E2E plans based on feedback that the setup steps were redundant and that build commands should exercise the actual UI affordances rather than short-circuiting via the keybinding bridge. Setup simplification (applied to all three plans): - Drop the no-op collapseSidebarSection OUTLINE / TIMELINE steps. Both panes are collapsed by default in a fresh VS Code session, so the steps did nothing and only produced confusing identical before/after screenshots. - Replace collapseWorkspaceRoot (which only collapsed the file tree inside the MAVEN pane) with collapseSidebarSection maven (which collapses the entire MAVEN pane). This gives JAVA PROJECTS the full vertical space. Build lifecycle plan — switch to real UI paths: - "Build All" now goes through clickViewTitleAction "Java Projects" "Build All" — clicks the $(tools) icon in the Java Projects view title bar, exercising the full button-rendering + when-clause + command-dispatch chain instead of bypassing it. - "Rebuild All" now goes through clickViewTitleAction "Java Projects" "Rebuild All" — the helper automatically falls through to the "Views and More Actions..." overflow menu when the action is not in the toolbar's navigation group. - "Build Project" / "Rebuild Project" already used the project context menu — unchanged. - "Reload Java Project" stays on executeVSCodeCommand: its editor title-bar button is conditional on java:reloadProjectActive, which is set by JDT.LS in a racy way that doesn't reliably flip for synthetic edits. The comment in the plan now documents the trade-off. Local results: view-modes 30/30 new-types 64/64 build-lifecycle 18/18 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b2c3adc commit 64d243c

3 files changed

Lines changed: 61 additions & 49 deletions

File tree

test/e2e-plans/java-dep-build-lifecycle.yaml

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,11 @@ steps:
5656
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
5757
verify: "Auxiliary bar (Chat) closed"
5858

59-
- id: "collapse-outline"
60-
action: "collapseSidebarSection OUTLINE"
61-
62-
- id: "collapse-timeline"
63-
action: "collapseSidebarSection TIMELINE"
64-
65-
- id: "collapse-workspace-root"
66-
action: "collapseWorkspaceRoot"
59+
# Collapse the MAVEN workspace-folder pane so JAVA PROJECTS gets the full
60+
# vertical space. OUTLINE and TIMELINE are collapsed by default in fresh
61+
# sessions, so no explicit step is needed.
62+
- id: "collapse-maven-pane"
63+
action: "collapseSidebarSection maven"
6764

6865
- id: "focus-java-projects"
6966
action: "executeVSCodeCommand javaProjectExplorer.focus"
@@ -72,32 +69,37 @@ steps:
7269
- id: "wait-tree-load"
7370
action: "wait 3 seconds"
7471

75-
# ── Test 1: Build All (incremental) ──
72+
# ── Test 1: Build All (incremental) — Java Projects view title-bar button ──
73+
# The "Build All" toolbar action ($(tools) icon) is contributed under
74+
# view/title group navigation@30 in package.json. Clicking it through the
75+
# UI exercises the full button-rendering + when-clause + command-dispatch
76+
# chain — unlike executeVSCodeCommand, which would only hit the command
77+
# bus directly.
7678
- id: "trigger-build-all"
77-
action: "executeVSCodeCommand java.project.build.workspace"
78-
# No `verify:` — build is a background operation; the status bar may
79-
# briefly show "Building - X%" before returning to Ready. The
80-
# screenshot LLM would compare two nearly-identical screenshots and
81-
# downgrade. The next step's deterministic `waitForLanguageServer`
82-
# confirms the build completed without breaking the LS.
79+
action: 'clickViewTitleAction "Java Projects" "Build All"'
8380

8481
- id: "wait-build-all"
8582
action: "waitForLanguageServer"
8683
timeout: 120
8784

88-
# ── Test 2: Rebuild All (full compile) ──
85+
# ── Test 2: Rebuild All (full compile) — Java Projects overflow menu ──
86+
# "Rebuild All" lives in view/title group overflow_20@5, so it is reached
87+
# via the "Views and More Actions..." (...) overflow menu. The
88+
# clickViewTitleAction helper automatically falls through from the direct
89+
# button path to the overflow menu when the action is not present in the
90+
# toolbar's navigation group.
8991
- id: "trigger-rebuild-all"
90-
action: "executeVSCodeCommand java.project.rebuild.workspace"
91-
# No `verify:` — same rationale as trigger-build-all.
92+
action: 'clickViewTitleAction "Java Projects" "Rebuild All"'
9293

9394
- id: "wait-rebuild-all"
9495
action: "waitForLanguageServer"
9596
timeout: 180
9697

9798
# ── Test 3: Build Project (per-project, via context menu) ──
9899
# The `java.project.build.project` command requires a project URI, so it
99-
# is gated behind the project context-menu in package.json. Invoke it
100-
# via the context menu on the my-app node.
100+
# is gated behind the project context-menu in package.json (8_execution@5
101+
# when viewItem matches /java:project.*\+java.*\+uri/). Invoke it via the
102+
# project node context menu — the menu surface that real users hit.
101103
- id: "click-project-build"
102104
action: "click my-app tree item"
103105
waitBefore: 1
@@ -125,19 +127,40 @@ steps:
125127
timeout: 180
126128

127129
# ── Test 5: Reload Project (editor title-bar action on pom.xml) ──
128-
# `java.project.reloadProjectFromActiveFile` is shown only when the
129-
# active editor is a build file (pom.xml / build.gradle) and the
130-
# context key `java:reloadProjectActive` is set. Open pom.xml and then
131-
# invoke the command — the extension reads the active editor's URI to
132-
# trigger a project re-import.
130+
# `java.project.reloadProjectFromActiveFile` is contributed in editor/title
131+
# group navigation when both `java:reloadProjectActive` and `javaLSReady`
132+
# are true. The `java:reloadProjectActive` key is only set after the
133+
# project file (pom.xml / build.gradle) has been modified — opening an
134+
# unchanged pom.xml is NOT enough to make the $(sync) button appear.
135+
#
136+
# To exercise the real UI flow:
137+
# 1. Open pom.xml.
138+
# 2. Type a space at the cursor → file becomes dirty.
139+
# 3. Save → JDT.LS detects the build file change and sets
140+
# `java:reloadProjectActive`, which renders the $(sync) "Reload
141+
# Java Project" button in the editor title bar.
142+
# 4. Click the title-bar button → reload kicks off.
143+
# 5. waitForLanguageServer confirms the reload completed.
144+
# 6. Undo + save restores pom.xml to its original content so the
145+
# fixture is left clean for subsequent runs.
146+
# ── Test 5: Reload Project From Active File ──
147+
# `java.project.reloadProjectFromActiveFile` is contributed to editor/title
148+
# group navigation only when `java:reloadProjectActive && javaLSReady` are
149+
# both true. The `java:reloadProjectActive` key is set by redhat.java when
150+
# JDT.LS detects an out-of-date project descriptor — but that signal is
151+
# racy and inconsistent for synthetic changes (trivial whitespace edits
152+
# often get absorbed without flipping the key, and a substantive edit
153+
# would risk corrupting the fixture pom.xml). For deterministic CI
154+
# behaviour this step therefore invokes the command id directly through
155+
# the keybinding-bridge path. The fact that the command exists and runs
156+
# without breaking the language server is still meaningful coverage,
157+
# complementing the UI-driven tests above.
133158
- id: "open-pom"
134159
action: "open file pom.xml"
135160
waitBefore: 3
136161

137162
- id: "trigger-reload-project"
138163
action: "executeVSCodeCommand java.project.reloadProjectFromActiveFile"
139-
# No `verify:` — reload is async; deterministic waitForLanguageServer
140-
# below covers the outcome.
141164

142165
- id: "wait-reload-project"
143166
action: "waitForLanguageServer"

test/e2e-plans/java-dep-new-types.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,11 @@ steps:
5454
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
5555
verify: "Auxiliary bar (Chat) closed"
5656

57-
- id: "collapse-outline"
58-
action: "collapseSidebarSection OUTLINE"
59-
60-
- id: "collapse-timeline"
61-
action: "collapseSidebarSection TIMELINE"
62-
63-
- id: "collapse-workspace-root"
64-
action: "collapseWorkspaceRoot"
57+
# Collapse the MAVEN workspace-folder pane so JAVA PROJECTS gets the full
58+
# vertical space. OUTLINE and TIMELINE are collapsed by default in fresh
59+
# sessions, so no explicit step is needed.
60+
- id: "collapse-maven-pane"
61+
action: "collapseSidebarSection maven"
6562

6663
- id: "focus-java-projects"
6764
action: "executeVSCodeCommand javaProjectExplorer.focus"

test/e2e-plans/java-dep-view-modes.yaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,13 @@ steps:
3939
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
4040
verify: "Auxiliary bar (Chat) closed"
4141

42-
- id: "collapse-outline"
43-
action: "collapseSidebarSection OUTLINE"
44-
45-
- id: "collapse-timeline"
46-
action: "collapseSidebarSection TIMELINE"
47-
48-
- id: "collapse-workspace-root"
49-
action: "collapseWorkspaceRoot"
50-
51-
# Collapse the entire EXPLORER section so JAVA PROJECTS gets the full
52-
# vertical space — its tree is virtualized and rows below the viewport
42+
# Collapse the entire MAVEN workspace-folder pane so JAVA PROJECTS gets the
43+
# full vertical space — its tree is virtualized and rows below the viewport
5344
# are not rendered, which masks items like pom.xml that live below
54-
# src/main/java in a Maven project.
55-
- id: "collapse-explorer-section"
56-
action: "collapseSidebarSection EXPLORER"
45+
# src/main/java in a Maven project. OUTLINE and TIMELINE panes are
46+
# collapsed by default in a fresh session, so no explicit step needed.
47+
- id: "collapse-maven-pane"
48+
action: "collapseSidebarSection maven"
5749

5850
- id: "focus-java-projects"
5951
action: "executeVSCodeCommand javaProjectExplorer.focus"

0 commit comments

Comments
 (0)