将Galen框架与黄瓜

时间:2017-08-26 10:12:07

标签: selenium cucumber galen

我想整合Galen和Cucumber。我的目的是在Cucumber功能步骤中运行Galen specs配置。 为此,我写下以下内容:

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());

    }
}

哪个GalenTestBasehttps://github.com/galenframework/galen-sample-java-tests.git中具有相同名称的类,First(类的名称)是要素的名称。

问题是我得到 java.lang.RuntimeException: The driver is not instantiated yet 。 我认为这是因为驱动程序实例化在@BeforeMethod的{​​{1}}。

有任何建议我如何实现这种整合?

1 个答案:

答案 0 :(得分:0)

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

相关问题