1

我想整合 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。我认为这是因为驱动程序实例@BeforeMethodGalenTestNgTestBase.

有什么建议我怎样才能实现这种整合?

4

1 回答 1

0

您可以尝试使用我的示例项目(https://github.com/hypery2k/galen_samples)并查看如何在 GalenBaseTest.java 中传递驱动程序实例

于 2017-08-31T06:35:52.857 回答