playwright-cucumber-ts-steps 1.0.7 → 1.0.9
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/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +15 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAOA,OAAO,0BAA0B,CAAC;AAClC,OAAO,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAE/B,OAAO,qBAAqB,CAAC;AAE7B,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAOA,OAAO,0BAA0B,CAAC;AAClC,OAAO,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,uBAAuB,CAAC;AAE/B,OAAO,qBAAqB,CAAC;AAE7B,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,QAgIpE"}
|
package/dist/core/runner.js
CHANGED
|
@@ -56,7 +56,12 @@ function runTests(featureGlob, options) {
|
|
|
56
56
|
if (options?.dbQuery) {
|
|
57
57
|
state_1.dbState.setAdapter(options.dbQuery);
|
|
58
58
|
}
|
|
59
|
+
// Debugging: Verify files are found to help user troubleshoot paths
|
|
59
60
|
const files = (0, glob_1.globSync)(featureGlob);
|
|
61
|
+
if (files.length === 0) {
|
|
62
|
+
console.warn(`⚠️ No Feature files found matching: "${featureGlob}"`);
|
|
63
|
+
console.warn(` Current Directory: ${process.cwd()}`);
|
|
64
|
+
}
|
|
60
65
|
for (const file of files) {
|
|
61
66
|
const content = fs.readFileSync(file, "utf8");
|
|
62
67
|
const featureMatch = content.match(/Feature:\s*(.+)/);
|
|
@@ -64,9 +69,14 @@ function runTests(featureGlob, options) {
|
|
|
64
69
|
? featureMatch[1].trim()
|
|
65
70
|
: "Unnamed Feature";
|
|
66
71
|
test_1.test.describe(featureName, () => {
|
|
67
|
-
|
|
72
|
+
// 2. SAFER REGEX FIX
|
|
73
|
+
// Old: /(@[\w\s@]+)\s+)?Scenario:... (Too greedy, ate newlines)
|
|
74
|
+
// New: /(@[^:\r\n]+)\s+)?Scenario:... (Stops strictly at newlines/colons)
|
|
75
|
+
const scenarioRegex = /(?:(@[^:\r\n]+)\s+)?Scenario:\s*(.+)/g;
|
|
68
76
|
let match;
|
|
77
|
+
let scenarioCount = 0;
|
|
69
78
|
while ((match = scenarioRegex.exec(content)) !== null) {
|
|
79
|
+
scenarioCount++;
|
|
70
80
|
// 1. CAPTURE DATA IMMEDIATELY
|
|
71
81
|
const foundTags = match[1] || "";
|
|
72
82
|
const scenarioName = match[2].trim();
|
|
@@ -137,6 +147,10 @@ function runTests(featureGlob, options) {
|
|
|
137
147
|
}
|
|
138
148
|
});
|
|
139
149
|
}
|
|
150
|
+
// Safety check log: warn if we opened a file but found no scenarios
|
|
151
|
+
if (scenarioCount === 0) {
|
|
152
|
+
console.warn(`⚠️ Found "Feature:" in ${file} but 0 Scenarios. Check regex or formatting.`);
|
|
153
|
+
}
|
|
140
154
|
});
|
|
141
155
|
}
|
|
142
156
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-cucumber-ts-steps",
|
|
3
3
|
"description": "A collection of reusable Playwright step definitions for Cucumber in TypeScript, designed to streamline end-to-end testing across web, API, and mobile applications.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|