Skip to content

Commit 77c1fd9

Browse files
committed
test(view-modes): drive view-mode toggles through real UI
The four toggle steps (switch-to-hierarchical, switch-to-flat, hide-non-java, show-non-java) previously fired their commands via executeVSCodeCommand (keybinding bridge), which sidestepped the actual user-facing entry point in the Java Projects view title-bar overflow menu. The `before`/`after` screenshots were nearly identical since no mouse interaction was modeled and the tree refresh is async, which gave no visual evidence the user-facing toggle actually works. Switch to clickViewTitleAction so each toggle goes through the real overflow menu. Combined with the driver-side pre-click sub-screenshots (autotest c24658f), each step now produces two click-evidence frames: the `...` overflow button hovered (with tooltip) and the menu item highlighted (e.g. "Hierarchical View" focused). Menu labels match package.nls.json: - "Hierarchical View" / "Flat View" - "Hide Non-Java Resources" / "Show Non-Java Resources" The Hide/Show labels mirror each other based on the config.java.project.explorer.showNonJavaResources context key, so the plan alternates between "Hide" (when currently shown) and "Show" (when currently hidden). Comments document this. Verified: java-dep-view-modes 30/30 passing locally.
1 parent 64d243c commit 77c1fd9

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ steps:
8181
# 'com.mycompany'"). Verify deterministically through the appearance of
8282
# the "com.mycompany" node.
8383
- id: "switch-to-hierarchical"
84-
action: "executeVSCodeCommand java.view.package.changeToHierarchicalPackageView"
85-
# No `verify:` — visually only the package label changes inside the
86-
# already-expanded src/main/java row, and the BEFORE/AFTER screenshots
87-
# look nearly identical, which a strict screenshot-LLM mis-reads as
88-
# "no change". The deterministic verifyTreeItem checks below are the
89-
# ground truth.
84+
action: 'clickViewTitleAction "Java Projects" "Hierarchical View"'
85+
# Real UI path: opens the Java Projects view overflow menu and clicks
86+
# "Hierarchical View". sub-screenshots capture overflow-open (button
87+
# tooltip visible) and menuitem (Hierarchical View highlighted) so
88+
# the LLM/human reviewer can verify the click landed correctly.
89+
# deterministic verifyTreeItem below is still authoritative.
9090

9191
- id: "wait-hierarchical"
9292
action: "wait 4 seconds"
@@ -101,9 +101,9 @@ steps:
101101

102102
# ── Test 2: switch back to flat view ──
103103
- id: "switch-to-flat"
104-
action: "executeVSCodeCommand java.view.package.changeToFlatPackageView"
105-
# No `verify:` — see switch-to-hierarchical. verifyTreeItem
106-
# below is authoritative.
104+
action: 'clickViewTitleAction "Java Projects" "Flat View"'
105+
# Real UI path through view-title overflow menu — see
106+
# switch-to-hierarchical. verifyTreeItem below is authoritative.
107107

108108
- id: "wait-flat"
109109
action: "wait 4 seconds"
@@ -181,10 +181,12 @@ steps:
181181
timeout: 15
182182

183183
- id: "hide-non-java"
184-
action: "executeVSCodeCommand java.project.explorer.hideNonJavaResources"
185-
# No `verify:` — same rationale as switch-to-hierarchical: only the
186-
# presence of a few peripheral nodes (pom.xml, .vscode) changes. The
187-
# deterministic verifyTreeItem checks are authoritative.
184+
action: 'clickViewTitleAction "Java Projects" "Hide Non-Java Resources"'
185+
# Real UI path through view-title overflow menu. The menu item label
186+
# toggles based on `config.java.project.explorer.showNonJavaResources`
187+
# (Show vs Hide), and the current state at this point is "showing"
188+
# so the menu surfaces "Hide Non-Java Resources". verifyTreeItem
189+
# checks below are authoritative.
188190

189191
- id: "wait-hide"
190192
action: "wait 5 seconds"
@@ -200,8 +202,10 @@ steps:
200202

201203
# ── Test 5: show non-Java resources ──
202204
- id: "show-non-java"
203-
action: "executeVSCodeCommand java.project.explorer.showNonJavaResources"
204-
# No `verify:` — same rationale; verifyTreeItem below covers it.
205+
action: 'clickViewTitleAction "Java Projects" "Show Non-Java Resources"'
206+
# Real UI path through view-title overflow menu. After hide-non-java
207+
# the toggle now surfaces "Show Non-Java Resources". verifyTreeItem
208+
# below is authoritative.
205209

206210
- id: "wait-show"
207211
action: "wait 5 seconds"

0 commit comments

Comments
 (0)