Let's say I have 2 runners (A.class & B.class) which extend parent class and this parent class has @beforeclass{initialize all util methods} and @afterclass{ once the methods are successfully invoked close the connection} implementation. A.class is a cucumber test runner and let's say, when ran has 1000 tests. B.class is another cucumber test runner and when ran has 500 tests to be passed. So, now how do I combine these two classes(i.e., A.class and B.class) into a single runner so that I can run all 1500 tests in a single runner instead of using two different runners.?
I tried creating an another class with these two classes loaded in it to run one after another, but once A.class is initialized it's successfully able to pass all tests from A.class and couldn't establish connection to B.class as the extended parent class has @beforeclass and @afterclass which disconnects when the tests are ran for A.class. Do i need to look upon VM arguments.?
FYR,
@RunWith(Cucumber.class)
@CucumberOptions(
features = "----",
plugin = {"pretty", "json:target/cucumber/cucumber.json", "junit:target/cucumber/cucumber-junit.xml"},
tags = {"@--", "~@--"}
)
public class A extends parentclass {
}
----------------------------------------------------
@RunWith(Cucumber.class)
@CucumberOptions(
features = "----",
plugin = {"pretty", "json:target/cucumber/cucumber.json", "junit:target/cucumber/cucumber-junit.xml"},
tags = {"@--", "~@--"}
)
public class B extends parentclass {
}
How do i combine these two classes to execute all in one extending this parent class.