-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathjava-webview-migration.yaml
More file actions
319 lines (288 loc) · 15.5 KB
/
Copy pathjava-webview-migration.yaml
File metadata and controls
319 lines (288 loc) · 15.5 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
# Test Plan: Java Pack Webview Migration (React 19 + @vscode-elements/elements)
#
# Source: PR https://github.com/microsoft/vscode-java-pack/pull/1616
# Screenshots in the PR comments verify the post-migration rendering of
# each webview page authored by the Extension Pack for Java.
#
# Goal: Open every webview that the PR migrated and assert the key headings,
# tab labels, and action buttons visible in the PR's screenshots are
# present in the rendered webview text. This guards against any regression
# where the React 19 / @vscode-elements/elements migration silently drops
# a panel or label.
#
# Coverage (from the PR description and screenshots):
# 1. Java Help Center — command "Java: Help Center" (java.welcome)
# 2. Tips for Beginners — command "Java: Tips for Beginners" (java.gettingStarted)
# 3. Install New JDK — command "Java: Install New JDK" (java.installJdk)
# 4. Configure Java Runtime — command "Java: Configure Java Runtime" (java.runtime)
# 5. Project Settings — command "Java: Open Project Settings" (java.projectSettings)
# 6. Configure Classpath — command "Java: Configure Classpath" (java.classpathConfiguration)
# 7. Formatter Settings — command "Java: Open Java Formatter Settings with Preview"
# (java.formatterSettings)
# 8. Overview — command "Java: Overview" (java.overview)
#
# Prerequisites:
# - vscode-java repo cloned as ../../vscode-java (provides the Maven sample project)
# - JDK installed (Project Settings / Configure Runtime need a working LS)
#
# Usage: npx autotest run test-plans/java-webview-migration.yaml
name: "Java Pack Webview Migration — UI Smoke (PR #1616)"
description: |
Open each webview migrated to React 19 + @vscode-elements/elements in PR #1616
and verify the headings, tab labels, and action buttons rendered in the PR's
screenshots are present in the actual webview text. A Maven sample project is
used so the Maven tab in Project Settings and the project list in Configure
Java Runtime become visible.
setup:
extension: "redhat.java"
extensions:
- "vscjava.vscode-java-pack"
vscodeVersion: "stable"
workspace: "../../vscode-java/test/resources/projects/maven/salut"
timeout: 120
# Pre-configure the formatter profile path so the Formatter Settings webview
# bypasses the "No active Formatter Profile found" notification (which the
# smoke-test driver suppresses, leaving the webview stuck). The profile XML
# itself is written by the "create-formatter-profile" step below.
workspaceSettings:
java.format.settings.url: ".vscode/java-formatter.xml"
steps:
# ── Wait for LS so commands that depend on it (Project Settings, Configure
# Java Runtime, Configure Classpath) have project data to render. ──────
- id: "ls-ready"
action: "waitForLanguageServer"
verify: "Maven salut workspace has loaded; the Java extension and the pack webview commands are ready"
# waitForLanguageServer is authoritative — skip LLM screenshot re-check
# (status bar may still show "Java: Searching... 0%" for background
# indexing right after the LS reports ready).
skipLlmVerify: true
timeout: 180
# ══════════════════════════════════════════════════════════════════════
# 1. Java Help Center (java.welcome)
# Screenshot shows: title "Java Help Center", side tabs General / Spring /
# Student, action links such as "Configure Java Runtime" and "Install
# Extensions...".
# ══════════════════════════════════════════════════════════════════════
- id: "open-help-center"
action: "run command Java: Help Center"
verify: "Java Help Center webview opens"
waitBefore: 1
- id: "verify-help-center"
action: "wait 3 seconds"
verify: "Help Center renders heading and navigation panels"
# Tab labels are rendered uppercase via CSS text-transform, so the DOM
# innerText returned by getWebviewText() is "GENERAL" / "SPRING" / "STUDENT".
verifyWebview:
contains:
- "Java Help Center"
- "GENERAL"
- "SPRING"
- "STUDENT"
- "Configure Java Runtime"
- "Install Extensions"
timeout: 30
- id: "close-help-center"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 2. Tips for Beginners (java.gettingStarted)
# Screenshot shows: title "Tips for Beginners", panel tabs Quick Start /
# Code Editing / Debugging / FAQ.
# ══════════════════════════════════════════════════════════════════════
- id: "open-beginner-tips"
action: "run command Java: Tips for Beginners"
verify: "Tips for Beginners webview opens"
waitBefore: 1
- id: "verify-beginner-tips"
action: "wait 3 seconds"
verify: "Tips for Beginners shows all four panel tabs"
verifyWebview:
contains:
- "Tips for Beginners"
- "Quick Start"
- "Code Editing"
- "Debugging"
- "FAQ"
timeout: 30
- id: "close-beginner-tips"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 3. Install New JDK (java.installJdk)
# Screenshot shows: title "Install New JDK", tabs "Adoptium's Temurin" /
# "Others", "Reload Window" button.
# ══════════════════════════════════════════════════════════════════════
- id: "open-install-jdk"
action: "run command Java: Install New JDK"
verify: "Install JDK webview opens"
waitBefore: 1
- id: "verify-install-jdk"
action: "wait 3 seconds"
verify: "Install JDK shows Adoptium / Others tabs and Reload Window button"
verifyWebview:
contains:
- "Install New JDK"
- "Adoptium"
- "Others"
- "Reload Window"
timeout: 30
- id: "close-install-jdk"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 4. Configure Java Runtime (java.runtime)
# The "Java: Configure Java Runtime" command is wired in src/commands/
# index.ts to projectSettingView.showProjectSettingsPage("classpath/jdk"),
# i.e. it opens the Project Settings webview focused on the JDK Runtime
# tab — not a standalone Java Runtime panel. So the migration regression
# we want to catch is that the Project Settings page renders its
# Classpath / JDK Runtime nav after the React 19 upgrade.
# ══════════════════════════════════════════════════════════════════════
- id: "open-java-runtime"
action: "run command Java: Configure Java Runtime"
# No `verify:` — transitional step. The next `verify-java-runtime`
# step waits 3s and asserts the rendered Classpath / JDK Runtime nav.
# On slower CI the screenshot taken at command-return can capture a
# blank webview before React renders, which trips the LLM re-verify.
waitBefore: 1
- id: "verify-java-runtime"
action: "wait 3 seconds"
verify: "Project Settings shows Classpath sidebar and JDK Runtime tab"
verifyWebview:
contains:
- "Classpath"
- "JDK Runtime"
timeout: 30
# Regression check: clicking the JDK dropdown opens a list. We do not
# enumerate which JDKs appear (that depends on the host runner), only
# that the vscode-elements <vscode-single-select> still wires up after
# the React 19 migration. clickInWebview throws if #jdk-dropdown is
# not present in any webview frame, so a silent migration regression
# surfaces as a hard error rather than a no-op pass.
- id: "open-jdk-dropdown"
action: "clickInWebview #jdk-dropdown"
verify: "JDK dropdown opens listing detected runtimes"
waitBefore: 1
- id: "verify-jdk-dropdown"
action: "wait 2 seconds"
verify: "screenshot shows the JDK dropdown expanded with at least one runtime entry"
- id: "close-java-runtime"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 5. Project Settings (java.projectSettings)
# Screenshot shows: sidebar Classpath / Compiler / Maven / Formatter and
# the Classpath section's three tabs Sources / JDK Runtime / Libraries.
# ══════════════════════════════════════════════════════════════════════
- id: "open-project-settings"
action: "run command Java: Open Project Settings"
verify: "Project Settings webview opens"
waitBefore: 1
- id: "verify-project-settings"
action: "wait 3 seconds"
verify: "Project Settings sidebar and Classpath tabs are visible"
verifyWebview:
contains:
- "Classpath"
- "Compiler"
- "Maven"
- "Formatter"
- "Sources"
- "JDK Runtime"
- "Libraries"
timeout: 30
- id: "close-project-settings"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 6. Configure Classpath (java.classpathConfiguration)
# Same React tree as Project Settings but launched via the standalone
# "Configure Classpath" command shown as the entry point in the PR's
# Help Center screenshot.
# ══════════════════════════════════════════════════════════════════════
- id: "open-classpath-config"
action: "run command Java: Configure Classpath"
# No `verify:` — transitional step. The next `verify-classpath-config`
# step waits 3s and asserts Sources / JDK Runtime / Libraries.
# Screenshot at command-return can be pre-render on slower CI.
waitBefore: 1
- id: "verify-classpath-config"
action: "wait 3 seconds"
verify: "Classpath configuration shows Sources / JDK Runtime / Libraries tabs"
verifyWebview:
contains:
- "Sources"
- "JDK Runtime"
- "Libraries"
timeout: 30
- id: "close-classpath-config"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 7. Formatter Settings (java.formatterSettings)
# Screenshot shows: title "Java Formatter Settings" and the side nav
# Indentation / Blank Lines / Comment / Insert Line / Whitespace /
# Wrapping.
#
# Precondition: showFormatterSettingsEditor() refuses to open the webview
# when `java.format.settings.url` points at a missing file or is unset
# (it falls back to a notification toast asking the user to create a
# profile, and the smoke-test driver suppresses those toasts). We set the
# setting via `setup.workspaceSettings` and create the XML profile below.
# ══════════════════════════════════════════════════════════════════════
- id: "create-formatter-profile"
action: |
insertLineInFile .vscode/java-formatter.xml 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="20">
<profile kind="CodeFormatterProfile" name="autotest" version="20">
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
</profile>
</profiles>
verify: "Eclipse formatter profile XML created in workspace"
verifyFile:
path: "~/.vscode/java-formatter.xml"
contains: "CodeFormatterProfile"
# Disk-only insertLineInFile against a file not in any editor.
# before/after screenshots are by-design identical.
skipLlmVerify: true
- id: "close-profile-file-before-formatter"
action: "run command View: Close All Editors"
- id: "open-formatter-settings"
action: "run command Java: Open Java Formatter Settings with Preview"
# No `verify:` — transitional step. The next `verify-formatter-settings`
# step waits 5s and asserts all six category labels via verifyWebview.
# On slower CI the screenshot can capture the formatter XML file still
# focused (before the webview takes focus).
waitBefore: 1
- id: "verify-formatter-settings"
action: "wait 5 seconds"
verify: "Formatter Settings webview is rendered"
# Deterministic check below is authoritative for the six categories.
# `verify:` text is intentionally generic — the LLM has been observed to
# hallucinate a specific category count off vertical label stacking.
verifyWebview:
contains:
- "Java Formatter Settings"
- "Indentation"
- "Blank Lines"
- "Comment"
- "Insert Line"
- "Whitespace"
- "Wrapping"
timeout: 45
- id: "close-formatter-settings"
action: "run command View: Close All Editors"
# ══════════════════════════════════════════════════════════════════════
# 8. Overview (java.overview)
# Not migrated in this PR (still on jQuery/Bootstrap), but the PR's
# "Testing" section verified Overview continues to render. Smoke-check
# that the page still loads to catch any side-effect regression from
# the React 19 upgrade.
# ══════════════════════════════════════════════════════════════════════
- id: "open-overview"
action: "run command Java: Overview"
verify: "Overview webview opens"
waitBefore: 1
- id: "verify-overview"
action: "wait 3 seconds"
verify: "Overview page still renders after the migration"
verifyWebview:
contains:
- "Overview"
timeout: 30
- id: "close-overview"
action: "run command View: Close All Editors"