k6-cucumber-steps 2.0.8 โ 2.0.10-alpha.0
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 +159 -6
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -1
- package/dist/generators/feature.parser.d.ts +4 -0
- package/dist/generators/feature.parser.d.ts.map +1 -1
- package/dist/generators/feature.parser.js +42 -15
- package/dist/generators/feature.parser.js.map +1 -1
- package/dist/generators/samples/sample-steps.generator.d.ts.map +1 -1
- package/dist/generators/samples/sample-steps.generator.js +152 -0
- package/dist/generators/samples/sample-steps.generator.js.map +1 -1
- package/dist/metadata.json +50 -0
- package/package.json +17 -6
package/README.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
# k6-cucumber-steps ๐ฅ๐งช
|
|
1
|
+
# k6-cucumber-steps ๐ฅ๐งช - K6 Performance Testing with Cucumber BDD
|
|
2
|
+
|
|
3
|
+
**k6-cucumber-steps** is a powerful CLI tool that enables you to run [k6](https://k6.io/) performance and load tests using [Cucumber](https://cucumber.io/) BDD (Behavior-Driven Development) syntax. Write performance tests in natural language Gherkin and execute them at scale with k6.
|
|
2
4
|
|
|
3
5
|
<table align="center" style="margin-bottom:30px;"><tr><td align="center" width="9999" heigth="9999" >
|
|
4
|
-
<img src="assets/paschal logo (2).png" alt="
|
|
6
|
+
<img src="assets/paschal logo (2).png" alt="k6-cucumber-steps logo" style="margin-top:25px;" align="center"/>
|
|
5
7
|
</td></tr></table>
|
|
6
8
|
|
|
7
9
|
[](https://www.npmjs.com/package/k6-cucumber-steps)
|
|
8
10
|
[](https://www.npmjs.com/package/k6-cucumber-steps)
|
|
11
|
+
[](https://www.npmjs.com/package/k6-cucumber-steps)
|
|
9
12
|
[](https://github.com/qaPaschalE/k6-cucumber-steps/blob/main/LICENSE)
|
|
10
13
|
[](https://cucumber.io/)
|
|
11
14
|
[](https://nodejs.org/)
|
|
15
|
+
[](https://www.typescriptlang.org/)
|
|
12
16
|
[](https://github.com/sponsors/qaPaschalE)
|
|
13
|
-
[](https://github.com/
|
|
14
|
-
|
|
15
|
-
Run [k6](https://k6.io/) performance/load tests using [Cucumber](https://cucumber.io/) BDD syntax with ease.
|
|
17
|
+
[](https://github.com/qaPaschalE/k6-cucumber-steps/actions/workflows/k6-load-test.yml)
|
|
18
|
+
[](https://qapaschale.github.io/k6-cucumber-steps/)
|
|
16
19
|
|
|
17
20
|
---
|
|
18
21
|
|
|
@@ -23,7 +26,9 @@ All step definitions are fully documented and available in multiple formats:
|
|
|
23
26
|
### 1. TypeDoc API Documentation
|
|
24
27
|
Interactive HTML documentation with search and navigation:
|
|
25
28
|
|
|
26
|
-
**Online:** [View TypeDoc Documentation](https://qapaschale.github.io/k6-cucumber-steps/
|
|
29
|
+
**Online:** [View TypeDoc Documentation](https://qapaschale.github.io/k6-cucumber-steps/)
|
|
30
|
+
|
|
31
|
+
> ๐ **Auto-Deployed**: Documentation is automatically generated and deployed to GitHub Pages on every push to the `main` branch.
|
|
27
32
|
|
|
28
33
|
**Locally:**
|
|
29
34
|
```bash
|
|
@@ -160,6 +165,116 @@ And I k6 print all aliases # Print all stored aliases
|
|
|
160
165
|
Given I k6 clear auth token # Remove Authorization header
|
|
161
166
|
```
|
|
162
167
|
|
|
168
|
+
## ๐ What's New in v2.0.9
|
|
169
|
+
|
|
170
|
+
### ๐ Recursive Feature File Search
|
|
171
|
+
|
|
172
|
+
The feature parser now **automatically searches subdirectories** for `.feature` files.
|
|
173
|
+
|
|
174
|
+
**Example:**
|
|
175
|
+
```bash
|
|
176
|
+
npx k6-cucumber-steps generate -f ./features
|
|
177
|
+
# Finds: ./features/login.feature
|
|
178
|
+
# ./features/api/users.feature
|
|
179
|
+
# ./features/api/orders.feature
|
|
180
|
+
# ./features/ui/dashboard.feature
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Excluded directories:** `node_modules/`, hidden directories (`.git/`, `.github/`, etc.)
|
|
184
|
+
|
|
185
|
+
### ๐๏ธ DELETE Request Support (NEW!)
|
|
186
|
+
|
|
187
|
+
Full DELETE request support with environment variables and alias replacement:
|
|
188
|
+
|
|
189
|
+
```gherkin
|
|
190
|
+
# Basic DELETE
|
|
191
|
+
When I k6 make a DELETE request to "/users/1"
|
|
192
|
+
|
|
193
|
+
# DELETE with env vars
|
|
194
|
+
When I k6 make a DELETE request to "/users/{{USER_ID}}"
|
|
195
|
+
|
|
196
|
+
# DELETE with custom headers
|
|
197
|
+
When I k6 make a DELETE request to "/api/items/1" with headers:
|
|
198
|
+
| Authorization |
|
|
199
|
+
| Bearer {{authToken}} |
|
|
200
|
+
|
|
201
|
+
# DELETE with payload file
|
|
202
|
+
When I k6 make a DELETE request to "/api/bulk" with payload from "data/delete-payload.json"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Supports:**
|
|
206
|
+
- `{{VARIABLE_NAME}}` for environment variables
|
|
207
|
+
- `{{alias:NAME}}` for stored aliases in payload files
|
|
208
|
+
|
|
209
|
+
### ๐ Multiple Feature Paths
|
|
210
|
+
|
|
211
|
+
Specify **multiple directories or files** using comma-separated paths.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Search multiple directories
|
|
215
|
+
npx k6-cucumber-steps generate -f "./features/api,./features/ui,./tests/regression"
|
|
216
|
+
|
|
217
|
+
# Mix directories and single files
|
|
218
|
+
npx k6-cucumber-steps generate -f "./features,./tests/smoke.feature"
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### ๐ท๏ธ Enhanced Tag Filtering
|
|
222
|
+
|
|
223
|
+
Better tag filtering with **detailed feedback** on what's being included/excluded.
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Include only @smoke tests
|
|
227
|
+
npx k6-cucumber-steps generate --tags @smoke
|
|
228
|
+
|
|
229
|
+
# Include multiple tags (OR logic)
|
|
230
|
+
npx k6-cucumber-steps generate --tags "@smoke,@regression"
|
|
231
|
+
|
|
232
|
+
# Exclude specific tags
|
|
233
|
+
npx k6-cucumber-steps generate --exclude-tags "@wip,@broken"
|
|
234
|
+
|
|
235
|
+
# Combine include and exclude
|
|
236
|
+
npx k6-cucumber-steps generate --tags "@smoke" --exclude-tags "@known-issue"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**New CLI Output:**
|
|
240
|
+
```
|
|
241
|
+
๐ท๏ธ Including scenarios with tags: @smoke
|
|
242
|
+
Filtered: 23 โ 8 scenarios
|
|
243
|
+
|
|
244
|
+
๐ซ Excluding scenarios with tags: @wip
|
|
245
|
+
Filtered: 8 โ 6 scenarios
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### ๐ Single Feature File Support
|
|
249
|
+
|
|
250
|
+
Target **individual feature files** directly.
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Run single feature file
|
|
254
|
+
npx k6-cucumber-steps generate -f ./features/login.feature
|
|
255
|
+
|
|
256
|
+
# Generate specific test suite
|
|
257
|
+
npx k6-cucumber-steps generate -f ./tests/regression/payment-flow.feature
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### ๐ Improved CLI Feedback
|
|
261
|
+
|
|
262
|
+
Enhanced command-line output with detailed progress information:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
$ npx k6-cucumber-steps generate -f ./features --tags @smoke
|
|
266
|
+
|
|
267
|
+
Generating k6 scripts from feature files...
|
|
268
|
+
๐ Searching for feature files in: ./features
|
|
269
|
+
โ
Found 5 feature file(s)
|
|
270
|
+
๐ Total scenarios found: 23
|
|
271
|
+
๐ท๏ธ Including scenarios with tags: @smoke
|
|
272
|
+
Filtered: 23 โ 8 scenarios
|
|
273
|
+
๐ Processing 8 scenario(s) for script generation...
|
|
274
|
+
โ
Generated k6 script: ./generated/test.generated.ts
|
|
275
|
+
๐ Scenarios processed: 8
|
|
276
|
+
```
|
|
277
|
+
|
|
163
278
|
## โจ New: Hybrid Performance Testing
|
|
164
279
|
|
|
165
280
|
You can now combine **Protocol-level (HTTP)** load testing and **Browser-level (Web Vitals)** testing in a single Gherkin suite.
|
|
@@ -219,6 +334,25 @@ The `init` command creates a clean, industry-standard directory structure:
|
|
|
219
334
|
|
|
220
335
|
## ๐ ๏ธ CLI Reference
|
|
221
336
|
|
|
337
|
+
#### Enable Autocomplete in VSCode
|
|
338
|
+
|
|
339
|
+
For autocomplete to work in your feature files:
|
|
340
|
+
|
|
341
|
+
1. **Install the Cucumber extension**: [Cucumber (Gherkin) Full Support](https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete)
|
|
342
|
+
|
|
343
|
+
2. **Create `.vscode/settings.json`** in your project root:
|
|
344
|
+
```json
|
|
345
|
+
{
|
|
346
|
+
"cucumber.features": ["features/**/*.feature"],
|
|
347
|
+
"cucumber.stepDefinitions": ["steps/**/*.ts", "steps/**/*.js"],
|
|
348
|
+
"cucumber.autocomplete.snippets": true
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
3. **Reload VSCode** - Autocomplete will show all 69 step definitions!
|
|
353
|
+
|
|
354
|
+
๐ **Full setup guide:** [VSCode Autocomplete Setup](VSCODE_AUTOCOMPLETE_SETUP.md)
|
|
355
|
+
|
|
222
356
|
#### Options
|
|
223
357
|
|
|
224
358
|
The `npx k6-cucumber-steps` command accepts the following options:
|
|
@@ -469,8 +603,19 @@ Scenario: Store and reuse values
|
|
|
469
603
|
# Debug: print stored values
|
|
470
604
|
And I k6 print alias "authToken"
|
|
471
605
|
And I k6 print all aliases
|
|
606
|
+
|
|
607
|
+
# Write alias to JSON file (NEW!)
|
|
608
|
+
And I k6 write "authToken" to "data/tokens.json"
|
|
609
|
+
And I k6 write "userId" to "data/user.json" as "id"
|
|
472
610
|
```
|
|
473
611
|
|
|
612
|
+
**Write to File Features:**
|
|
613
|
+
- โ
Creates file if it doesn't exist
|
|
614
|
+
- โ
Creates directory structure if needed
|
|
615
|
+
- โ
Supports custom key names with `as`
|
|
616
|
+
- โ
Adds timestamp to written data
|
|
617
|
+
- โ
Reads from stored aliases only
|
|
618
|
+
|
|
474
619
|
### Response Assertion Steps
|
|
475
620
|
|
|
476
621
|
```gherkin
|
|
@@ -503,6 +648,7 @@ When I k6 make a GET request to "/users/1" with headers:
|
|
|
503
648
|
|
|
504
649
|
# POST requests
|
|
505
650
|
When I k6 make a POST request to "/users"
|
|
651
|
+
When I k6 make a POST request to "/users" with payload from "payload.json"
|
|
506
652
|
|
|
507
653
|
# PUT requests
|
|
508
654
|
When I k6 make a PUT request to "/users/1"
|
|
@@ -511,6 +657,13 @@ When I k6 make a PUT request to "/users/1" with body:
|
|
|
511
657
|
# PATCH requests
|
|
512
658
|
When I k6 make a PATCH request to "/settings"
|
|
513
659
|
When I k6 make a PATCH request to "/settings" with body:
|
|
660
|
+
|
|
661
|
+
# DELETE requests (NEW!)
|
|
662
|
+
When I k6 make a DELETE request to "/users/1"
|
|
663
|
+
When I k6 make a DELETE request to "/users/{{USER_ID}}" with headers:
|
|
664
|
+
| Authorization |
|
|
665
|
+
| Bearer {{authToken}} |
|
|
666
|
+
When I k6 make a DELETE request to "/api/items/1" with payload from "data/delete-payload.json"
|
|
514
667
|
```
|
|
515
668
|
|
|
516
669
|
### Sample Features
|
package/dist/cli.js
CHANGED
|
@@ -38,25 +38,39 @@ commander_1.program
|
|
|
38
38
|
});
|
|
39
39
|
async function generateK6Scripts(options) {
|
|
40
40
|
console.log("Generating k6 scripts from feature files...");
|
|
41
|
+
console.log(`๐ Searching for feature files in: ${options.features || "./features"}`);
|
|
41
42
|
const parser = new feature_parser_1.FeatureParser();
|
|
42
43
|
const features = await parser.loadAndParseFeatures(options.features || "./features");
|
|
44
|
+
console.log(`โ
Found ${features.length} feature file(s)`);
|
|
45
|
+
// Count total scenarios before filtering
|
|
46
|
+
const totalScenarios = features.reduce((sum, f) => sum + f.scenarios.length, 0);
|
|
47
|
+
console.log(`๐ Total scenarios found: ${totalScenarios}`);
|
|
43
48
|
// Include by tags
|
|
44
49
|
if (options.tags) {
|
|
45
50
|
const includeTags = options.tags.split(",").map(t => t.trim()).filter(t => t);
|
|
51
|
+
console.log(`๐ท๏ธ Including scenarios with tags: ${includeTags.join(', ')}`);
|
|
52
|
+
let beforeCount = totalScenarios;
|
|
46
53
|
features.forEach((feature) => {
|
|
47
54
|
feature.scenarios = feature.scenarios.filter((scenario) => includeTags.some(tag => scenario.tags.includes(tag)));
|
|
48
55
|
});
|
|
56
|
+
const afterCount = features.reduce((sum, f) => sum + f.scenarios.length, 0);
|
|
57
|
+
console.log(` Filtered: ${beforeCount} โ ${afterCount} scenarios`);
|
|
49
58
|
}
|
|
50
59
|
// Exclude by tags
|
|
51
60
|
if (options.excludeTags) {
|
|
52
61
|
const excludeTags = options.excludeTags.split(",").map(t => t.trim()).filter(t => t);
|
|
62
|
+
console.log(`๐ซ Excluding scenarios with tags: ${excludeTags.join(', ')}`);
|
|
63
|
+
let beforeCount = features.reduce((sum, f) => sum + f.scenarios.length, 0);
|
|
53
64
|
features.forEach((feature) => {
|
|
54
65
|
feature.scenarios = feature.scenarios.filter((scenario) => !excludeTags.some(tag => scenario.tags.includes(tag)));
|
|
55
66
|
});
|
|
67
|
+
const afterCount = features.reduce((sum, f) => sum + f.scenarios.length, 0);
|
|
68
|
+
console.log(` Filtered: ${beforeCount} โ ${afterCount} scenarios`);
|
|
56
69
|
}
|
|
57
70
|
// Flatten all scenarios
|
|
58
71
|
const allScenarios = features.flatMap((f) => f.scenarios);
|
|
59
72
|
const metadata = parser.loadScenarioMetadata(allScenarios);
|
|
73
|
+
console.log(`๐ Processing ${allScenarios.length} scenario(s) for script generation...`);
|
|
60
74
|
const generator = new k6_script_generator_1.K6ScriptGenerator();
|
|
61
75
|
const config = {
|
|
62
76
|
language: options.lang,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AACA,aAAa;AACb,yCAAoC;AACp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GAAG,CAAC,0BAA0B,UAAU,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,2BAA2B,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { FeatureFile, Scenario, ScenarioMetadata } from "../types";
|
|
2
2
|
export declare class FeatureParser {
|
|
3
3
|
loadAndParseFeatures(featuresPath: string): Promise<FeatureFile[]>;
|
|
4
|
+
/**
|
|
5
|
+
* Recursively find all .feature files in a directory
|
|
6
|
+
*/
|
|
7
|
+
private findFeatureFilesRecursive;
|
|
4
8
|
private parseFeature;
|
|
5
9
|
/**
|
|
6
10
|
* Helper to map Gherkin AST steps to our internal Scenario Step format,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.parser.d.ts","sourceRoot":"","sources":["../../src/generators/feature.parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAQ,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,aAAa;IAClB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"feature.parser.d.ts","sourceRoot":"","sources":["../../src/generators/feature.parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAQ,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,aAAa;IAClB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAqCxE;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAmBjC,OAAO,CAAC,YAAY;IAyGpB;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAgCpC,oBAAoB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE;CA4BhE"}
|
|
@@ -44,25 +44,52 @@ const Gherkin = __importStar(require("@cucumber/gherkin"));
|
|
|
44
44
|
const Messages = __importStar(require("@cucumber/messages"));
|
|
45
45
|
class FeatureParser {
|
|
46
46
|
async loadAndParseFeatures(featuresPath) {
|
|
47
|
-
// Resolve path relative to the Current Working Directory
|
|
48
|
-
const resolvedPath = path_1.default.resolve(process.cwd(), featuresPath);
|
|
49
47
|
const featureFiles = [];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
// Handle multiple paths (comma-separated)
|
|
49
|
+
const paths = featuresPath.split(',').map(p => p.trim()).filter(p => p);
|
|
50
|
+
for (const singlePath of paths) {
|
|
51
|
+
const resolvedPath = path_1.default.resolve(process.cwd(), singlePath);
|
|
52
|
+
if (!fs_1.default.existsSync(resolvedPath)) {
|
|
53
|
+
console.warn(`โ ๏ธ Warning: The path "${singlePath}" does not exist at ${resolvedPath}`);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (fs_1.default.statSync(resolvedPath).isDirectory()) {
|
|
57
|
+
// Recursively find all .feature files in directory
|
|
58
|
+
const dirFeatureFiles = this.findFeatureFilesRecursive(resolvedPath);
|
|
59
|
+
for (const file of dirFeatureFiles) {
|
|
60
|
+
const content = fs_1.default.readFileSync(file, "utf8");
|
|
61
|
+
featureFiles.push(this.parseFeature(content, file));
|
|
60
62
|
}
|
|
61
63
|
}
|
|
64
|
+
else if (singlePath.endsWith(".feature")) {
|
|
65
|
+
// Single feature file
|
|
66
|
+
const content = fs_1.default.readFileSync(resolvedPath, "utf8");
|
|
67
|
+
featureFiles.push(this.parseFeature(content, resolvedPath));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
console.warn(`โ ๏ธ Warning: "${singlePath}" is not a directory or .feature file`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (featureFiles.length === 0) {
|
|
74
|
+
throw new Error(`No feature files found in: ${featuresPath}`);
|
|
62
75
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
return featureFiles;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Recursively find all .feature files in a directory
|
|
80
|
+
*/
|
|
81
|
+
findFeatureFilesRecursive(dirPath) {
|
|
82
|
+
const featureFiles = [];
|
|
83
|
+
const entries = fs_1.default.readdirSync(dirPath, { withFileTypes: true });
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
const fullPath = path_1.default.join(dirPath, entry.name);
|
|
86
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
87
|
+
// Recursively search subdirectories (exclude hidden and node_modules)
|
|
88
|
+
featureFiles.push(...this.findFeatureFilesRecursive(fullPath));
|
|
89
|
+
}
|
|
90
|
+
else if (entry.isFile() && entry.name.endsWith(".feature")) {
|
|
91
|
+
featureFiles.push(fullPath);
|
|
92
|
+
}
|
|
66
93
|
}
|
|
67
94
|
return featureFiles;
|
|
68
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.parser.js","sourceRoot":"","sources":["../../src/generators/feature.parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,4CAAoB;AACpB,gDAAwB;AACxB,2DAA6C;AAC7C,6DAA+C;AAG/C,MAAa,aAAa;IACxB,KAAK,CAAC,oBAAoB,CAAC,YAAoB;QAC7C,
|
|
1
|
+
{"version":3,"file":"feature.parser.js","sourceRoot":"","sources":["../../src/generators/feature.parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,4CAAoB;AACpB,gDAAwB;AACxB,2DAA6C;AAC7C,6DAA+C;AAG/C,MAAa,aAAa;IACxB,KAAK,CAAC,oBAAoB,CA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CAAC,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AArOD,sCAqOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample-steps.generator.d.ts","sourceRoot":"","sources":["../../../src/generators/samples/sample-steps.generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAgBzD,OAAO,CAAC,uBAAuB;
|
|
1
|
+
{"version":3,"file":"sample-steps.generator.d.ts","sourceRoot":"","sources":["../../../src/generators/samples/sample-steps.generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAgBzD,OAAO,CAAC,uBAAuB;CAgyChC"}
|
|
@@ -262,6 +262,96 @@ export function k6IStoreIn(jsonPath: any, fileName: any) {
|
|
|
262
262
|
console.log(\` Aliases available: \${alias}, \${fileName}\`);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* And I k6 write "aliasName" to "data/file.json"
|
|
267
|
+
* Writes an alias value to a JSON file. Creates the file if it doesn't exist.
|
|
268
|
+
*/
|
|
269
|
+
export function k6IWriteTo(aliasName: string, fileName: string) {
|
|
270
|
+
const fs = require('fs');
|
|
271
|
+
const path = require('path');
|
|
272
|
+
|
|
273
|
+
// Get the alias value
|
|
274
|
+
const value = globalThis.storedAliases?.[aliasName];
|
|
275
|
+
|
|
276
|
+
if (value === undefined) {
|
|
277
|
+
console.error(\`โ Alias "\${aliasName}" not found. Available aliases:\`, globalThis.storedAliases ? Object.keys(globalThis.storedAliases) : 'none');
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Resolve file path
|
|
282
|
+
let filePath = fileName;
|
|
283
|
+
if (!path.isAbsolute(fileName)) {
|
|
284
|
+
filePath = path.join(process.cwd(), fileName);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Ensure directory exists
|
|
288
|
+
const dir = path.dirname(filePath);
|
|
289
|
+
if (!fs.existsSync(dir)) {
|
|
290
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
291
|
+
console.log(\`๐ Created directory: \${dir}\`);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Prepare data to write
|
|
295
|
+
let dataToWrite;
|
|
296
|
+
|
|
297
|
+
// If value is already an object/array, use it directly
|
|
298
|
+
if (typeof value === 'object') {
|
|
299
|
+
dataToWrite = value;
|
|
300
|
+
} else {
|
|
301
|
+
// If it's a primitive, wrap it in an object with the alias name as key
|
|
302
|
+
dataToWrite = {
|
|
303
|
+
[aliasName]: value,
|
|
304
|
+
writtenAt: new Date().toISOString()
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Write to file
|
|
309
|
+
fs.writeFileSync(filePath, JSON.stringify(dataToWrite, null, 2));
|
|
310
|
+
console.log(\`โ
Wrote alias "\${aliasName}" to \${filePath}\`);
|
|
311
|
+
console.log(\` Value: \${typeof value === 'string' && value.length > 20 ? value.substring(0, 20) + '...' : JSON.stringify(value)}\`);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* And I k6 write "aliasName" to "data/file.json" as "customKey"
|
|
316
|
+
* Writes an alias value to a JSON file with a custom key name.
|
|
317
|
+
*/
|
|
318
|
+
export function k6IWriteToAs(aliasName: string, fileName: string, customKey: string) {
|
|
319
|
+
const fs = require('fs');
|
|
320
|
+
const path = require('path');
|
|
321
|
+
|
|
322
|
+
// Get the alias value
|
|
323
|
+
const value = globalThis.storedAliases?.[aliasName];
|
|
324
|
+
|
|
325
|
+
if (value === undefined) {
|
|
326
|
+
console.error(\`โ Alias "\${aliasName}" not found. Available aliases:\`, globalThis.storedAliases ? Object.keys(globalThis.storedAliases) : 'none');
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Resolve file path
|
|
331
|
+
let filePath = fileName;
|
|
332
|
+
if (!path.isAbsolute(fileName)) {
|
|
333
|
+
filePath = path.join(process.cwd(), fileName);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Ensure directory exists
|
|
337
|
+
const dir = path.dirname(filePath);
|
|
338
|
+
if (!fs.existsSync(dir)) {
|
|
339
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
340
|
+
console.log(\`๐ Created directory: \${dir}\`);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Prepare data with custom key
|
|
344
|
+
const dataToWrite = {
|
|
345
|
+
[customKey]: value,
|
|
346
|
+
writtenAt: new Date().toISOString()
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
// Write to file
|
|
350
|
+
fs.writeFileSync(filePath, JSON.stringify(dataToWrite, null, 2));
|
|
351
|
+
console.log(\`โ
Wrote alias "\${aliasName}" as "\${customKey}" to \${filePath}\`);
|
|
352
|
+
console.log(\` Value: \${typeof value === 'string' && value.length > 20 ? value.substring(0, 20) + '...' : JSON.stringify(value)}\`);
|
|
353
|
+
}
|
|
354
|
+
|
|
265
355
|
export function k6IAmAuthenticatedAsA(userType: any) {
|
|
266
356
|
const token = globalThis.savedTokens?.[\`data/\${userType}.json\`] ||
|
|
267
357
|
globalThis.savedTokens?.[userType];
|
|
@@ -526,6 +616,68 @@ export function k6IMakeAPatchRequestToWithBody(endpoint: string, bodyData: any)
|
|
|
526
616
|
globalThis.lastResponse = response;
|
|
527
617
|
}
|
|
528
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Makes a DELETE request to the specified endpoint.
|
|
621
|
+
* Supports {{VARIABLE_NAME}} for env vars in endpoint.
|
|
622
|
+
*/
|
|
623
|
+
export function k6IMakeADeleteRequestTo(endpoint: string) {
|
|
624
|
+
const resolvedEndpoint = replaceEnvVariables(endpoint);
|
|
625
|
+
const url = \`\${baseUrl}\${resolvedEndpoint}\`;
|
|
626
|
+
const response = http.del(url, null, { headers: defaultHeaders });
|
|
627
|
+
globalThis.lastResponse = response;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Makes a DELETE request with custom headers.
|
|
632
|
+
* Supports {{VARIABLE_NAME}} for env vars in endpoint.
|
|
633
|
+
*/
|
|
634
|
+
export function k6IMakeADeleteRequestToWithHeaders(endpoint: string, headersTable: any) {
|
|
635
|
+
const resolvedEndpoint = replaceEnvVariables(endpoint);
|
|
636
|
+
const url = \`\${baseUrl}\${resolvedEndpoint}\`;
|
|
637
|
+
let requestHeaders = { ...defaultHeaders };
|
|
638
|
+
if (headersTable?.length > 0) {
|
|
639
|
+
Object.assign(requestHeaders, headersTable[0]);
|
|
640
|
+
}
|
|
641
|
+
const response = http.del(url, null, { headers: requestHeaders });
|
|
642
|
+
globalThis.lastResponse = response;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Makes a DELETE request using a payload.json file.
|
|
647
|
+
* Supports {{VARIABLE_NAME}} for env vars and {{alias:NAME}} for stored aliases.
|
|
648
|
+
*/
|
|
649
|
+
export function k6IMakeADeleteRequestToWithPayloadFile(endpoint: string, fileName: string) {
|
|
650
|
+
const fs = require('fs');
|
|
651
|
+
const path = require('path');
|
|
652
|
+
|
|
653
|
+
// Resolve payload file path
|
|
654
|
+
let filePath = fileName;
|
|
655
|
+
if (!path.isAbsolute(fileName)) {
|
|
656
|
+
if (fs.existsSync(path.join(process.cwd(), 'data', fileName))) {
|
|
657
|
+
filePath = path.join(process.cwd(), 'data', fileName);
|
|
658
|
+
} else if (fs.existsSync(path.join(process.cwd(), fileName))) {
|
|
659
|
+
filePath = path.join(process.cwd(), fileName);
|
|
660
|
+
} else {
|
|
661
|
+
filePath = path.join(process.cwd(), 'payload.json');
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (!fs.existsSync(filePath)) {
|
|
666
|
+
console.error(\`โ Payload file not found: \${filePath}\`);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
let payloadContent = fs.readFileSync(filePath, 'utf8');
|
|
671
|
+
payloadContent = replaceEnvVariables(payloadContent);
|
|
672
|
+
payloadContent = replaceAliasVariables(payloadContent);
|
|
673
|
+
|
|
674
|
+
const resolvedEndpoint = replaceEnvVariables(endpoint);
|
|
675
|
+
const url = \`\${baseUrl}\${resolvedEndpoint}\`;
|
|
676
|
+
const response = http.del(url, payloadContent, { headers: defaultHeaders });
|
|
677
|
+
globalThis.lastResponse = response;
|
|
678
|
+
console.log(\`๐๏ธ DELETE \${url} with payload from \${filePath}\`);
|
|
679
|
+
}
|
|
680
|
+
|
|
529
681
|
export function k6TheResponsePropertyShouldBe(propertyPath: string, expectedValue: string) {
|
|
530
682
|
const res = globalThis.lastResponse;
|
|
531
683
|
if (!res) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample-steps.generator.js","sourceRoot":"","sources":["../../../src/generators/samples/sample-steps.generator.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAmD;AACnD,4CAAoB;AACpB,gDAAwB;AAExB,yEAAoE;AAEpE,MAAa,oBAAoB;IAC/B,QAAQ,CAAC,UAAkB,EAAE,MAAqB;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC;QACtC,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAEvD,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6xCV,CAAC;IACA,CAAC;CACF;AAjzCD,oDAizCC"}
|
package/dist/metadata.json
CHANGED
|
@@ -39,6 +39,27 @@
|
|
|
39
39
|
"fileName: string"
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
"step": "I k6 write {string} to {string}",
|
|
44
|
+
"functionName": "k6IWriteTo",
|
|
45
|
+
"description": "Writes an alias value to a JSON file (creates file if not exists)",
|
|
46
|
+
"category": "Storage",
|
|
47
|
+
"parameters": [
|
|
48
|
+
"aliasName: string",
|
|
49
|
+
"fileName: string"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"step": "I k6 write {string} to {string} as {string}",
|
|
54
|
+
"functionName": "k6IWriteToAs",
|
|
55
|
+
"description": "Writes an alias value to a JSON file with custom key name",
|
|
56
|
+
"category": "Storage",
|
|
57
|
+
"parameters": [
|
|
58
|
+
"aliasName: string",
|
|
59
|
+
"fileName: string",
|
|
60
|
+
"customKey: string"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
42
63
|
{
|
|
43
64
|
"step": "I k6 store response {string} as {string}",
|
|
44
65
|
"functionName": "k6IStoreResponseAs",
|
|
@@ -178,6 +199,35 @@
|
|
|
178
199
|
"fileName: string"
|
|
179
200
|
]
|
|
180
201
|
},
|
|
202
|
+
{
|
|
203
|
+
"step": "I k6 make a DELETE request to {string}",
|
|
204
|
+
"functionName": "k6IMakeADeleteRequestTo",
|
|
205
|
+
"description": "Makes a DELETE request to the specified endpoint (supports {{VARIABLE_NAME}})",
|
|
206
|
+
"category": "HTTP",
|
|
207
|
+
"parameters": [
|
|
208
|
+
"endpoint: string"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"step": "I k6 make a DELETE request to {string} with headers:",
|
|
213
|
+
"functionName": "k6IMakeADeleteRequestToWithHeaders",
|
|
214
|
+
"description": "Makes a DELETE request with custom headers (supports {{VARIABLE_NAME}})",
|
|
215
|
+
"category": "HTTP",
|
|
216
|
+
"parameters": [
|
|
217
|
+
"endpoint: string",
|
|
218
|
+
"headersTable: any"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"step": "I k6 make a DELETE request to {string} with payload from {string}",
|
|
223
|
+
"functionName": "k6IMakeADeleteRequestToWithPayloadFile",
|
|
224
|
+
"description": "Makes a DELETE request using a payload.json file (supports {{VARIABLE_NAME}} and {{alias:NAME}})",
|
|
225
|
+
"category": "HTTP",
|
|
226
|
+
"parameters": [
|
|
227
|
+
"endpoint: string",
|
|
228
|
+
"fileName: string"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
181
231
|
{
|
|
182
232
|
"step": "the k6 response status should be {string}",
|
|
183
233
|
"functionName": "k6TheResponseStatusShouldBe",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "k6-cucumber-steps",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10-alpha.0",
|
|
4
4
|
"description": "Generate k6 test scripts from Cucumber feature files",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -30,13 +30,24 @@
|
|
|
30
30
|
"homepage": "https://github.com/qaPaschalE/k6-cucumber-steps#readme",
|
|
31
31
|
"keywords": [
|
|
32
32
|
"k6",
|
|
33
|
+
"k6 testing",
|
|
34
|
+
"k6-cucumber-steps",
|
|
33
35
|
"cucumber",
|
|
36
|
+
"cucumber-js",
|
|
34
37
|
"gherkin",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"performance",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
38
|
+
"bdd",
|
|
39
|
+
"behavior-driven development",
|
|
40
|
+
"performance testing",
|
|
41
|
+
"load testing",
|
|
42
|
+
"stress testing",
|
|
43
|
+
"api testing",
|
|
44
|
+
"browser testing",
|
|
45
|
+
"test automation",
|
|
46
|
+
"k6 browser",
|
|
47
|
+
"k6 load testing",
|
|
48
|
+
"performance automation",
|
|
49
|
+
"typescript testing",
|
|
50
|
+
"javascript testing"
|
|
40
51
|
],
|
|
41
52
|
"author": "Enyimiri Chetachi Paschal (qaPaschalE)",
|
|
42
53
|
"license": "MIT",
|