Created
August 24, 2016 08:34
-
-
Save tejovanthn/69b357cefecae7ae6cc63432b6945ba4 to your computer and use it in GitHub Desktop.
Behave feature tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: API User | |
Background: User setups | |
Given a user with name "userA" | |
And a user with name "userB" | |
Scenario Outline: A user and an admin tries to access /user routes | |
Given <name> has role <role> | |
When <method> of "/users" is accessed by userA | |
Then status <code> is returned | |
Examples: /users route | |
| name | role | method | code | | |
| userA | user | GET | 403 | | |
| userA | user | POST | 200 | | |
| userA | user | PUT | 405 | | |
| userA | user | DELETE | 405 | | |
| userA | admin | GET | 200 | | |
| userA | admin | POST | 200 | | |
| userA | admin | PUT | 405 | | |
| userA | admin | DELETE | 405 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Basic User | |
Scenario: Create a user | |
Given a user with email "[email protected]" | |
Then user has email "[email protected]" | |
Scenario: Edit a user | |
Given a user with email "[email protected]" | |
When user edits email to "[email protected]" | |
Then user has email "[email protected]" | |
Scenario: Delete a user | |
Given a user with email "[email protected]" | |
When user is deleted | |
Then there is no user with email "[email protected]" | |
Scenario: Archive a user | |
Given a user with email "[email protected]" | |
When user is archived | |
Then there is no user with email "[email protected]" | |
But there is a user with email "[email protected]" if archive is True | |
Scenario: Find a user | |
Given 5 users | |
And a user with email "[email protected]" | |
When user with email "[email protected]" is searched for | |
Then user with email "[email protected]" is returned | |
Scenario: No user | |
Given 5 users | |
When user with email "[email protected]" is searched for | |
Then there is no user with email "[email protected]" | |
Scenario: Get a user | |
Given a user with email "[email protected]" | |
When user is accessed by id | |
Then user.email is "[email protected]" | |
Scenario: Two users with the same name | |
Given user with email "[email protected]" and name "Test User" | |
And user with email "[email protected]" and name "Test User" | |
Then user 1 has username "test-user" | |
And user 2 has username "test-user-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: testing google | |
Scenario: visit google and check | |
When we visit google | |
Then it should have a title "Google" | |
Scenario: visit google and check | |
When we visit google | |
Then it should have a title "Eventosaur" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment