forked from damianszczepanik/cucumber-reporting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloCucumberTest.java
35 lines (28 loc) · 1.3 KB
/
HelloCucumberTest.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
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import net.masterthought.cucumber.Configuration;
import net.masterthought.cucumber.ReportBuilder;
import net.masterthought.cucumber.presentation.PresentationMode;
import net.masterthought.cucumber.sorting.SortingMethod;
public class HelloCucumberTest {
// test annotation only to make sure it is generated during "mvn test"
@Test
public void generateReport() throws IOException {
File reportOutputDirectory = new File("target/demo");
List<String> jsonFiles = new ArrayList<>();
jsonFiles.add("src/test/resources/json/sample.json");
String buildNumber = "101";
String projectName = "Live Demo Project";
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setBuildNumber(buildNumber);
configuration.addClassifications("Browser", "Firefox");
configuration.addClassifications("Branch", "release/1.0");
configuration.setSortingMethod(SortingMethod.NATURAL);
configuration.addPresentationModes(PresentationMode.EXPAND_ALL_STEPS);
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
reportBuilder.generateReports();
}
}