【问题标题】:how to specify which lettuce scenario to run如何指定要运行的生菜场景
【发布时间】:2012-08-28 07:42:40
【问题描述】:

如何指定运行哪个生菜场景?

在使用python lettuce测试框架时,经常遇到这种情况,一个场景失败,然后想放大这个场景来修复这个场景

我们可以指定在功能文件中运行哪个生菜场景吗?

【问题讨论】:

  • 在这里提问前应该先搜索一下:lettuce.it/reference/…
  • @JohnWang 你知道如何在 lettuce 测试用例的表列中插入 SPACE 吗?这也让我困惑了一段时间。虽然我也应该仔细阅读文档。

标签: python testing lettuce


【解决方案1】:

您可以使用标签进行所需的测试。例如:

    Scenario: Set off time in free time slot
        Given I click first free time slot
        And I choose menu item "Off"
        And I enter time that is in free interval
        When I click button "Ok"
        Then I see offtime time slot with title that matches with saved interval

    @wip
    Scenario: Set free time on off time
        Given I click last off time slot
        And I choose menu item "Set working"
        And I enter time that is in last off interval
        When I click button "Ok"
        Then I see freetime time slot with title that matches with saved interval

然后当你运行生菜时,只需使用

./manage.py 收获 -t wip

它只会运行那些标有标签 @wip 的场景,在我的例子中 wip 是用于正在进行的工作

如果没有 django 而只是生菜,那么使用

生菜-t wip

【讨论】:

【解决方案2】:

在 JohnWang 指定的documentation 中,我们有这样的文档来实现:

lettuce xxx.feature -s 1,2,3

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-01
    • 1970-01-01
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多