给定CucumberJS Console输出,何时,然后在运行时进行测试步骤

时间:2019-01-16 02:11:42

标签: javascript protractor bdd cucumberjs

使用protractor-cucumber-framework

如何修改CucumberJs的控制台输出,该输出将在运行时输出步骤。

功能中的示例场景:

Given that Home Page is Displayed
When I Click Sales Button at Home Page
Then Sales Page is Displayed

运行测试时,应输出ff。在控制台中。

Given that Home Page is Displayed - Passed
When I Click Sales Button at Home Page - Passed
Then Sales Page is Displayed - Passed

1 个答案:

答案 0 :(得分:1)

更改量角器conf.js,以在cucumberOpts中指定格式器,如下所示:

exports.config = {

    cucumberOpts: {
        format: [require.resolve('cucumber-pretty')]
    }}
}