开发者

How to divide feature and scenario in Cucumber?

开发者 https://www.devze.com 2023-01-20 07:50 出处:网络
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.

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

精彩评论

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