Skip to content

Commit 5676bc8

Browse files
committed
Correctly run untitled scenario outlines
This fixes #731.
1 parent 8143065 commit 5676bc8

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

features/issues/731.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://github.com/badeball/cypress-cucumber-preprocessor/issues/731
2+
3+
Feature: blank titles
4+
Scenario: blank scenario outline title
5+
Given a file named "cypress/e2e/a.feature" with:
6+
"""
7+
Feature: a feature
8+
Scenario Outline:
9+
Given a step
10+
11+
Examples:
12+
| value |
13+
| foo |
14+
"""
15+
And a file named "cypress/support/step_definitions/steps.js" with:
16+
"""
17+
const { Given } = require("@badeball/cypress-cucumber-preprocessor");
18+
Given("a step", () => {})
19+
"""
20+
When I run cypress
21+
Then it passes

lib/create-tests.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,7 @@ function createScenario(
241241

242242
const pickle = findPickleById(context, exampleId);
243243

244-
const baseName = assertAndReturn(
245-
pickle.name,
246-
"Expected pickle to have a name"
247-
);
244+
const baseName = pickle.name || "<unamed scenario>";
248245

249246
const exampleName = `${baseName} (example #${i + 1})`;
250247

0 commit comments

Comments
 (0)