如何从故事文件(安全性)触发Junit测试?

时间:2018-10-06 21:21:16

标签: jbehave serenity-bdd thucydides

我有一个基本问题。基本上,我正在尝试使用以下代码集读取CSV文件。当我将它们作为Junit测试运行时,将触发以下测试。如何从故事文件(实际上是从步骤定义方法)触发此Junit测试?

@RunWith(ThucydidesRunner.class)
public class SamplePassingScenarioWithTestSpecificData {

    @Managed
    public WebDriver webdriver;

    @ManagedPages(defaultUrl = "http://www.google.com")
    public Pages pages;

    @Steps
    public SampleDataDrivenSteps steps;

    @Steps
    public DifferentDataDrivenSteps different_steps;


    @Test
    public void happy_day_scenario() throws Throwable {
        steps.navigate_to_user_accounts_page();

        withTestDataFrom("test-data/simple-data.csv").run(steps).enter_new_user_details();

        withTestDataFrom("test-data/some_other-data.csv").run(different_steps).enter_other_details();
    }
}

0 个答案:

没有答案