Skip to content

Commit 2800f8c

Browse files
committed
Add Test Goal view in webstudio
1 parent 0e97cd4 commit 2800f8c

22 files changed

Lines changed: 1756 additions & 8 deletions

File tree

agent/resources/skills/testar-cli/SKILL.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ Treat the CLI distribution as an operational environment, not as a source-code w
1515
- The task requires step-by-step control of a live Windows, WebDriver, or Android session.
1616
- The task requires using `getState`, `getStateScreenshot`, and `getDerivedActions` as execution evidence.
1717

18-
## Runtime layout
19-
20-
- Distribution root contains the public launcher.
21-
- This skill is copied into `.agents/skills/testar-cli/` inside the CLI distribution.
22-
2318
## Public launcher paths
2419

2520
- Windows: `testar-cli.bat`

docs/architecture_distribution_workspace.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ If reporting is enabled, the final CLI verdict must be written to the generated
173173

174174
The `testar-cli` skill documentation is the operational source that tells agents how to use this contract.
175175

176+
## Test Goals
177+
178+
Reusable Test Goals for AI guided execution modes (e.g., CLI mode) are workspace assets stored as YAML files.
179+
180+
Repository defaults live under:
181+
182+
- `testar/resources/settings/{workspace}/test_goals`
183+
184+
Distribution editable goals live under:
185+
186+
- `testar/target/install/testar/bin/settings/{workspace}/test_goals`
187+
188+
The distribution process should copy each workspace's Test Goals together with the rest of that workspace.
189+
190+
WebStudio should edit only the selected workspace's distributed `test_goals` copy.
191+
192+
Executable managed goal files use `.yaml` or `.yml`.
193+
194+
The YAML contract is intentionally structured so WebStudio can validate required fields and agents can consume goal content reliably.
195+
176196
## Output Folder Naming
177197

178198
Generated output folders must include the execution mode after the timestamp.

docs/webstudio/WEBSTUDIO_BUG_BACKLOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,30 @@ Acceptance:
284284
- shared result status classification treats `OK` and `LLM_COMPLETE` as successful
285285
- `LLM_INVALID` and non-success verdicts remain issue outcomes
286286
- regression test `ResultVerdictStatusTest` passes
287+
288+
### WS-011 Test Goals Folder Selection Kept YAML Editor Open
289+
290+
- Area: Test Goals
291+
- Status: fixed
292+
293+
Reproduction:
294+
295+
1. Open `Test Goals`.
296+
2. Select a YAML goal file.
297+
3. Select a folder in the goal tree.
298+
299+
Expected:
300+
301+
- the right panel switches from YAML editing to the selected-folder creation panel
302+
- if the YAML editor has unsaved changes, the unsaved-change guard appears before switching
303+
304+
Bug:
305+
306+
- folder selection was local to the view while YAML file selection was stored in the parent view state
307+
- selecting a folder did not clear the selected YAML file, so the right panel kept showing the YAML editor
308+
309+
Acceptance:
310+
311+
- folder selection is stored in the parent Test Goals state
312+
- selecting a folder clears the selected YAML file after the unsaved-change guard is resolved
313+
- regression test `testGoalFolderSelectionState` passes

docs/webstudio/WEBSTUDIO_FUNCTIONAL_SPEC.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ CLI Mode supports:
339339
- CLI command execution
340340
- CLI session stop
341341
- focused editing of Agent CLI settings stored in the selected workspace `test.settings`
342+
- prompt-driven execution of managed Test Goals stored in the selected workspace
342343

343344
Workspace selection:
344345

@@ -347,6 +348,126 @@ Workspace selection:
347348
- CLI validates connector values server-side and reports startup errors to the user
348349
- Manual and Agent CLI execution use the selected workspace settings, including `CliStateProjectionMode` and `AgentCLI...` values
349350

351+
## Test Goals
352+
353+
Test Goals are reusable goal definitions consumed by AI guided execution modes (e.g., CLI mode).
354+
355+
Test Goals are workspace assets. Each workspace may contain its own `test_goals` folder next to its settings, composition, policies, and Java sources.
356+
357+
Repository defaults live under:
358+
359+
- `testar/resources/settings/{workspace}/test_goals`
360+
361+
The distributed editable copy lives under:
362+
363+
- `testar/target/install/testar/bin/settings/{workspace}/test_goals`
364+
365+
WebStudio works with the distributed `test_goals` folder for the selected workspace.
366+
367+
Changing the selected workspace changes the Test Goals tree. WebStudio must not mix Test Goals from different workspaces in the same view.
368+
369+
### Supported Goal Files
370+
371+
Managed executable test goals use YAML files.
372+
373+
Allowed executable extensions:
374+
375+
- `.yaml`
376+
- `.yml`
377+
378+
### YAML Contract
379+
380+
Each executable goal file must use this shape:
381+
382+
```yaml
383+
version: 1
384+
goals:
385+
- id: unique-goal-id
386+
title: Human readable title
387+
category: functional
388+
narrative: >
389+
Optional user story or context.
390+
objective: Clear objective the agent must complete.
391+
inputs:
392+
platform: webdriver
393+
sut: https://example.org/
394+
prerequisites:
395+
- Optional setup condition.
396+
expected_outcomes:
397+
- Observable expected outcome.
398+
validation_notes:
399+
- Optional validation guidance.
400+
```
401+
402+
Required fields:
403+
404+
- `version`
405+
- `goals`
406+
- `goals[].id`
407+
- `goals[].title`
408+
- `goals[].objective`
409+
- `goals[].expected_outcomes`
410+
411+
Recommended fields:
412+
413+
- `goals[].category`
414+
- `goals[].inputs.platform`
415+
- `goals[].inputs.sut`
416+
- `goals[].validation_notes`
417+
418+
Goal identifiers should use kebab-case.
419+
420+
### Authoring Behavior
421+
422+
WebStudio should provide a dedicated `Test Goals` view.
423+
424+
The view should support:
425+
426+
- browsing folders and YAML goal files under the selected workspace `test_goals` folder
427+
- creating folders
428+
- creating YAML goal files
429+
- editing YAML goal files
430+
- deleting folders and files with confirmation
431+
- saving edited YAML goal files
432+
- discarding unsaved edits
433+
- validating the required YAML shape before saving or before execution
434+
435+
All file operations must stay inside the selected workspace `test_goals` folder.
436+
437+
Path traversal, absolute paths, and unsafe symlink escapes must be rejected.
438+
439+
If the selected workspace has no Test Goals yet, the view should show a stable empty state and allow creating folders or YAML files under that workspace.
440+
441+
### CLI Mode Integration
442+
443+
Test Goals are not selected for execution in the authoring view.
444+
445+
The `Test Goals` view is only responsible for creating, editing, deleting, and organizing YAML goal files and directories.
446+
447+
CLI Mode remains prompt-driven.
448+
449+
The user prompt can instruct the agent to execute:
450+
451+
- one named YAML test goal file
452+
- multiple named YAML test goal files
453+
- the YAML test goals in one named directory
454+
- the YAML test goals in multiple named directories
455+
- all YAML test goals under a named parent directory
456+
457+
WebStudio must include the selected workspace `test_goals` root path in the generated Agent CLI prompt so the agent can resolve the user-requested goal files or directories.
458+
459+
The Agent CLI prompt contract must tell the agent:
460+
461+
- to resolve user-referenced goal paths relative to the selected workspace `test_goals` root
462+
- to read the requested YAML goal files before execution
463+
- to execute every goal defined in each requested YAML file
464+
- to execute all matching YAML goal files when the user instruction is broad or matches multiple goals
465+
- to use recursive directory execution when the user asks for all goals in a directory
466+
467+
Directory execution means recursive YAML discovery when the user asks for all goals in a directory.
468+
469+
Agent CLI execution must still finalize each goal session with `LLM_COMPLETE` or `LLM_INVALID` and execute `shutdownDaemon` after the final goal session.
470+
350471
### Agent CLI Settings
351472

352473
Agent CLI settings are stored in the selected workspace `test.settings` file with `AgentCLI...` names.

docs/webstudio/WEBSTUDIO_UX_SPEC.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,29 @@ Expected behavior:
231231
- command buttons do not overflow horizontally
232232
- Agent CLI settings edited in CLI mode use the same unsaved-change dialog pattern as configuration settings
233233

234+
### Test Goals
235+
236+
Expected behavior:
237+
238+
- Test Goals use a dedicated authoring view
239+
- the left panel shows a folder/file tree rooted at the selected workspace `test_goals` folder
240+
- changing the selected workspace refreshes the Test Goals tree for that workspace
241+
- the editor panel shows the selected YAML goal file
242+
- folder and file lists have fixed panel size and scroll internally
243+
- the view contains only file and folder management controls
244+
- delete actions require modal confirmation
245+
- unclear confirmation always cancels deletion
246+
- unsaved YAML edits use the same save/discard/cancel guard pattern as other editors
247+
- YAML validation feedback appears in a stable panel and does not resize the layout dynamically
248+
- unsupported files may be shown as grey non-executable reference files
249+
250+
Avoid:
251+
252+
- adding execution controls to the Test Goals view
253+
- allowing file operations outside the selected workspace `test_goals` folder
254+
- mixing Test Goals from multiple workspaces in one tree
255+
- treating arbitrary free-text files as managed executable goals
256+
234257
## Test Results UX Contract
235258

236259
The results page should provide fast visual understanding of output health.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 1
2+
goals:
3+
- id: apidemos-media-player-streaming-button-exists
4+
title: Play Streaming Video button exists in MediaPlayer
5+
category: functional
6+
narrative: >
7+
As an Android API Demos user, I want to open the MediaPlayer demo screen and confirm that the Play Streaming Video button is available.
8+
objective: Open API Demos, navigate to Media > MediaPlayer, and verify that the Play Streaming Video button exists.
9+
inputs:
10+
sut: ApiDemos-debug.apk
11+
platform: android
12+
navigation_path:
13+
- API Demos
14+
- Media
15+
- MediaPlayer
16+
target_option: Play Streaming Video
17+
expected_outcomes:
18+
- The API Demos application launches successfully.
19+
- The Media category is visible and can be opened.
20+
- The MediaPlayer demo screen is opened.
21+
- A button or selectable button labeled "Play Streaming Video" is visible on the MediaPlayer screen.
22+
validation_notes:
23+
- This is a dynamic Android UI goal.
24+
- Agents should validate the presence of the button by visible text or accessibility label.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 1
2+
goals:
3+
- id: parabank-find-transaction
4+
title: Find at least one transaction with amount 100
5+
category: functional
6+
narrative: >
7+
As an authenticated user, I want to access my banking data after logging in
8+
with the demo credentials john/demo.
9+
Then I can verify that there is at least one transaction with amount 100.
10+
objective: Log in as john and verify that at least one transaction of 100 can be found.
11+
inputs:
12+
sut: https://para.testar.org/
13+
platform: webdriver
14+
username: john
15+
password: demo
16+
prerequisites:
17+
- Log in successfully using username "john" and password "demo".
18+
- An authenticated session is established before transaction verification begins.
19+
expected_outcomes:
20+
- A successful authenticated session is established.
21+
- The application allows access to transaction data after login.
22+
- At least one transaction with amount "100" is present and can be found.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 1
2+
goals:
3+
- id: parabank_login_valid
4+
title: Login with demo credentials
5+
category: functional
6+
narrative: >
7+
As a user, I want to log in with the credentials john/demo.
8+
Then the Welcome John Smith message is shown.
9+
objective: Log in successfully as the user john.
10+
inputs:
11+
sut: https://para.testar.org/
12+
platform: webdriver
13+
username: john
14+
password: demo
15+
expected_outcomes:
16+
- A successful authenticated session is established.
17+
- A welcome message containing "Welcome John Smith" is shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 1
2+
goals:
3+
- id: notepad-edit-select-date
4+
title: Selecting the date option in edit mode
5+
category: functional
6+
narrative: >
7+
As a Notepad user, I want to open the Edit menu and choose the Date/Time option.
8+
Then Notepad inserts the current system date and time into the text editor.
9+
objective: Open Notepad, select Edit > Time/Date, and verify that the editor receives the current date and time.
10+
inputs:
11+
sut: notepad.exe
12+
platform: windows
13+
menu_path:
14+
- Edit
15+
- Time/Date
16+
expected_outcomes:
17+
- The Notepad editor is focused and available for text insertion.
18+
- The Edit menu can be opened.
19+
- The "Time/Date" command is selected from the Edit menu.
20+
- Notepad inserts text into the editor.
21+
- The inserted text corresponds to the current system date and time shown in the operating-system locale format.
22+
validation_notes:
23+
- This is a dynamic desktop goal.
24+
- Agents should compare the text inserted into the editor with the current local system date/time instead of relying on one fixed literal string.

0 commit comments

Comments
 (0)