我想先运行多个功能文件partyfeatures.feature和下一个policyfeature.feature,但是我无法运行第二个功能文件。下面是我的跑步课。
@RunWith(Cucumber.class)
@CucumberOptions(features = {"src/test/resources"},
glue = {"com.cucumber.bhsibase.party.tests"})
public class TestRunner {
//runner class
public static WebDriver driver ;
private TestNGCucumberRunner testNGCucumberRunner;
@BeforeClass(alwaysRun = true)
public void setUpClass() throws Exception {
ConfigReader reader = new ConfigReader();
driver = new FirefoxDriver() ;
driver.get(reader.readurls("ExpressURL"));
testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
}
@Test(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 {
driver.quit();
testNGCucumberRunner.finish();
}
}