Skip to content

Commit 32fdaab

Browse files
authored
ci: add autotest cases (#1619)
1 parent ce1b9bc commit 32fdaab

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PR UI AutoTest
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
ui-test:
14+
runs-on: windows-latest
15+
timeout-minutes: 30
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '22'
25+
cache: npm
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build extension
31+
run: npm run build
32+
33+
- name: Package PR VSIX
34+
run: npx @vscode/vsce@latest package -o extension.vsix
35+
36+
- name: Install autotest CLI
37+
run: npm install -g @vscjava/vscode-autotest
38+
39+
- name: Run Help Center webview UI test
40+
shell: pwsh
41+
run: |
42+
$vsixPath = Join-Path (Get-Location) "extension.vsix"
43+
autotest run test-plans\java-pack-help-center-webview.yaml --vsix $vsixPath --no-llm
44+
45+
- name: Upload UI test results
46+
if: always()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: pr-ui-autotest-results
50+
path: test-results/
51+
retention-days: 30
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Test Plan: Java Extension Pack - Help Center webview
2+
#
3+
# Covers the React/vscode-elements webview migration by opening the local
4+
# vscode-java-pack Help Center and verifying key content from inside the webview.
5+
#
6+
# Usage after packaging vscode-java-pack:
7+
# npx autotest run test-plans\java-pack-help-center-webview.yaml --vsix extension.vsix --no-llm
8+
9+
name: "Java Extension Pack - Help Center Webview"
10+
description: |
11+
Opens the Java Help Center webview from the installed vscode-java-pack VSIX
12+
and verifies that the migrated React webview renders its main sections.
13+
14+
setup:
15+
extension: "redhat.java"
16+
vscodeVersion: "stable"
17+
timeout: 60
18+
settings:
19+
java.help.showReleaseNotes: false
20+
java.help.firstView: "none"
21+
22+
steps:
23+
- id: "open-help-center"
24+
action: "executeVSCodeCommand java.welcome"
25+
verifyEditorTab:
26+
title: "Java Help Center"
27+
timeout: 20
28+
29+
- id: "verify-help-center-content"
30+
action: "wait 2 seconds"
31+
verifyWebview:
32+
contains:
33+
- "Java Help Center"
34+
- "Get Started"
35+
- "Create a New Project"
36+
- "Configure Java Runtime"
37+
- "Open Java Settings"
38+
timeout: 20

0 commit comments

Comments
 (0)