executable-stories-playwright 7.0.2 → 8.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "executable-stories-playwright",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "BDD-style executable stories for Playwright Test with documentation generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@playwright/test": ">=1.58.2",
|
|
29
|
-
"executable-stories-formatters": "^0.
|
|
30
|
-
"autotel": ">=2.
|
|
29
|
+
"executable-stories-formatters": "^0.7.0",
|
|
30
|
+
"autotel": ">=2.24.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
"autotel": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@opentelemetry/api": "^1.9.0",
|
|
40
40
|
"@playwright/test": "^1.58.2",
|
|
41
|
-
"@types/node": "^25.
|
|
41
|
+
"@types/node": "^25.5.0",
|
|
42
42
|
"tsup": "^8.5.1",
|
|
43
43
|
"typescript": "~5.9.3",
|
|
44
|
-
"executable-stories-formatters": "0.
|
|
44
|
+
"executable-stories-formatters": "0.7.0"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
@@ -205,3 +205,32 @@ test("my test", async ({ page }, testInfo) => {
|
|
|
205
205
|
Steps called before `init()` are silently dropped because no story context exists.
|
|
206
206
|
|
|
207
207
|
Source: packages/eslint-plugin-executable-stories-playwright/src/rules/require-story-context-for-steps.ts
|
|
208
|
+
|
|
209
|
+
## Parameterized Scenarios (Scenario Outline equivalent)
|
|
210
|
+
|
|
211
|
+
Use Playwright's data-driven pattern with `story()` to produce one scenario per data row — the framework-native replacement for Cucumber's Scenario Outline + Examples.
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
import { test } from "@playwright/test";
|
|
215
|
+
import { story, given, when, then } from "executable-stories-playwright";
|
|
216
|
+
|
|
217
|
+
const cases = [
|
|
218
|
+
{ input: 1, expected: 2 },
|
|
219
|
+
{ input: 2, expected: 4 },
|
|
220
|
+
{ input: 3, expected: 6 },
|
|
221
|
+
];
|
|
222
|
+
|
|
223
|
+
for (const { input, expected } of cases) {
|
|
224
|
+
test(`doubles ${input} to ${expected}`, async ({ page }) => {
|
|
225
|
+
story(`Doubles ${input} to ${expected}`);
|
|
226
|
+
given(`the input is ${input}`);
|
|
227
|
+
when("the doubler runs");
|
|
228
|
+
then(`the result is ${expected}`);
|
|
229
|
+
// ... assertions
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Each iteration produces a separate scenario in the generated report. Use interpolated titles so each scenario has a distinct, descriptive name.
|
|
235
|
+
|
|
236
|
+
Note: Playwright does not have `it.each` — use a `for...of` loop instead.
|