-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathjava-basic-editing.yaml
More file actions
178 lines (153 loc) · 7.1 KB
/
Copy pathjava-basic-editing.yaml
File metadata and controls
178 lines (153 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Test Plan: Java Basic (from vscode-java-pack.wiki)
#
# Source: wiki Test-Plan.md "Basic" scenario (Steps 1-8)
# Verifies: LS ready → class snippet → Code Action → completion → Organize Imports → Rename
#
# Prerequisites:
# - vscode-java repo cloned locally
# - JDK installed
#
# Usage: autotest run test-plans/java-basic-editing.yaml
name: "Java Basic — Full Scenario (Steps 1-8)"
description: |
Wiki Basic scenario steps 1-8 in a single run:
1-2: Open simple-app, verify LS ready with 2 errors
3: Class snippet to fix Foo.java
4: Code Action to create missing call() method
5: Save all, verify 0 errors
6: Type File code, verify completion
7: Organize Imports (Shift+Alt+O)
8: Rename Symbol (F2)
setup:
extension: "redhat.java"
extensions:
- "vscjava.vscode-java-pack"
vscodeVersion: "stable"
workspace: "../../vscode-java/test/resources/projects/eclipse/simple-app"
timeout: 60
steps:
# ══════════════════════════════════════════════════════════
# Steps 1-5: Diagnostics, Snippet, Code Action
# ══════════════════════════════════════════════════════════
# ── Step 1: Project loaded ──────────────────────────────────
- id: "project-loaded"
action: "wait 5 seconds"
verify: "Project file tree is visible"
# ── Step 2: LS ready + 2 errors ─────────────────────────────
# wiki: "status bar icon is 👍, problems view shows 2 errors"
# The Problems panel is not auto-opened; verify text describes the
# workspace-loaded state that's persistently visible in the editor
# window (project tree, no progress indicator). The deterministic
# verifyProblems.errors:2 polls the diagnostics API directly so the
# error count is checked regardless of whether the panel is open.
- id: "ls-ready"
action: "waitForLanguageServer"
verify: "Java extension has activated and the simple-app project tree is visible in the Explorer sidebar"
skipLlmVerify: true # waitForLanguageServer reads the same status bar text the LLM would inspect
verifyProblems:
errors: 2
timeout: 120
# ── Step 3: Class snippet in Foo.java ───────────────────────
- id: "open-foo"
action: "open file Foo.java"
verify: "Foo.java is open in editor"
waitBefore: 5
timeout: 15
- id: "type-class-snippet"
action: "typeAndTriggerSnippet class"
verify: "Class skeleton generated via snippet"
verifyEditor:
contains: "public class Foo"
timeout: 30
- id: "save-foo"
action: "saveFile"
verifyProblems:
errors: 1
timeout: 30
# ── Step 4: Code Action to create call() ────────────────────
- id: "close-all-before-codeaction"
action: "run command View: Close All Editors"
- id: "navigate-to-error"
action: "navigateToError 1"
verify: "Cursor jumped to f.call() error in Bar.java"
- id: "apply-code-action"
action: "applyCodeAction Create method 'call()'"
verify: "Code Action created call() method in Foo.java"
timeout: 15
# ── Step 5: Save all + verify 0 errors ──────────────────────
# The verify text only describes what's reliably observable when the
# command runs — the command palette has closed and no error toast
# was raised. The unsaved-indicator dot on tabs depends on which
# files were modified (apply-code-action edits Foo.java which may
# not be the currently active tab), so we avoid asserting on it.
# Ground truth: verifyProblems.errors:0.
- id: "save-all-step5"
action: "run command File: Save All"
verify: "File: Save All command has been invoked; no error notification toast appeared"
verifyProblems:
errors: 0
timeout: 60
# ══════════════════════════════════════════════════════════
# Steps 6-8: Completion, Organize Imports, Rename
# ══════════════════════════════════════════════════════════
# Close all editors to prevent duplicate tab issues
- id: "close-all-before-step6"
action: "run command View: Close All Editors"
# ── Step 6: Type File code ────────────────────────────────
# Use insertLineInFile so LS properly detects the unresolved File type
- id: "open-app"
action: "open file App.java"
verify: "App.java is open in editor"
timeout: 10
- id: "insert-file-code"
action: "insertLineInFile src/app/App.java 6 File f = new File(\"demo.txt\");"
verifyEditor:
contains: "File f = new File"
verifyProblems:
errors: 1
atLeast: true
timeout: 30
# ── Step 7: Organize Imports (Shift+Alt+O) ──────────────────
- id: "organize-imports"
action: "organizeImports"
verify: "Organize Imports resolved File type"
timeout: 15
# Save all — LS may write the import to a second tab (dual-tab issue on CI).
# The visible editor tab may show a different file than App.java, so the
# verify text describes only the command invocation. The disk-side check
# (verifyFile.contains "import java.io.File") is the ground truth.
- id: "save-after-organize"
action: "run command File: Save All"
verify: "File: Save All command has been invoked to persist the Organize Imports change to disk"
verifyFile:
path: "~/src/app/App.java"
contains: "import java.io.File"
timeout: 10
# Save All has no on-screen change (tab dirty dot clears on the saved
# tab but the active editor isn't the saved file). LLM downgrades on
# before==after by-design.
skipLlmVerify: true
# ── Step 8: Rename Symbol (F2) ──────────────────────────────
- id: "close-all-before-rename"
action: "run command View: Close All Editors"
- id: "open-foo-for-rename"
action: "open file Foo.java"
verify: "Foo.java is open in editor"
timeout: 10
# Place cursor on "Foo" — use Find to locate the text, then close Find (cursor stays on it)
- id: "find-foo-class"
action: "findText Foo"
- id: "rename-foo-to-foonew"
action: "renameSymbol FooNew"
timeout: 15
# LS renames file to FooNew.java — close stale tab and click renamed file in Explorer
- id: "save-after-rename"
action: "run command File: Save All"
- id: "close-all-after-rename"
action: "run command View: Close All Editors"
- id: "click-foonew-in-explorer"
action: "doubleClick FooNew.java"
verify: "FooNew.java shows renamed class"
verifyEditor:
contains: "public class FooNew"
timeout: 15