how to specify which lettuce scenario to run

纵然是瞬间 提交于 2020-01-03 10:55:28

问题


how to specify which lettuce scenario to run?

in using python lettuce test framework, I ran frequently into this case, one scenario failed and then I want to zoom in to this scenario to fix this scenario

can we specify which lettuce scenario to run in the feature file ?


回答1:


You can use tags for the desired tests. For example:

    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

Then when you run lettuce just use

./manage.py harvest -t wip

It will run only those scenarios that are marked with tag @wip, in my case wip is for Work in Progress

If it is without django and just lettuce then use

lettuce -t wip




回答2:


in the documentation specified by JohnWang we have documentations like this to achieve:

lettuce xxx.feature -s 1,2,3


来源:https://stackoverflow.com/questions/12154822/how-to-specify-which-lettuce-scenario-to-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!