|
| 1 | +# Test Plan: Java Pack Webview Migration (React 19 + @vscode-elements/elements) |
| 2 | +# |
| 3 | +# Source: PR https://github.com/microsoft/vscode-java-pack/pull/1616 |
| 4 | +# Screenshots in the PR comments verify the post-migration rendering of |
| 5 | +# each webview page authored by the Extension Pack for Java. |
| 6 | +# |
| 7 | +# Goal: Open every webview that the PR migrated and assert the key headings, |
| 8 | +# tab labels, and action buttons visible in the PR's screenshots are |
| 9 | +# present in the rendered webview text. This guards against any regression |
| 10 | +# where the React 19 / @vscode-elements/elements migration silently drops |
| 11 | +# a panel or label. |
| 12 | +# |
| 13 | +# Coverage (from the PR description and screenshots): |
| 14 | +# 1. Java Help Center — command "Java: Help Center" (java.welcome) |
| 15 | +# 2. Tips for Beginners — command "Java: Tips for Beginners" (java.gettingStarted) |
| 16 | +# 3. Install New JDK — command "Java: Install New JDK" (java.installJdk) |
| 17 | +# 4. Configure Java Runtime — command "Java: Configure Java Runtime" (java.runtime) |
| 18 | +# 5. Project Settings — command "Java: Open Project Settings" (java.projectSettings) |
| 19 | +# 6. Configure Classpath — command "Java: Configure Classpath" (java.classpathConfiguration) |
| 20 | +# 7. Formatter Settings — command "Java: Open Java Formatter Settings with Preview" |
| 21 | +# (java.formatterSettings) |
| 22 | +# 8. Overview — command "Java: Overview" (java.overview) |
| 23 | +# |
| 24 | +# Prerequisites: |
| 25 | +# - vscode-java repo cloned as ../../vscode-java (provides the Maven sample project) |
| 26 | +# - JDK installed (Project Settings / Configure Runtime need a working LS) |
| 27 | +# |
| 28 | +# Usage: npx autotest run test-plans/java-webview-migration.yaml |
| 29 | + |
| 30 | +name: "Java Pack Webview Migration — UI Smoke (PR #1616)" |
| 31 | +description: | |
| 32 | + Open each webview migrated to React 19 + @vscode-elements/elements in PR #1616 |
| 33 | + and verify the headings, tab labels, and action buttons rendered in the PR's |
| 34 | + screenshots are present in the actual webview text. A Maven sample project is |
| 35 | + used so the Maven tab in Project Settings and the project list in Configure |
| 36 | + Java Runtime become visible. |
| 37 | +
|
| 38 | +setup: |
| 39 | + extension: "redhat.java" |
| 40 | + extensions: |
| 41 | + - "vscjava.vscode-java-pack" |
| 42 | + vscodeVersion: "stable" |
| 43 | + workspace: "../../vscode-java/test/resources/projects/maven/salut" |
| 44 | + timeout: 120 |
| 45 | + # Pre-configure the formatter profile path so the Formatter Settings webview |
| 46 | + # bypasses the "No active Formatter Profile found" notification (which the |
| 47 | + # smoke-test driver suppresses, leaving the webview stuck). The profile XML |
| 48 | + # itself is written by the "create-formatter-profile" step below. |
| 49 | + workspaceSettings: |
| 50 | + java.format.settings.url: ".vscode/java-formatter.xml" |
| 51 | + |
| 52 | +steps: |
| 53 | + # ── Wait for LS so commands that depend on it (Project Settings, Configure |
| 54 | + # Java Runtime, Configure Classpath) have project data to render. ────── |
| 55 | + - id: "ls-ready" |
| 56 | + action: "waitForLanguageServer" |
| 57 | + verify: "Status bar shows Java Language Server is ready" |
| 58 | + timeout: 180 |
| 59 | + |
| 60 | + # ══════════════════════════════════════════════════════════════════════ |
| 61 | + # 1. Java Help Center (java.welcome) |
| 62 | + # Screenshot shows: title "Java Help Center", side tabs General / Spring / |
| 63 | + # Student, action links such as "Configure Java Runtime" and "Install |
| 64 | + # Extensions...". |
| 65 | + # ══════════════════════════════════════════════════════════════════════ |
| 66 | + - id: "open-help-center" |
| 67 | + action: "run command Java: Help Center" |
| 68 | + verify: "Java Help Center webview opens" |
| 69 | + waitBefore: 1 |
| 70 | + |
| 71 | + - id: "verify-help-center" |
| 72 | + action: "wait 3 seconds" |
| 73 | + verify: "Help Center renders heading and navigation panels" |
| 74 | + # Tab labels are rendered uppercase via CSS text-transform, so the DOM |
| 75 | + # innerText returned by getWebviewText() is "GENERAL" / "SPRING" / "STUDENT". |
| 76 | + verifyWebview: |
| 77 | + contains: |
| 78 | + - "Java Help Center" |
| 79 | + - "GENERAL" |
| 80 | + - "SPRING" |
| 81 | + - "STUDENT" |
| 82 | + - "Configure Java Runtime" |
| 83 | + - "Install Extensions" |
| 84 | + timeout: 30 |
| 85 | + |
| 86 | + - id: "close-help-center" |
| 87 | + action: "run command Workbench: Close All Editors" |
| 88 | + |
| 89 | + # ══════════════════════════════════════════════════════════════════════ |
| 90 | + # 2. Tips for Beginners (java.gettingStarted) |
| 91 | + # Screenshot shows: title "Tips for Beginners", panel tabs Quick Start / |
| 92 | + # Code Editing / Debugging / FAQ. |
| 93 | + # ══════════════════════════════════════════════════════════════════════ |
| 94 | + - id: "open-beginner-tips" |
| 95 | + action: "run command Java: Tips for Beginners" |
| 96 | + verify: "Tips for Beginners webview opens" |
| 97 | + waitBefore: 1 |
| 98 | + |
| 99 | + - id: "verify-beginner-tips" |
| 100 | + action: "wait 3 seconds" |
| 101 | + verify: "Tips for Beginners shows all four panel tabs" |
| 102 | + verifyWebview: |
| 103 | + contains: |
| 104 | + - "Tips for Beginners" |
| 105 | + - "Quick Start" |
| 106 | + - "Code Editing" |
| 107 | + - "Debugging" |
| 108 | + - "FAQ" |
| 109 | + timeout: 30 |
| 110 | + |
| 111 | + - id: "close-beginner-tips" |
| 112 | + action: "run command Workbench: Close All Editors" |
| 113 | + |
| 114 | + # ══════════════════════════════════════════════════════════════════════ |
| 115 | + # 3. Install New JDK (java.installJdk) |
| 116 | + # Screenshot shows: title "Install New JDK", tabs "Adoptium's Temurin" / |
| 117 | + # "Others", "Reload Window" button. |
| 118 | + # ══════════════════════════════════════════════════════════════════════ |
| 119 | + - id: "open-install-jdk" |
| 120 | + action: "run command Java: Install New JDK" |
| 121 | + verify: "Install JDK webview opens" |
| 122 | + waitBefore: 1 |
| 123 | + |
| 124 | + - id: "verify-install-jdk" |
| 125 | + action: "wait 3 seconds" |
| 126 | + verify: "Install JDK shows Adoptium / Others tabs and Reload Window button" |
| 127 | + verifyWebview: |
| 128 | + contains: |
| 129 | + - "Install New JDK" |
| 130 | + - "Adoptium" |
| 131 | + - "Others" |
| 132 | + - "Reload Window" |
| 133 | + timeout: 30 |
| 134 | + |
| 135 | + - id: "close-install-jdk" |
| 136 | + action: "run command Workbench: Close All Editors" |
| 137 | + |
| 138 | + # ══════════════════════════════════════════════════════════════════════ |
| 139 | + # 4. Configure Java Runtime (java.runtime) |
| 140 | + # The "Java: Configure Java Runtime" command is wired in src/commands/ |
| 141 | + # index.ts to projectSettingView.showProjectSettingsPage("classpath/jdk"), |
| 142 | + # i.e. it opens the Project Settings webview focused on the JDK Runtime |
| 143 | + # tab — not a standalone Java Runtime panel. So the migration regression |
| 144 | + # we want to catch is that the Project Settings page renders its |
| 145 | + # Classpath / JDK Runtime nav after the React 19 upgrade. |
| 146 | + # ══════════════════════════════════════════════════════════════════════ |
| 147 | + - id: "open-java-runtime" |
| 148 | + action: "run command Java: Configure Java Runtime" |
| 149 | + verify: "Project Settings webview opens focused on JDK Runtime" |
| 150 | + waitBefore: 1 |
| 151 | + |
| 152 | + - id: "verify-java-runtime" |
| 153 | + action: "wait 3 seconds" |
| 154 | + verify: "Project Settings shows Classpath sidebar and JDK Runtime tab" |
| 155 | + verifyWebview: |
| 156 | + contains: |
| 157 | + - "Classpath" |
| 158 | + - "JDK Runtime" |
| 159 | + timeout: 30 |
| 160 | + |
| 161 | + - id: "close-java-runtime" |
| 162 | + action: "run command Workbench: Close All Editors" |
| 163 | + |
| 164 | + # ══════════════════════════════════════════════════════════════════════ |
| 165 | + # 5. Project Settings (java.projectSettings) |
| 166 | + # Screenshot shows: sidebar Classpath / Compiler / Maven / Formatter and |
| 167 | + # the Classpath section's three tabs Sources / JDK Runtime / Libraries. |
| 168 | + # ══════════════════════════════════════════════════════════════════════ |
| 169 | + - id: "open-project-settings" |
| 170 | + action: "run command Java: Open Project Settings" |
| 171 | + verify: "Project Settings webview opens" |
| 172 | + waitBefore: 1 |
| 173 | + |
| 174 | + - id: "verify-project-settings" |
| 175 | + action: "wait 3 seconds" |
| 176 | + verify: "Project Settings sidebar and Classpath tabs are visible" |
| 177 | + verifyWebview: |
| 178 | + contains: |
| 179 | + - "Classpath" |
| 180 | + - "Compiler" |
| 181 | + - "Maven" |
| 182 | + - "Formatter" |
| 183 | + - "Sources" |
| 184 | + - "JDK Runtime" |
| 185 | + - "Libraries" |
| 186 | + timeout: 30 |
| 187 | + |
| 188 | + - id: "close-project-settings" |
| 189 | + action: "run command Workbench: Close All Editors" |
| 190 | + |
| 191 | + # ══════════════════════════════════════════════════════════════════════ |
| 192 | + # 6. Configure Classpath (java.classpathConfiguration) |
| 193 | + # Same React tree as Project Settings but launched via the standalone |
| 194 | + # "Configure Classpath" command shown as the entry point in the PR's |
| 195 | + # Help Center screenshot. |
| 196 | + # ══════════════════════════════════════════════════════════════════════ |
| 197 | + - id: "open-classpath-config" |
| 198 | + action: "run command Java: Configure Classpath" |
| 199 | + verify: "Classpath configuration webview opens" |
| 200 | + waitBefore: 1 |
| 201 | + |
| 202 | + - id: "verify-classpath-config" |
| 203 | + action: "wait 3 seconds" |
| 204 | + verify: "Classpath configuration shows Sources / JDK Runtime / Libraries tabs" |
| 205 | + verifyWebview: |
| 206 | + contains: |
| 207 | + - "Sources" |
| 208 | + - "JDK Runtime" |
| 209 | + - "Libraries" |
| 210 | + timeout: 30 |
| 211 | + |
| 212 | + - id: "close-classpath-config" |
| 213 | + action: "run command Workbench: Close All Editors" |
| 214 | + |
| 215 | + # ══════════════════════════════════════════════════════════════════════ |
| 216 | + # 7. Formatter Settings (java.formatterSettings) |
| 217 | + # Screenshot shows: title "Java Formatter Settings" and the side nav |
| 218 | + # Indentation / Blank Lines / Comment / Insert Line / Whitespace / |
| 219 | + # Wrapping. |
| 220 | + # |
| 221 | + # Precondition: showFormatterSettingsEditor() refuses to open the webview |
| 222 | + # when `java.format.settings.url` points at a missing file or is unset |
| 223 | + # (it falls back to a notification toast asking the user to create a |
| 224 | + # profile, and the smoke-test driver suppresses those toasts). We set the |
| 225 | + # setting via `setup.workspaceSettings` and create the XML profile below. |
| 226 | + # ══════════════════════════════════════════════════════════════════════ |
| 227 | + - id: "create-formatter-profile" |
| 228 | + action: | |
| 229 | + insertLineInFile .vscode/java-formatter.xml 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 230 | + <profiles version="20"> |
| 231 | + <profile kind="CodeFormatterProfile" name="autotest" version="20"> |
| 232 | + <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> |
| 233 | + </profile> |
| 234 | + </profiles> |
| 235 | + verify: "Eclipse formatter profile XML created in workspace" |
| 236 | + verifyFile: |
| 237 | + path: "~/.vscode/java-formatter.xml" |
| 238 | + contains: "CodeFormatterProfile" |
| 239 | + |
| 240 | + - id: "close-profile-file-before-formatter" |
| 241 | + action: "run command Workbench: Close All Editors" |
| 242 | + |
| 243 | + - id: "open-formatter-settings" |
| 244 | + action: "run command Java: Open Java Formatter Settings with Preview" |
| 245 | + verify: "Formatter Settings webview opens" |
| 246 | + waitBefore: 1 |
| 247 | + |
| 248 | + - id: "verify-formatter-settings" |
| 249 | + action: "wait 5 seconds" |
| 250 | + verify: "Formatter Settings shows all six categories" |
| 251 | + verifyWebview: |
| 252 | + contains: |
| 253 | + - "Java Formatter Settings" |
| 254 | + - "Indentation" |
| 255 | + - "Blank Lines" |
| 256 | + - "Comment" |
| 257 | + - "Insert Line" |
| 258 | + - "Whitespace" |
| 259 | + - "Wrapping" |
| 260 | + timeout: 45 |
| 261 | + |
| 262 | + - id: "close-formatter-settings" |
| 263 | + action: "run command Workbench: Close All Editors" |
| 264 | + |
| 265 | + # ══════════════════════════════════════════════════════════════════════ |
| 266 | + # 8. Overview (java.overview) |
| 267 | + # Not migrated in this PR (still on jQuery/Bootstrap), but the PR's |
| 268 | + # "Testing" section verified Overview continues to render. Smoke-check |
| 269 | + # that the page still loads to catch any side-effect regression from |
| 270 | + # the React 19 upgrade. |
| 271 | + # ══════════════════════════════════════════════════════════════════════ |
| 272 | + - id: "open-overview" |
| 273 | + action: "run command Java: Overview" |
| 274 | + verify: "Overview webview opens" |
| 275 | + waitBefore: 1 |
| 276 | + |
| 277 | + - id: "verify-overview" |
| 278 | + action: "wait 3 seconds" |
| 279 | + verify: "Overview page still renders after the migration" |
| 280 | + verifyWebview: |
| 281 | + contains: |
| 282 | + - "Overview" |
| 283 | + timeout: 30 |
| 284 | + |
| 285 | + - id: "close-overview" |
| 286 | + action: "run command Workbench: Close All Editors" |
0 commit comments