agents-cli-automation 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -33,7 +33,8 @@ export default async function initCommand() {
|
|
|
33
33
|
"JavaScript (ES Modules)",
|
|
34
34
|
"Java (Maven + JUnit)",
|
|
35
35
|
"C# (NUnit + .NET)",
|
|
36
|
-
"API+DB+UI Full Stack (All-in-One Template)"
|
|
36
|
+
"API+DB+UI Full Stack (All-in-One Template)",
|
|
37
|
+
"Playwright CLI Agent (Token Efficient - CoPilot Chat)"
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
]);
|
|
@@ -53,9 +54,12 @@ export default async function initCommand() {
|
|
|
53
54
|
} else if (language.includes("C#")) {
|
|
54
55
|
templateFile = "playwright-agent-csharp.md";
|
|
55
56
|
templateName = "C#";
|
|
56
|
-
}else if (language.includes("API+DB+UI")) {
|
|
57
|
+
} else if (language.includes("API+DB+UI")) {
|
|
57
58
|
templateFile = "playwright-agent-api-db-ui.md";
|
|
58
59
|
templateName = "API+DB+UI Full Stack";
|
|
60
|
+
} else if (language.includes("Playwright CLI")) {
|
|
61
|
+
templateFile = "playwright-agent-cli.md";
|
|
62
|
+
templateName = "Playwright CLI Agent";
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
const templatePath = path.resolve(__dirname, `../templates/${templateFile}`);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Test Data Generator Agent
|
|
3
|
+
description: Minimizes token usage by generating exact test data JSON output for E2E test workflows. Framework-agnostic.
|
|
4
|
+
argument-hint: "(no args)"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Data Generator Agent
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
This agent minimizes token usage by generating **ONLY** the exact JSON test data structure needed for E2E test workflows. Uses **Playwright CLI codegen** for near-zero token overhead. Framework-agnostic, focuses on delivering output matching the test data template format.
|
|
12
|
+
|
|
13
|
+
⚠️ **CRITICAL: NEVER USE PLAYWRIGHT MCP TOOLS** - Always use `npx playwright codegen` via CLI instead.
|
|
14
|
+
|
|
15
|
+
## Output Format
|
|
16
|
+
|
|
17
|
+
Return ONLY the JSON test data output. No explanations, descriptions, markdown formatting, or additional text.
|
|
18
|
+
|
|
19
|
+
### Field Structure
|
|
20
|
+
|
|
21
|
+
- `element_id` (string): HTML element id or name attribute value
|
|
22
|
+
- `type` (string): Field type (text, date, dropdown, number, radio, checkbox, weeklyAvailability, facilityModal, dualListboxModal)
|
|
23
|
+
- `value` (string|number|object|array): The test data value
|
|
24
|
+
- `required` (boolean, optional): Whether the field is mandatory
|
|
25
|
+
|
|
26
|
+
### Template Example
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"facility_frm": {
|
|
31
|
+
"type": "text",
|
|
32
|
+
"value": "Test Facility"
|
|
33
|
+
},
|
|
34
|
+
"active_from_frm": {
|
|
35
|
+
"type": "date",
|
|
36
|
+
"value": "2026-03-14"
|
|
37
|
+
},
|
|
38
|
+
"restrict_bookers_frm": {
|
|
39
|
+
"type": "dropdown",
|
|
40
|
+
"value": "5 Live Auto"
|
|
41
|
+
},
|
|
42
|
+
"group_name": {
|
|
43
|
+
"type": "text",
|
|
44
|
+
"value": "Test Scheduling Group_0015",
|
|
45
|
+
"required": true
|
|
46
|
+
},
|
|
47
|
+
"facility_availability": {
|
|
48
|
+
"type": "weeklyAvailability",
|
|
49
|
+
"value": {
|
|
50
|
+
"monday": {
|
|
51
|
+
"from": "09:00",
|
|
52
|
+
"to": "13:00",
|
|
53
|
+
"unavailable": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"facility_type_open_frm": {
|
|
58
|
+
"type": "facilityModal",
|
|
59
|
+
"value": "BBC New Channel",
|
|
60
|
+
"subValues": ["BBC channel", "BBC News"]
|
|
61
|
+
},
|
|
62
|
+
"technical_setup_open_frm": {
|
|
63
|
+
"type": "dualListboxModal",
|
|
64
|
+
"value": [
|
|
65
|
+
{
|
|
66
|
+
"sourceId": "service_list_select",
|
|
67
|
+
"targetId": "service_list_select_to",
|
|
68
|
+
"selectedValues": ["Audio recording", "Video recording"]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Instructions
|
|
76
|
+
|
|
77
|
+
1. ✅ **ALWAYS use `npx playwright codegen` CLI** - Never use MCP tools (mcp_microsoft_pla_browser_*, etc.)
|
|
78
|
+
2. Open codegen to navigate to the target modal/form
|
|
79
|
+
3. Use browser DevTools to inspect and extract element ids/names
|
|
80
|
+
4. Determine field types (text, date, dropdown, number, radio, checkbox, etc.)
|
|
81
|
+
5. Map each field with realistic test data values
|
|
82
|
+
6. Add `"required": true` only when specified
|
|
83
|
+
7. Return ONLY raw JSON - no markdown code blocks, no text, no explanations
|
|
84
|
+
|
|
85
|
+
## Playwright CLI Codegen (Zero Token Cost)
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx playwright codegen https://allocate-systest-dbr.national.core.bbc.co.uk/index.php
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This opens a browser where you can:
|
|
92
|
+
- Navigate to the modal/form
|
|
93
|
+
- Inspect elements with DevTools (F12)
|
|
94
|
+
- Extract element ids/names
|
|
95
|
+
- Identify field types
|
|
96
|
+
|
|
97
|
+
### ⛔ DO NOT USE MCP TOOLS
|
|
98
|
+
|
|
99
|
+
**FORBIDDEN TOOLS** (Never use these):
|
|
100
|
+
- ❌ `mcp_microsoft_pla_browser_click`
|
|
101
|
+
- ❌ `mcp_microsoft_pla_browser_snapshot`
|
|
102
|
+
- ❌ `mcp_microsoft_pla_browser_type`
|
|
103
|
+
- ❌ Any `mcp_microsoft_pla_browser_*` tool
|
|
104
|
+
|
|
105
|
+
**WHY CLI ONLY:**
|
|
106
|
+
- Codegen runs in browser, NOT in LLM context (0 tokens cost)
|
|
107
|
+
- Element inspection via DevTools is free
|
|
108
|
+
- Faster execution than MCP snapshots
|
|
109
|
+
- 100x more efficient for your workflow
|