如何指定运行哪种生菜方案

zin*_*ing 6 python testing lettuce

如何指定运行哪种生菜方案?

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

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

Aza*_*aev 13

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

    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
Run Code Online (Sandbox Code Playgroud)

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

./manage.py收获-t wip

它将运行只有那些标有标签的场景@wip,在我的情况WIP是在工作中奋进

如果它没有django而只是生菜然后使用

生菜-t wip


zin*_*ing 4

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

lettuce xxx.feature -s 1,2,3
Run Code Online (Sandbox Code Playgroud)