forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DemoTestSelected.java
35 lines (30 loc) · 1.04 KB
/
DemoTestSelected.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package demo;
import com.intuit.karate.Runner;
import com.intuit.karate.Results;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* an alternative way to run selected paths, tags and even features using the
* java api here you don't need to use the CucumberOptions and you can
* dynamically determine the features that need to be executed
*
* @author pthomas3
*/
public class DemoTestSelected {
@BeforeClass
public static void beforeClass() throws Exception {
TestBase.beforeClass();
}
@Test
public void testSelected() {
List<String> tags = Arrays.asList("~@ignore");
List<String> features = Arrays.asList("classpath:demo/cats");
String karateOutputPath = "target/surefire-reports";
Results results = Runner.parallel(tags, features, 5, karateOutputPath);
DemoTestParallel.generateReport(karateOutputPath);
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
}
}