Cucumber Feature file
What is Feature ?
Feature can be defined as standalone unit or functionality of the project
A Feature consist of list of scenarios to be tested for that feature
What is Feature file?
A feature file is file with .feature extension in which we store feature, feature description , scenarios for the feature to be tested .
Each Functionality is stored in separate feature file which is documented in plain descriptive language like English , French
Structure of Feature file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Feature: Multiple blog support Only blog owners can post to a blog , except administrators, who can post to all blogs. Background: Given a global administrator named "Sandeep" And a blog named "BDD Cucumber" And a customer named "Charvi" And a blog named "API Testing" owned by "Charvi" Scenario: Charvi posts to her own blog Given I am logged in as Charvi When I try to post to "API Testing" Then I should see "Your article was published." Scenario: Charvi tries to post to somebody else's blog, and fails Given I am logged in as Charvi When I try to post to "BDD Cucumber" Then I should see "Hey! That's not your blog!“ Scenario: Sandeep posts to a client's blog Given I am logged in as Sandeep When I try to post to "API Testing" Then I should see "Your article was published." |