agents-cli-automation 1.0.6 ā 1.0.7
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/README.md +127 -44
- package/package.json +1 -1
- package/src/commands/init.js +54 -15
- package/src/templates/playwright-agent-csharp.md +521 -0
- package/src/templates/playwright-agent-java.md +471 -0
- package/src/templates/playwright-agent-js.md +461 -0
- package/src/templates/playwright-agent-ts.md +1419 -0
- package/src/templates/playwright-agent.md +1353 -47
package/README.md
CHANGED
|
@@ -23,30 +23,47 @@ npx agents init
|
|
|
23
23
|
|
|
24
24
|
## Quick Start
|
|
25
25
|
|
|
26
|
-
Run the setup command and
|
|
26
|
+
Run the setup command and follow the interactive prompts:
|
|
27
27
|
```bash
|
|
28
28
|
npx agents-cli-automation init
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
### Step 1: Select Framework Type
|
|
32
|
+
Choose your testing type:
|
|
33
|
+
1. **Playwright UI Testing** - Browser automation, E2E tests, component testing
|
|
34
|
+
2. **Playwright API Testing** - REST API tests, integration testing, backend validation
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
### Step 2: Select Your Language (for UI Testing)
|
|
37
|
+
Choose your preferred language:
|
|
38
|
+
- **TypeScript** (Recommended) - Latest & Type Safe
|
|
39
|
+
- **JavaScript** - ES Modules, modern syntax
|
|
40
|
+
- **Java** - Maven + JUnit5
|
|
41
|
+
- **C#** - NUnit + .NET
|
|
42
|
+
|
|
43
|
+
Your scalable, production-ready framework will be generated automatically!
|
|
36
44
|
|
|
37
45
|
## Available Agents
|
|
38
46
|
|
|
39
|
-
### š Playwright
|
|
40
|
-
Creates a production-ready Playwright framework for UI automation with
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- ā
|
|
44
|
-
- ā
|
|
45
|
-
- ā
|
|
46
|
-
- ā
|
|
47
|
-
- ā
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
### š Playwright UI Testing Framework
|
|
48
|
+
Creates a production-ready Playwright framework for UI automation with support for **TypeScript, JavaScript, Java, and C#**.
|
|
49
|
+
|
|
50
|
+
**Core Features:**
|
|
51
|
+
- ā
**Page Object Model (POM)** - Reusable page classes with best practices
|
|
52
|
+
- ā
**Fixtures & Setup** - Built-in browser lifecycle management
|
|
53
|
+
- ā
**Parallel Execution** - Run tests simultaneously (4 workers by default)
|
|
54
|
+
- ā
**Chromium Only** - Single browser for consistency and speed
|
|
55
|
+
- ā
**Test Data Readers** - Support for JSON, CSV, and YAML files
|
|
56
|
+
- ā
**Form Helpers** - Handle dropdowns, radio buttons, checkboxes, text inputs
|
|
57
|
+
- ā
**BDD Support** - Cucumber/Gherkin feature files for scenario-based testing
|
|
58
|
+
- ā
**Latest APIs** - Uses latest Playwright versions with full type safety
|
|
59
|
+
|
|
60
|
+
**Language Options:**
|
|
61
|
+
- **TypeScript** - Full tsconfig with strict mode and path aliases (@pages/@utils/@fixtures/@data)
|
|
62
|
+
- **JavaScript** - ES Modules with modern syntax (no build step required)
|
|
63
|
+
- **Java** - Maven-based structure with JUnit 5 and all dependencies
|
|
64
|
+
- **C#** - .NET 8 with NUnit and async/await patterns
|
|
65
|
+
|
|
66
|
+
### š Playwright API Testing
|
|
50
67
|
Creates a production-ready Playwright framework for API automation with:
|
|
51
68
|
- ā
Complete API test project structure
|
|
52
69
|
- ā
REST API request handling
|
|
@@ -60,46 +77,112 @@ The generated agent will include everything you need to start automating tests i
|
|
|
60
77
|
|
|
61
78
|
## What Gets Created
|
|
62
79
|
|
|
63
|
-
When you run `agents init`, a `.github/agents` directory is created in your project with
|
|
64
|
-
|
|
65
|
-
### For UI Testing
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
80
|
+
When you run `agents init`, a `.github/agents` directory is created in your project with language-specific framework files.
|
|
81
|
+
|
|
82
|
+
### For UI Testing (Choose Your Language)
|
|
83
|
+
|
|
84
|
+
**TypeScript**
|
|
85
|
+
- `playwright-ui-testing-typescript-agent.md`
|
|
86
|
+
- Complete TypeScript framework with strict type checking
|
|
87
|
+
- tsconfig.json with path aliases
|
|
88
|
+
- Full type definitions for all utilities
|
|
89
|
+
- ES2020 module syntax
|
|
90
|
+
|
|
91
|
+
**JavaScript**
|
|
92
|
+
- `playwright-ui-testing-javascript-es-modules-agent.md`
|
|
93
|
+
- Modern ES Modules syntax (Node.js 18+)
|
|
94
|
+
- No build step required
|
|
95
|
+
- Same features as TypeScript without type annotations
|
|
96
|
+
|
|
97
|
+
**Java**
|
|
98
|
+
- `playwright-ui-testing-java-agent.md`
|
|
99
|
+
- Maven-based project structure
|
|
100
|
+
- JUnit 5 test framework
|
|
101
|
+
- Complete pom.xml with all dependencies
|
|
102
|
+
- Maven parallel execution support
|
|
103
|
+
|
|
104
|
+
**C#**
|
|
105
|
+
- `playwright-ui-testing-c#-agent.md`
|
|
106
|
+
- .NET 8+ project structure
|
|
107
|
+
- NUnit test framework
|
|
108
|
+
- Complete .csproj configuration
|
|
109
|
+
- Async/await patterns throughout
|
|
72
110
|
|
|
73
111
|
### For API Testing
|
|
74
112
|
- `playwright-api-testing-agent.md` - Complete API framework setup
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
113
|
+
|
|
114
|
+
## Framework Structure (All Languages)
|
|
115
|
+
|
|
116
|
+
Each generated framework includes:
|
|
117
|
+
|
|
118
|
+
**š Project Structure**
|
|
119
|
+
```
|
|
120
|
+
framework/
|
|
121
|
+
āāā pages/ # Page Object Model classes
|
|
122
|
+
āāā utils/ # DataReader, FormHelper, TestDataManager
|
|
123
|
+
āāā fixtures/ # Browser setup and fixtures
|
|
124
|
+
āāā tests/ # Test files
|
|
125
|
+
āāā features/ # Gherkin/BDD scenarios
|
|
126
|
+
āāā data/ # Test data (JSON, CSV, YAML)
|
|
127
|
+
āāā config files # Language-specific (tsconfig.json, pom.xml, etc.)
|
|
128
|
+
āāā Sample tests # Working examples ready to run
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**⨠Included in Every Framework:**
|
|
132
|
+
- Page Object Model classes with selectors
|
|
133
|
+
- Form helpers for complex form interactions
|
|
134
|
+
- Test data readers for JSON, CSV, YAML
|
|
135
|
+
- BDD/Gherkin feature files
|
|
136
|
+
- Browser fixtures with proper cleanup
|
|
137
|
+
- Parallel execution configuration
|
|
138
|
+
- Sample tests with SauceDemo app
|
|
139
|
+
- Complete setup and run instructions
|
|
88
140
|
|
|
89
141
|
## Requirements
|
|
90
142
|
|
|
143
|
+
### To Run CLI
|
|
91
144
|
- Node.js 18+
|
|
92
145
|
- npm or yarn
|
|
93
146
|
|
|
94
|
-
|
|
147
|
+
### To Run Generated Frameworks
|
|
148
|
+
|
|
149
|
+
**TypeScript & JavaScript:**
|
|
150
|
+
- Node.js 18+
|
|
151
|
+
- npm or yarn
|
|
152
|
+
|
|
153
|
+
**Java:**
|
|
154
|
+
- Java 11+
|
|
155
|
+
- Maven 3.8+
|
|
156
|
+
|
|
157
|
+
**C#:**
|
|
158
|
+
- .NET 8 SDK
|
|
159
|
+
- Visual Studio 2022 or VS Code with C# extension
|
|
160
|
+
|
|
161
|
+
## Why Choose This Framework?
|
|
162
|
+
|
|
163
|
+
ā
**Multi-Language Support** - Use TypeScript, JavaScript, Java, or C#
|
|
164
|
+
ā
**Minimal Setup** - Fully scaffolded projects, developers focus on tests, not setup
|
|
165
|
+
ā
**Page Object Model** - Reusable, maintainable test code patterns
|
|
166
|
+
ā
**Scalable Architecture** - Ready for enterprise-grade test suites
|
|
167
|
+
ā
**Parallel Execution** - Run tests faster across multiple workers
|
|
168
|
+
ā
**BDD Ready** - Cucumber/Gherkin support for business-readable scenarios
|
|
169
|
+
ā
**Test Data Management** - JSON, CSV, YAML support out of the box
|
|
170
|
+
ā
**Form Helpers** - Handle complex forms, dropdowns, checkboxes easily
|
|
171
|
+
ā
**Latest Playwright** - Always using cutting-edge Playwright features
|
|
172
|
+
ā
**Production Ready** - Fixtures, proper cleanup, error handling included
|
|
173
|
+
|
|
174
|
+
## Framework Quick Features
|
|
95
175
|
|
|
96
|
-
Each generated
|
|
176
|
+
Each generated framework provides:
|
|
97
177
|
|
|
98
178
|
**For UI Testing:**
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
179
|
+
- SauceDemo test examples (login, shopping cart)
|
|
180
|
+
- Complete page objects with all selectors
|
|
181
|
+
- Form interaction helpers for any element type
|
|
182
|
+
- Test data loading from multiple formats
|
|
183
|
+
- BDD scenario examples with step definitions
|
|
184
|
+
- Parallel execution (4 workers by default)
|
|
185
|
+
- Chromium-only for reliability
|
|
103
186
|
|
|
104
187
|
**For API Testing:**
|
|
105
188
|
- Writing GET, POST, PUT, DELETE tests
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -7,28 +7,64 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
|
8
8
|
|
|
9
9
|
export default async function initCommand() {
|
|
10
|
-
console.log("\nš Agents CLI
|
|
10
|
+
console.log("\nš Agents CLI - Scalable Test Framework Setup\n");
|
|
11
11
|
|
|
12
12
|
const { setup } = await inquirer.prompt([
|
|
13
13
|
{
|
|
14
14
|
type: "list",
|
|
15
15
|
name: "setup",
|
|
16
|
-
message: "Select setup",
|
|
16
|
+
message: "Select framework setup",
|
|
17
17
|
choices: [
|
|
18
|
-
"Playwright
|
|
19
|
-
"Playwright
|
|
18
|
+
"Playwright UI Testing (Recommended)",
|
|
19
|
+
"Playwright API Testing"
|
|
20
20
|
]
|
|
21
21
|
}
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
|
-
if (setup === "Playwright
|
|
25
|
-
//
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
if (setup === "Playwright UI Testing (Recommended)") {
|
|
25
|
+
// Ask for language preference
|
|
26
|
+
const { language } = await inquirer.prompt([
|
|
27
|
+
{
|
|
28
|
+
type: "list",
|
|
29
|
+
name: "language",
|
|
30
|
+
message: "Select your preferred language",
|
|
31
|
+
choices: [
|
|
32
|
+
"TypeScript (Recommended - Latest & Type Safe)",
|
|
33
|
+
"JavaScript (ES Modules)",
|
|
34
|
+
"Java (Maven + JUnit)",
|
|
35
|
+
"C# (NUnit + .NET)"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
let templateFile;
|
|
41
|
+
let templateName;
|
|
42
|
+
|
|
43
|
+
if (language.includes("TypeScript")) {
|
|
44
|
+
templateFile = "playwright-agent-ts.md";
|
|
45
|
+
templateName = "TypeScript";
|
|
46
|
+
} else if (language.includes("JavaScript")) {
|
|
47
|
+
templateFile = "playwright-agent-js.md";
|
|
48
|
+
templateName = "JavaScript ES Modules";
|
|
49
|
+
} else if (language.includes("Java")) {
|
|
50
|
+
templateFile = "playwright-agent-java.md";
|
|
51
|
+
templateName = "Java";
|
|
52
|
+
} else if (language.includes("C#")) {
|
|
53
|
+
templateFile = "playwright-agent-csharp.md";
|
|
54
|
+
templateName = "C#";
|
|
55
|
+
}
|
|
30
56
|
|
|
31
|
-
|
|
57
|
+
const templatePath = path.resolve(__dirname, `../templates/${templateFile}`);
|
|
58
|
+
|
|
59
|
+
// Check if template exists
|
|
60
|
+
if (!fs.existsSync(templatePath)) {
|
|
61
|
+
console.error(
|
|
62
|
+
`\nā Template not found: ${templateFile}\n`
|
|
63
|
+
);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Target folder in user's project
|
|
32
68
|
const userProjectRoot = process.cwd();
|
|
33
69
|
const agentsDir = path.join(userProjectRoot, ".github", "agents");
|
|
34
70
|
|
|
@@ -36,15 +72,18 @@ export default async function initCommand() {
|
|
|
36
72
|
await fs.ensureDir(agentsDir);
|
|
37
73
|
|
|
38
74
|
// Save file with .agent extension
|
|
39
|
-
const
|
|
75
|
+
const fileName = `playwright-ui-testing-${templateName.toLowerCase().replace(/\s/g, "-")}-agent.md`;
|
|
76
|
+
const destFile = path.join(agentsDir, fileName);
|
|
40
77
|
|
|
41
78
|
// Copy template content
|
|
42
79
|
await fs.copyFile(templatePath, destFile);
|
|
43
80
|
|
|
44
|
-
console.log(`\nā
Playwright UI Testing
|
|
81
|
+
console.log(`\nā
Playwright UI Testing Framework created!`);
|
|
82
|
+
console.log(`š Language: ${templateName}`);
|
|
83
|
+
console.log(`š Location: ${destFile}\n`);
|
|
45
84
|
}
|
|
46
85
|
|
|
47
|
-
if (setup === "Playwright
|
|
86
|
+
if (setup === "Playwright API Testing") {
|
|
48
87
|
// Template for API testing
|
|
49
88
|
const templatePath = path.resolve(
|
|
50
89
|
__dirname,
|
|
@@ -67,5 +106,5 @@ export default async function initCommand() {
|
|
|
67
106
|
console.log(`\nā
Playwright API Testing agent created at ${destFile}\n`);
|
|
68
107
|
}
|
|
69
108
|
|
|
70
|
-
console.log("Setup complete
|
|
109
|
+
console.log("š Setup complete!\n");
|
|
71
110
|
}
|