This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the bug while running on parallel using TestNG (#31)
- Loading branch information
1 parent
c3ba300
commit 65de5b5
Showing
9 changed files
with
118 additions
and
36 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
*.iml | ||
target | ||
output | ||
*.DS_Store | ||
*.DS_Store | ||
/test-output/report.html |
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
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
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
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
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
23 changes: 23 additions & 0 deletions
23
src/test/java/com/cucumber/runner/MyTestNGCukesRunner.java
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,23 @@ | ||
package com.cucumber.runner; | ||
|
||
import com.cucumber.listener.Reporter; | ||
import cucumber.api.CucumberOptions; | ||
import cucumber.api.testng.AbstractTestNGCucumberTests; | ||
import org.testng.annotations.AfterClass; | ||
|
||
import java.io.File; | ||
|
||
@CucumberOptions( | ||
features = {"src/test/resources/features/MySecondFeature.feature"}, | ||
glue = {"com.cucumber.stepdefinitions"}, | ||
plugin = {"com.cucumber.listener.ExtentCucumberFormatter"} | ||
) | ||
public class MyTestNGCukesRunner extends AbstractTestNGCucumberTests { | ||
@AfterClass | ||
public static void setup() { | ||
Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml")); | ||
Reporter.setSystemInfo("user", System.getProperty("user.name")); | ||
Reporter.setSystemInfo("os", "Mac OSX"); | ||
Reporter.setTestRunnerOutput("Sample test runner output message"); | ||
} | ||
} |
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,23 @@ | ||
package com.cucumber.runner; | ||
|
||
import com.cucumber.listener.Reporter; | ||
import cucumber.api.CucumberOptions; | ||
import cucumber.api.testng.AbstractTestNGCucumberTests; | ||
import org.testng.annotations.AfterClass; | ||
|
||
import java.io.File; | ||
|
||
@CucumberOptions( | ||
features = {"src/test/resources/features/MyFeature.feature"}, | ||
glue = {"com.cucumber.stepdefinitions"}, | ||
plugin = {"com.cucumber.listener.ExtentCucumberFormatter"} | ||
) | ||
public class TestNGCukesRunner extends AbstractTestNGCucumberTests { | ||
@AfterClass | ||
public static void setup() { | ||
Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml")); | ||
Reporter.setSystemInfo("user", System.getProperty("user.name")); | ||
Reporter.setSystemInfo("os", "Mac OSX"); | ||
Reporter.setTestRunnerOutput("Sample test runner output message"); | ||
} | ||
} |
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,10 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
|
||
<suite name="Suite1" verbose="2" parallel="classes"> | ||
<test name="Test" > | ||
<classes> | ||
<class name="com.cucumber.runner.TestNGCukesRunner" /> | ||
<class name="com.cucumber.runner.MyTestNGCukesRunner" /> | ||
</classes> | ||
</test> | ||
</suite> |