Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Commit

Permalink
Fixed build error and test error
Browse files Browse the repository at this point in the history
  • Loading branch information
email2vimalraj committed Jun 26, 2017
1 parent 4261e73 commit ed0b51f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
14 changes: 5 additions & 9 deletions src/main/java/com/cucumber/listener/ExtentCucumberFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,11 @@ private static void setExtentHtmlReport(File file) {
if (htmlReporter != null) {
return;
}
try {
if (!file.exists()) {
file.getParentFile().mkdirs();
}
} catch (NullPointerException e) {
if (file == null || file.getPath().isEmpty()) {
file = new File(ExtentProperties.INSTANCE.getReportPath());
if (!file.exists()) {
file.getParentFile().mkdirs();
}
}
if (!file.exists()) {
file.getParentFile().mkdirs();
}
htmlReporter = new ExtentHtmlReporter(file);
}
Expand All @@ -65,7 +61,7 @@ private static void setExtentReport() {
}
extentReports = new ExtentReports();
ExtentProperties extentProperties = ExtentProperties.INSTANCE;
if (extentProperties.getExtentXServerUrl() != null || !extentProperties.getExtentXServerUrl().isEmpty()) {
if (extentProperties.getExtentXServerUrl() != null) {
String extentXServerUrl = extentProperties.getExtentXServerUrl();
try {
URL url = new URL(extentXServerUrl);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/cucumber/runner/RunCukesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class RunCukesTest {
@BeforeClass
public static void setup() {
ExtentProperties extentProperties = ExtentProperties.INSTANCE;
extentProperties.setExtentXServerUrl("http://localhost:1337");
extentProperties.setProjectName("MyProject");
// extentProperties.setExtentXServerUrl("http://localhost:1337");
// extentProperties.setProjectName("MyProject");
extentProperties.setReportPath("output/myreport.html");
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/cucumber/runner/TestNGCukesRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class TestNGCukesRunner extends AbstractTestNGCucumberTests {
@BeforeClass
public static void setup() {
ExtentProperties extentProperties = ExtentProperties.INSTANCE;
extentProperties.setExtentXServerUrl("http://localhost:1337");
extentProperties.setProjectName("TestNGProject");
// extentProperties.setExtentXServerUrl("http://localhost:1337");
// extentProperties.setProjectName("TestNGProject");
extentProperties.setReportPath("output/myreport.html");
}

Expand Down

0 comments on commit ed0b51f

Please sign in to comment.