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 CHANGED
@@ -23,30 +23,47 @@ npx agents init
23
23
 
24
24
  ## Quick Start
25
25
 
26
- Run the setup command and select your testing type:
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
- Choose from:
32
- 1. **Playwright Setup for UI Testing** - Browser automation, E2E tests, component testing
33
- 2. **Playwright Setup for API Testing** - REST API tests, integration testing, backend validation
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
- Follow the interactive prompts and your agent will be generated!
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 Setup for UI Testing
40
- Creates a production-ready Playwright framework for UI automation with:
41
- - āœ… Complete UI test project structure
42
- - āœ… UI, component, and E2E testing templates
43
- - āœ… Fixture configurations
44
- - āœ… WebServer setup for local development
45
- - āœ… All npm scripts configured
46
- - āœ… Sample tests with SauceDemo credentials
47
- - āœ… Headed and headless test modes
48
-
49
- ### šŸ”Œ Playwright Setup for API Testing
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 one of these files:
64
-
65
- ### For UI Testing
66
- - `playwright-ui-testing-agent.md` - Complete UI framework setup
67
- - WebServer configuration
68
- - Sample UI tests with SauceDemo
69
- - Fixture setup
70
- - Headed and headless modes
71
- - Visual regression ready
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
- - REST API examples (GET, POST, etc.)
76
- - Response validation
77
- - Authentication fixtures
78
- - Database integration helpers
79
- - CI/CD ready configuration
80
-
81
- Each agent file includes:
82
- - Full setup instructions
83
- - Working sample tests
84
- - Verification checklist
85
- - Best practices
86
- - Environment configuration
87
- - Ready-to-use code snippets
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
- ## Need Help?
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 agent file provides comprehensive guidance:
176
+ Each generated framework provides:
97
177
 
98
178
  **For UI Testing:**
99
- - WebServer setup for local testing
100
- - SauceDemo test examples (login, add to cart)
101
- - How to replace with your own application
102
- - Debugging tips for browser tests
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-cli-automation",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Agents CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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 setup\n");
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 Setup for UI Testing",
19
- "Playwright Setup for API Testing"
18
+ "Playwright UI Testing (Recommended)",
19
+ "Playwright API Testing"
20
20
  ]
21
21
  }
22
22
  ]);
23
23
 
24
- if (setup === "Playwright Setup for UI Testing") {
25
- // Template for UI testing
26
- const templatePath = path.resolve(
27
- __dirname,
28
- "../templates/playwright-agent.md"
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
- // Target folder **inside the user's project**
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 destFile = path.join(agentsDir, "playwright-ui-testing-agent.md");
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 agent created at ${destFile}\n`);
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 Setup for API Testing") {
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 šŸŽ‰\n");
109
+ console.log("šŸŽ‰ Setup complete!\n");
71
110
  }