如何将结果附加到一个html文件

时间:2013-11-27 15:38:26

标签: behat

情景:

1)我运行php bin / behat features / 1.feature> result.html 2)然后我运行php bin / behat features / 2.feature> result.html 3)我应该在results.html中看到1.feature和2.feature的结果

我怎样才能完成这项工作?是否可以选择追加?

也许php bin / behat features / 1.feature --append> results.html?

1 个答案:

答案 0 :(得分:0)

您可以在behat.yml中使用配置文件,并指出每个配置文件要运行的功能。 因此,不是多次运行behat,而是为每个.feature运行一次,只需运行一次并获取一个html文件而不是几个。

示例:以下配置包含2个配置文件,一个用于登录方案,另一个用于预订方案。 它还过滤掉标记为@wip的场景。 它在命令行('漂亮')和html文件('html')中输出数据:

#behat.yml

default:
    filters:
        tags: "~@wip"

    formatter:
        name: pretty,html
        parameters:
            output_path: null,behat_report.html

login:
    paths:
        features: features/login
        bootstrap: %behat.paths.features%/bootstrap

booking:
    paths:
        features: features/booking
        bootstrap: %behat.paths.features%/bootstrap

然后,您可以运行所需的配置文件:

behat --profile login

将运行features / login /目录中的所有.feature文件

相关问题