Skip to content

Commit b2c3adc

Browse files
wenytang-msCopilot
andcommitted
test: add E2E plans for view modes, new types, and build lifecycle
Adds three new YAML test plans driven by @vscjava/vscode-autotest to cover Java Project Manager commands that were not previously exercised by the existing e2e plans. - java-dep-view-modes.yaml (33 steps) Hierarchical / Flat package view, Refresh, Hide / Show non-Java resources. Scopes verifyTreeItem to the Java Projects pane to avoid cross-view contamination from the File Explorer. - java-dep-new-types.yaml (66 steps) New Interface / Enum / Annotation / Abstract Class / File / Folder via the Java: New... quick-pick. Verifies file creation, opened editor tab, and tree-item presence under the source folder. - java-dep-build-lifecycle.yaml (20 steps) Build All / Rebuild All (workspace) and Build Project / Rebuild Project (per project context menu) and Reload Project From Active File (pom.xml editor title). Each build is followed by waitForLanguageServer to confirm the LS returns to Ready. java.project.clean.workspace is intentionally skipped because it triggers a VS Code window reload. All three plans pass locally against the packaged extension VSIX. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e9ae840 commit b2c3adc

3 files changed

Lines changed: 669 additions & 0 deletions

File tree

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Test Plan: Java Dependency — Build Lifecycle
2+
#
3+
# Covers the project build / rebuild / reload commands contributed by
4+
# vscode-java-dependency. Each command is invoked through the documented
5+
# entry point (view title-bar action, overflow menu, project context menu,
6+
# or editor title-bar action) and verified by waiting for the Java Language
7+
# Server to return to the Ready state.
8+
#
9+
# Commands exercised:
10+
# - java.project.build.workspace (Build All — title-bar tools icon)
11+
# - java.project.rebuild.workspace (Rebuild All — overflow menu)
12+
# - java.project.build.project (Build Project — project context menu)
13+
# - java.project.rebuild (Rebuild Project — project context menu)
14+
# - java.project.reloadProjectFromActiveFile (Reload Project — pom.xml editor title)
15+
#
16+
# Note: java.project.clean.workspace is intentionally omitted from this plan
17+
# because the JDT.LS clean command triggers a VS Code window reload, which
18+
# tears down the autotest browser session.
19+
#
20+
# Verification strategy
21+
# ─────────────────────
22+
# Build commands have no visible editor side-effect — they trigger a
23+
# background compilation whose progress is reflected only in the status bar
24+
# (and briefly in the Java Language Server progress notifications). For each
25+
# build / rebuild, we run the command and then call `waitForLanguageServer`,
26+
# which polls the status bar until it returns to "Java: Ready" and the
27+
# post-Ready "Building - X%" phase has settled. A non-fatal command is
28+
# enough for the step to pass — the test asserts that the command does not
29+
# leave the LS hung or in an error state.
30+
#
31+
# Usage:
32+
# npx autotest run test/e2e-plans/java-dep-build-lifecycle.yaml --vsix <path-to-vsix>
33+
34+
name: "Java Dependency — Build Lifecycle"
35+
description: |
36+
Tests the build / rebuild / reload commands contributed by the Java
37+
Project Manager. Each command is verified by waiting for the Java
38+
Language Server to return to the Ready state after the command runs.
39+
40+
setup:
41+
extension: "redhat.java"
42+
vscodeVersion: "stable"
43+
workspace: "../maven"
44+
timeout: 240
45+
settings:
46+
java.configuration.checkProjectSettingsExclusions: false
47+
workbench.startupEditor: "none"
48+
49+
steps:
50+
# ── Setup ──
51+
- id: "ls-ready"
52+
action: "waitForLanguageServer"
53+
timeout: 180
54+
55+
- id: "close-aux-bar"
56+
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
57+
verify: "Auxiliary bar (Chat) closed"
58+
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"
67+
68+
- id: "focus-java-projects"
69+
action: "executeVSCodeCommand javaProjectExplorer.focus"
70+
verify: "Java Projects view is focused"
71+
72+
- id: "wait-tree-load"
73+
action: "wait 3 seconds"
74+
75+
# ── Test 1: Build All (incremental) ──
76+
- 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.
83+
84+
- id: "wait-build-all"
85+
action: "waitForLanguageServer"
86+
timeout: 120
87+
88+
# ── Test 2: Rebuild All (full compile) ──
89+
- id: "trigger-rebuild-all"
90+
action: "executeVSCodeCommand java.project.rebuild.workspace"
91+
# No `verify:` — same rationale as trigger-build-all.
92+
93+
- id: "wait-rebuild-all"
94+
action: "waitForLanguageServer"
95+
timeout: 180
96+
97+
# ── Test 3: Build Project (per-project, via context menu) ──
98+
# 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.
101+
- id: "click-project-build"
102+
action: "click my-app tree item"
103+
waitBefore: 1
104+
105+
- id: "context-build-project"
106+
action: "contextMenu my-app Build Project"
107+
# No `verify:` — context-menu click has no immediate visible effect
108+
# beyond closing the menu; waitForLanguageServer below is the ground
109+
# truth that the build executed and the LS settled.
110+
111+
- id: "wait-build-project"
112+
action: "waitForLanguageServer"
113+
timeout: 120
114+
115+
# ── Test 4: Rebuild Project (per-project, via context menu) ──
116+
- id: "click-project-rebuild"
117+
action: "click my-app tree item"
118+
waitBefore: 1
119+
120+
- id: "context-rebuild-project"
121+
action: "contextMenu my-app Rebuild Project"
122+
123+
- id: "wait-rebuild-project"
124+
action: "waitForLanguageServer"
125+
timeout: 180
126+
127+
# ── 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.
133+
- id: "open-pom"
134+
action: "open file pom.xml"
135+
waitBefore: 3
136+
137+
- id: "trigger-reload-project"
138+
action: "executeVSCodeCommand java.project.reloadProjectFromActiveFile"
139+
# No `verify:` — reload is async; deterministic waitForLanguageServer
140+
# below covers the outcome.
141+
142+
- id: "wait-reload-project"
143+
action: "waitForLanguageServer"
144+
timeout: 180

0 commit comments

Comments
 (0)