Skip to content

Commit 13599cd

Browse files
committed
test: add test case
1 parent ddf844b commit 13599cd

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

test-plans/java-extension-pack.yaml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Test Plan: Java Extension Pack — Classpath Configuration (from vscode-java-pack.wiki)
22
#
33
# Source: wiki Test-Plan.md "Java Extension Pack" scenario
4-
# Verify: Trigger Java: Configure Classpath command → configuration page appears
5-
#
6-
# Note: Classpath configuration uses a webview; the current framework has limited support
7-
# for webview internal interactions — only verifies the command can be triggered and the page appears.
4+
# Verify: Trigger Java: Configure Classpath command → configuration page appears;
5+
# add a project-local JAR to a non-unmanaged project and apply it.
86
#
97
# Prerequisites:
108
# - vscode-java repo is cloned locally
@@ -15,14 +13,15 @@
1513
name: "Java Extension Pack — Classpath Configuration"
1614
description: |
1715
Corresponds to the Java Extension Pack scenario in the wiki Test Plan:
18-
Trigger the Java: Configure Classpath command and verify the configuration page appears.
16+
Trigger the Java: Configure Classpath command, verify the configuration page
17+
appears, and cover the non-unmanaged-project Add Library flow.
1918
2019
setup:
2120
extension: "redhat.java"
2221
extensions:
2322
- "vscjava.vscode-java-pack"
2423
vscodeVersion: "stable"
25-
workspace: "../../vscode-java/test/resources/projects/maven/salut"
24+
workspace: "../../vscode-java/test/resources/projects/eclipse/simple-app"
2625
timeout: 90
2726

2827
steps:
@@ -35,6 +34,14 @@ steps:
3534
skipLlmVerify: true
3635
timeout: 120
3736

37+
- id: "create-project-local-jar"
38+
action: "insertLineInFile lib/autotest-lib.jar 1 autotest placeholder jar"
39+
verify: "A project-local JAR placeholder exists for the mocked Add Library file picker"
40+
verifyFile:
41+
path: "~/lib/autotest-lib.jar"
42+
exists: true
43+
skipLlmVerify: true
44+
3845
# ── Trigger Classpath configuration command ──────────────
3946
# wiki: "Trigger the command 'Java: Configure Classpath'"
4047
# The classpath webview lazy-loads. Use a lenient verify on the command
@@ -47,3 +54,35 @@ steps:
4754
- id: "verify-page"
4855
action: "wait 5 seconds"
4956
verify: "Project Settings webview displays the Classpath Configuration UI (sections such as JDK, libraries, sources)"
57+
verifyWebview:
58+
contains:
59+
- "Classpath"
60+
- "Libraries"
61+
62+
- id: "open-libraries-tab"
63+
action: "clickInWebview text=Libraries"
64+
verify: "The Libraries tab is selected and shows library management actions"
65+
verifyWebview:
66+
contains: "Add Library..."
67+
68+
- id: "add-project-local-library"
69+
action: "clickInWebview text=Add Library..."
70+
verify: "The file picker opens for selecting a JAR"
71+
72+
- id: "select-project-local-library"
73+
action: "fillQuickInput ${workspaceFolder}/lib/autotest-lib.jar"
74+
verify: "The project-local JAR is selected and added to the Libraries list"
75+
verifyWebview:
76+
contains: "autotest-lib.jar"
77+
78+
- id: "apply-library-change"
79+
action: "clickInWebview text=Apply Settings"
80+
verify: "Applying the classpath change succeeds and writes the selected JAR into .classpath"
81+
82+
- id: "verify-library-applied"
83+
action: "wait 5 seconds"
84+
verify: "The Eclipse .classpath contains the added library entry, proving the Project Settings UI sent a valid absolute library path to JDT LS instead of failing with a relative-path classpath error"
85+
verifyFile:
86+
path: "~/.classpath"
87+
contains: "autotest-lib.jar"
88+
skipLlmVerify: true

0 commit comments

Comments
 (0)