-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathRunCucumberTest.java
40 lines (31 loc) · 1.06 KB
/
RunCucumberTest.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
36
37
38
39
40
import cucumber.api.java.Before;
import cucumber.api.testng.CucumberFeatureWrapper;
import cucumber.api.testng.TestNGCucumberRunner;
import org.testng.annotations.*;
import steps.ExceptionChecker;
import steps.World;
import java.util.List;
public class RunCucumberTest {
private TestNGCucumberRunner testNGCucumberRunner;
@BeforeClass(alwaysRun = true)
public void setUpCucumber() {
testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
}
@Before
public void setState() {
World.reset();
ExceptionChecker.reset();
}
@Test(groups = "cucumber", description = "Runs Cucumber Feature", dataProvider = "features")
public void feature(CucumberFeatureWrapper cucumberFeature) {
testNGCucumberRunner.runCucumber(cucumberFeature.getCucumberFeature());
}
@DataProvider
public Object[][] features() {
return testNGCucumberRunner.provideFeatures();
}
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
testNGCucumberRunner.finish();
}
}