-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding abort example to demo for discussion ref #755
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package demo.abort; | ||
|
||
import com.intuit.karate.junit4.Karate; | ||
import org.junit.BeforeClass; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* | ||
* @author pthomas3 | ||
*/ | ||
@RunWith(Karate.class) | ||
public class AbortRunner { | ||
|
||
@BeforeClass | ||
public static void beforeClass() { | ||
// skip 'callSingle' in karate-config.js | ||
System.setProperty("karate.env", "mock"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Feature: abort should skip (but not fail) a test | ||
|
||
Scenario: you can conditionally exit a test | ||
but please use sparingly | ||
|
||
* print 'before' | ||
* eval if (true) karate.abort() | ||
* print 'after' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters