-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathjava-dep-new-types.yaml
More file actions
339 lines (262 loc) · 10.1 KB
/
Copy pathjava-dep-new-types.yaml
File metadata and controls
339 lines (262 loc) · 10.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# Test Plan: Java Dependency — New File Types
#
# Covers the "New..." quick-pick options from the Java Projects view that are
# NOT already covered by java-dep-file-operations.yaml (which only tests
# `New Class` and `New Package`).
#
# Commands exercised (each invoked through the New... quick-pick on a node):
# - java.view.package.newJavaInterface (Interface)
# - java.view.package.newJavaEnum (Enum)
# - java.view.package.newJavaRecord (Record — requires Java 16+)
# - java.view.package.newJavaAnnotation (Annotation)
# - java.view.package.newJavaAbstractClass (Abstract Class)
# - java.view.package.newFile ("File" option)
# - java.view.package.newFolder ("Folder" option)
#
# Pattern for each type (same as the existing New Class flow):
# 1. click `my-app` in the JAVA PROJECTS view
# 2. clickTreeItemAction my-app New... (triggers java.view.package.new)
# 3. select <type> option in the quick pick
# 4. select src/main/java source-folder option (where applicable)
# 5. fillQuickInput <Name>
# 6. verifyEditorTab — confirms the new file was created and opened
#
# Between each cycle the previously-created file is saved + all editors are
# closed and the JAVA PROJECTS tree is collapsed, mirroring the technique
# used in java-dep-file-operations.yaml.
#
# Usage:
# npx autotest run test/e2e-plans/java-dep-new-types.yaml --vsix <path-to-vsix>
name: "Java Dependency — New File Types"
description: |
Tests all the "New ..." quick-pick options in the Java Projects view that
are not already covered by java-dep-file-operations.yaml:
Interface / Enum / Record / Annotation / Abstract Class / File / Folder.
setup:
extension: "redhat.java"
vscodeVersion: "stable"
workspace: "../maven"
timeout: 240
settings:
java.configuration.checkProjectSettingsExclusions: false
workbench.startupEditor: "none"
steps:
# ── Setup ──
- id: "ls-ready"
action: "waitForLanguageServer"
# No `verify:` — waitForLanguageServer is itself the deterministic
# readiness check; see java-dep-file-operations.yaml for rationale.
timeout: 180
- id: "close-aux-bar"
action: "executeVSCodeCommand workbench.action.closeAuxiliaryBar"
verify: "Auxiliary bar (Chat) closed"
# Collapse the MAVEN workspace-folder pane so JAVA PROJECTS gets the full
# vertical space. OUTLINE and TIMELINE are collapsed by default in fresh
# sessions, so no explicit step is needed.
- id: "collapse-maven-pane"
action: "collapseSidebarSection maven"
- id: "focus-java-projects"
action: "executeVSCodeCommand javaProjectExplorer.focus"
verify: "Java Projects view is focused"
- id: "wait-tree-load"
action: "wait 3 seconds"
# ── Test 1: New Interface ──
- id: "click-project-1"
action: "click my-app tree item"
- id: "trigger-new-1"
action: "clickTreeItemAction my-app New..."
verify: "New resource quick pick opened"
- id: "select-interface"
action: "select Interface option"
# No `verify:` — LLM screenshot check is flaky when the quick-pick
# advances immediately after selection (LLM sees the next page and
# mistakes the advance for "selection not visible"). The downstream
# fillQuickInput / file creation provides authoritative verification.
- id: "select-source-folder-1"
action: "select src/main/java option"
- id: "enter-interface-name"
action: "fillQuickInput MyInterface"
# No `verify:` — fillQuickInput submits and closes the quick input. The
# deterministic `verifyEditorTab` below is the ground truth.
- id: "verify-interface-tab"
action: "wait 2 seconds"
# No `verify:` — BEFORE/AFTER screenshots are identical once the editor
# tab is open; verifyEditorTab is authoritative.
verifyEditorTab:
title: "MyInterface.java"
timeout: 20
# Reset between cycles: save the dirty buffer, close editors, refocus.
- id: "save-1"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-1"
action: "run command View: Close All Editors"
- id: "collapse-tree-1"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-2"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-2"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 2: New Enum ──
- id: "click-project-2"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-2"
action: "clickTreeItemAction my-app New..."
- id: "select-enum"
action: "select Enum option"
- id: "select-source-folder-2"
action: "select src/main/java option"
- id: "enter-enum-name"
action: "fillQuickInput MyEnum"
- id: "verify-enum-tab"
action: "wait 2 seconds"
verifyEditorTab:
title: "MyEnum.java"
timeout: 20
- id: "save-2"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-2"
action: "run command View: Close All Editors"
- id: "collapse-tree-2"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-3"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-3"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 3: New Annotation ──
- id: "click-project-3"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-3"
action: "clickTreeItemAction my-app New..."
- id: "select-annotation"
action: "select Annotation option"
- id: "select-source-folder-3"
action: "select src/main/java option"
- id: "enter-annotation-name"
action: "fillQuickInput MyAnnotation"
- id: "verify-annotation-tab"
action: "wait 2 seconds"
verifyEditorTab:
title: "MyAnnotation.java"
timeout: 20
- id: "save-3"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-3"
action: "run command View: Close All Editors"
- id: "collapse-tree-3"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-4"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-4"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 4: New Record (Java 16+; fixture pom uses Java 17) ──
# The Record option is only shown when the project source level is >= 16,
# see JavaType.getDisplayNames(..., includeRecord) in src/explorerCommands/new.ts.
- id: "click-project-4"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-4"
action: "clickTreeItemAction my-app New..."
- id: "select-record"
action: "select Record option"
- id: "select-source-folder-4"
action: "select src/main/java option"
- id: "enter-record-name"
action: "fillQuickInput MyRecord"
- id: "verify-record-tab"
action: "wait 2 seconds"
verifyEditorTab:
title: "MyRecord.java"
timeout: 20
- id: "save-4"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-4"
action: "run command View: Close All Editors"
- id: "collapse-tree-4"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-5"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-5"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 5: New Abstract Class ──
- id: "click-project-5"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-5"
action: "clickTreeItemAction my-app New..."
- id: "select-abstract-class"
action: "select Abstract Class option"
- id: "select-source-folder-5"
action: "select src/main/java option"
- id: "enter-abstract-name"
action: "fillQuickInput MyAbstract"
- id: "verify-abstract-tab"
action: "wait 2 seconds"
verifyEditorTab:
title: "MyAbstract.java"
timeout: 20
- id: "save-5"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-5"
action: "run command View: Close All Editors"
- id: "collapse-tree-5"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-6"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-6"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 6: New File (plain non-Java file via "File" option) ──
# The "File" entry routes to `java.view.package.newFile` and writes the
# file under the project root (the node we triggered from).
- id: "click-project-6"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-6"
action: "clickTreeItemAction my-app New..."
- id: "select-file"
action: "select File option"
- id: "enter-file-name"
action: "fillQuickInput notes.txt"
- id: "verify-file-tab"
action: "wait 2 seconds"
verifyEditorTab:
title: "notes.txt"
timeout: 20
- id: "save-6"
action: "executeVSCodeCommand workbench.action.files.saveAll"
- id: "close-editors-6"
action: "run command View: Close All Editors"
- id: "collapse-tree-6"
action: 'clickViewTitleAction "Java Projects" "Collapse All"'
- id: "collapse-workspace-root-7"
action: "collapseWorkspaceRoot"
- id: "focus-java-projects-7"
action: "executeVSCodeCommand javaProjectExplorer.focus"
waitBefore: 1
# ── Test 7: New Folder ──
# Folder creation has no editor side-effect — verify by checking the new
# folder exists on disk under the workspace root.
- id: "click-project-7"
action: "click my-app tree item"
waitBefore: 1
- id: "trigger-new-7"
action: "clickTreeItemAction my-app New..."
- id: "select-folder"
action: "select Folder option"
- id: "enter-folder-name"
action: "fillQuickInput my-new-folder"
- id: "wait-folder-create"
action: "wait 2 seconds"
# No `verify:` — folder creation has no editor side-effect, so the
# BEFORE/AFTER screenshots are nearly identical and a screenshot LLM
# would downgrade. The deterministic verifyFile below is authoritative.
verifyFile:
path: "~/my-new-folder"
exists: true
timeout: 15