From c496f976d1c12d3e3c0ee6ec229c09355bee8e7e Mon Sep 17 00:00:00 2001 From: Peter Thomas Date: Tue, 7 Nov 2023 18:34:56 +0530 Subject: [PATCH] improve some test examples --- .../src/test/java/demo/tags/TagsRunner.java | 22 +++++++++++++++++++ .../src/test/java/demo/tags/first.feature | 2 +- .../src/test/java/demo/tags/second.feature | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 karate-demo/src/test/java/demo/tags/TagsRunner.java diff --git a/karate-demo/src/test/java/demo/tags/TagsRunner.java b/karate-demo/src/test/java/demo/tags/TagsRunner.java new file mode 100644 index 000000000..cd559d481 --- /dev/null +++ b/karate-demo/src/test/java/demo/tags/TagsRunner.java @@ -0,0 +1,22 @@ +package demo.tags; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; + +/** + * + * @author peter + */ +class TagsRunner { + + @Test + void testParallel() { + Results results = Runner.path("classpath:demo/tags") + .configDir("classpath:demo/tags") + .parallel(1); + assertTrue(results.getFailCount() == 0, results.getErrorMessages()); + } + +} diff --git a/karate-demo/src/test/java/demo/tags/first.feature b/karate-demo/src/test/java/demo/tags/first.feature index 9ddac3987..85f32cced 100644 --- a/karate-demo/src/test/java/demo/tags/first.feature +++ b/karate-demo/src/test/java/demo/tags/first.feature @@ -1,7 +1,7 @@ @smoke Feature: tags demo - first run the following example from the command line: - mvn test -Dcucumber.options="--tags @smoke" -Dtest=TagsRunner + mvn test -Dkarate.options="--tags @smoke" -Dtest=TagsRunner Scenario: f1 - s1 * print 'first feature:@smoke, first scenario' diff --git a/karate-demo/src/test/java/demo/tags/second.feature b/karate-demo/src/test/java/demo/tags/second.feature index 4a9c8726d..dea4a94cc 100644 --- a/karate-demo/src/test/java/demo/tags/second.feature +++ b/karate-demo/src/test/java/demo/tags/second.feature @@ -1,6 +1,6 @@ Feature: tags demo - second run the following example from the command line: - mvn test -Dcucumber.options="--tags @smoke" -Dtest=TagsRunner + mvn test -Dkarate.options="--tags @smoke" -Dtest=TagsRunner Scenario: f2 - s1 * print 'second feature, first scenario'