我想整合 Galen 和 Cucumber。我的意图是在 Cucumber 功能步骤中运行 Galen 规格配置。为此,我写了以下内容:
public class First extends GalenTestBase{
@Given("^First Step$")
public void firstStep() throws Throwable {
System.out.println("First step runs");
TestDevice device = new TestDevice("mobile", new Dimension(450, 800), asList("mobile"));
load("/");
checkLayout("/specs/welcomePage.spec", device.getTags());
}
}
哪个是来自https://github.com/galenframework/galen-sample-java-tests.gitGalenTestBase
的同名类和First
(类的名称)是功能的名称。
问题是我得到了java.lang.RuntimeException: The driver is not instantiated yet
。我认为这是因为驱动程序实例@BeforeMethod
化GalenTestNgTestBase
.
有什么建议我怎样才能实现这种整合?