Skip to content

Commit 415649c

Browse files
committed
2384: Fix edge case bug for @setup in dry run mode
There are steps with no parent scenarios. Ex: background Added null check.
1 parent 031d32d commit 415649c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

karate-core/src/main/java/com/intuit/karate/core/Step.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public boolean isFake() {
228228
}
229229

230230
public boolean isSetup() {
231-
return scenario.isSetup();
231+
return scenario !=null && scenario.isSetup();
232232
}
233233

234234
@Override

karate-junit5/src/test/java/karate/setup-with-dryrun.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Feature: names
22

3+
Background:
4+
* print 'background'
5+
36
@setup
47
Scenario: first hello world
58
* def names = [{"name": "dynamic_1"}, {"name": "dynamic_2"}]

0 commit comments

Comments
 (0)