开发者

How to divide feature and scenario in Cucumber?

I need to manage some uses in system, so user management 开发者_运维问答is a feature , and add/delete user is a Scenario? I want to know one principle to design them, thanks


Yes, you are correct.

# user-mgmt.feature
Feature: User management

    Scenario: User addition
        Given that no user named 'doe' exists
        When I create an account for 'doe'
        Then the list of users will include a record for 'doe'

    Scenario: Deletion of non-existing user
        Given that no user named 'doe' exists
        When I remove the account 'doe'
        Then I get an error message

Have also a look at how to create more concise features and the git examples.

My advice is to just create a feature file and run cucumber. It will tell you what to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜