This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
#7 - behat tests #45
Draft
Anna-Sokolowska
wants to merge
10
commits into
main
Choose a base branch
from
#7-behat-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
#7 - behat tests #45
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a301f3b
#7 - First basic features in Gherkin
Anna-Sokolowska 84aaa0f
#7 - fix misspellings
Anna-Sokolowska b7fdd9b
#7 - add scenarios to the features and refactor CRUDs
Anna-Sokolowska 10cb277
#7 - add changing password feature
Anna-Sokolowska 173c3d4
#7 - add missing quotation marks and correct typos
Anna-Sokolowska dfed831
Update features/authentication/register.feature
Anna-Sokolowska f5563bf
Merge branch 'main' into #7-behat-tests
Anna-Sokolowska 92c1d6c
#7 - add validation scenarios to adding_user_to_admin_panel.feature
Anna-Sokolowska 09f0a48
#7 - change unnecessary outline scenarios
Anna-Sokolowska da6b1ba
#7 - move features
Anna-Sokolowska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Access to the admin panel | ||
|
||
Scenario: Successfully have access to admin panel | ||
Given the administrator is logged in | ||
When the administrator is on the admin panel route | ||
Then the administrator should see the admin panel page | ||
|
||
Scenario: Attempt to get to admin panel as authenticated non-administrator user | ||
Given the user is logged in | ||
But the user is not an administrator | ||
When the user is on the admin panel route | ||
Then the user should see "You are not allowed to access this page" | ||
|
||
Scenario: Attempt to get to admin panel as unauthenticated user | ||
Given the user is logged in | ||
When the user is on the admin panel route | ||
Then the user should be redirected to the login page |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Feature: Adding a user to admin panel | ||
|
||
Background: | ||
Given the administrator is logged in | ||
And the administrator is on the page with invitation form | ||
|
||
Scenario Outline: Successfully send invitation to unregistered user | ||
Given the invited user doesn't have an account | ||
When the administrator fills in "email" with "<email>" | ||
And the administrator sends the form | ||
Then the administrator should see "Successfully send invitation" | ||
And the invited user should get an invitation link on "<email>" | ||
Examples: | ||
| email | | ||
| [email protected] | | ||
mtracz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Scenario Outline: The invited user is already an administrator | ||
Given the user with "<email>" email address is already an administrator | ||
When the administrator fills in "email" with "<email>" | ||
And the administrator sends the form | ||
Then the administrator should see the message "This user is already an administrator" | ||
Examples: | ||
| email | | ||
| [email protected] | | ||
|
||
Scenario Outline: Successfully send invitation to already registered user | ||
Given There is a user with "<email>" email address | ||
And the invited user is not an administrator yet | ||
When the administrator fills in "email" with "<email>" | ||
And the administrator sends the form | ||
Then the administrator should see "Successfully send invitation" | ||
And invited user should get an invitation link on "<email>" | ||
Examples: | ||
| email | | ||
| [email protected] | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Creating a admin user | ||
|
||
Background: | ||
Given there are invited users: | ||
| email | | ||
| [email protected] | | ||
|
||
Scenario: The invited user already have account | ||
Given the invited user is on the authentication route by invitation link | ||
When the invited user logs in as "<email>" | ||
Then the invited user becomes admin user | ||
|
||
Scenario Outline: Successfully created an account | ||
Given the invited user is on the authentication route by invitation link | ||
When the invited user registers with "<email>" email addrress | ||
Then new administrator with email "<email>" should be created | ||
Examples: | ||
| email | | ||
| [email protected] | | ||
|
||
Scenario: The invitation has expired | ||
Given the invitation was send more than 7 days ago | ||
When the invited user is on the authentication route by invitation link | ||
Then the invited user should see message "Your invitation is expired" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Feature: Creating a meetup | ||
|
||
Background: | ||
Given the administrator is logged in | ||
And the administrator is on the create meetup page | ||
|
||
Scenario Outline: Successfully creating a meetup | ||
When the administrator fills in "title" with "<title>" | ||
And the administrator fills in "date" with "<date>" | ||
And the administrator fills in "place" with "<place>" | ||
And the administrator fills in "language" with "<language>" | ||
And the administrator submits the form | ||
Then the meetup with following data should be created: | ||
| title | <title> | | ||
| date | <date> | | ||
| place | <place> | | ||
| language | <language> | | ||
And the administrator should see the message "Meetup succesfully created" | ||
Examples: | ||
| title | date | place | language | | ||
| test meetup | 2023-02-02 10:10:10 | test place | pl | | ||
|
||
Scenario: Attempt to create a meetup without credentials | ||
When the administrator sends the form | ||
Then the administrator should see the message "Title field is required" | ||
And the administrator should see the message "Date field are required" | ||
And the administrator should see the message "Place field are required" | ||
And the administrator should see the message "Language field are required" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Deleting a meetup | ||
|
||
Background: | ||
Given there are following meetups: | ||
| id | title | date | place | language | | ||
| 1 | example meetup | 2023-01-01 10:10:10 | example place | pl | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully deleting a meetup | ||
Given the administrator is on the deleting meetup page with meetup id <id> | ||
Anna-Sokolowska marked this conversation as resolved.
Show resolved
Hide resolved
|
||
When the administrator clicks on the delete meetup button | ||
Then the administrator should see the message "Meetup successfully deleted" | ||
Examples: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need table "examples", if we have only one example? |
||
| id | | ||
| 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Showing a meetup | ||
|
||
Background: | ||
Given there are following meetups | ||
| id | title | date | place | language | | ||
| 1 | example meetup | 2023-01-01 10:10:10 | example place | pl | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully showing a meetup | ||
Given the administrator is on the showing meetup page with meetup id "<id>" | ||
Then the administrator should see "title" with "<title>" | ||
And the administrator should see "date" with "<date>" | ||
And the administrator should see "place" with "<place>" | ||
And the administrator should see "language" with "<language>" | ||
Examples: | ||
| id | title | date | place | language | | ||
| 1 | example meetup | 2023-01-01 10:10:10 | example place | pl | | ||
|
||
Scenario Outline: Attempt to show a meetup which does not exist | ||
When the administrator get to the show meetup page with id equals "<id> | ||
Anna-Sokolowska marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Then the administrator should see the message "Page not found" | ||
Examples: | ||
| id | | ||
| 999 | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Feature: Updating a meetup | ||
|
||
Background: | ||
Given there are following meetups | ||
| id | title | date | place | language | | ||
| 1 | example meetup | 2023-01-01 10:10:10 | example place | pl | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully updating a meetup title | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator fills in "title" with "<title>" | ||
And the administrator sends the form | ||
Then the administrator should see message "Meetup successfully updated" | ||
And the administrator should see "title" matches "<title>" | ||
Examples: | ||
| id | title | | ||
| 1 | updated meetup | | ||
|
||
Scenario Outline: Successfully updating a meetup date | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator fills in "date" with "<date>" | ||
And the administrator sends the form | ||
Then the administrator should see message "Meetup successfully updated" | ||
And the administrator should see "date" matches "<date>" | ||
Examples: | ||
| id | date | | ||
| 1 | 2024-02-02 10:10:10 | | ||
|
||
Scenario Outline: Successfully updating a meetup place | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator fills in "place" with "<place>" | ||
And the administrator sends the form | ||
Then the administrator should see message "Meetup successfully updated" | ||
And the administrator should see "place" matches "<place>" | ||
Examples: | ||
| id | place | | ||
| 1 | updated place | | ||
|
||
Scenario Outline: Successfully updating a meetup language | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator fills in "language" with "<language>" | ||
And the administrator sends the form | ||
Then the administrator should see message "Meetup successfully updated" | ||
And the administrator should see "language" matches "<language>" | ||
Examples: | ||
| id | language | | ||
| 1 | en | | ||
|
||
Scenario Outline: Attempt to update a meetup without credentials | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator sends the form | ||
Then the administrator should see the message "Title field is required" | ||
And the administrator should see the message "Date field are required" | ||
And the administrator should see the message "Place field are required" | ||
And the administrator should see the message "Language field are required" | ||
Examples: | ||
| id | | ||
| 1 | | ||
|
||
Scenario Outline: Attempt to update a meetup which does not exist | ||
When the administrator get to the update meetup page with id equals "<id>" | ||
Then the administrator should see the message "Page not found" | ||
Examples: | ||
| id | | ||
| 999 | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: Creating an organization | ||
|
||
Background: | ||
Given the administrator is logged in | ||
And the administrator is on the create organization page | ||
|
||
Scenario Outline: Successfully creating an organization | ||
When the administrator fills in "name" with "<name>" | ||
And the administrator fills in "description" with "<description>" | ||
And the administrator sends the form | ||
Then the organization with following data should be created: | ||
| name | <name> | | ||
| description | <description> | | ||
|
||
And the administrator should see the message "Organization successfully created" | ||
Examples: | ||
| name | description | | ||
| test organization | new organization | | ||
|
||
Scenario: Attempt to create an organization without credentials | ||
When the administrator sends the form | ||
Then the administrator should see the message "Name field is required" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Deleting an organization | ||
|
||
Background: | ||
Given there are following organizations: | ||
| id | name | description | | ||
| 1 | example organization | existing organization | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully deleting an organization | ||
Given the administrator is on the deleting organization page with organization id <id> | ||
When the administrator clicks on the delete organization button | ||
Then the administrator should see the message "Organization successfully deleted" | ||
Examples: | ||
| id | | ||
| 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: Showing an organization | ||
|
||
Background: | ||
Given there are following organizations: | ||
| id | name | description | | ||
| 1 | example organization | existing organization | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully showing an organization | ||
Given the administrator is on the showing organization page with organization id <id> | ||
Then the administrator should see "name" with "<name>" | ||
And the administrator should see "description" with "<description>" | ||
Examples: | ||
| id | name | description | | ||
| 1 | example organization | existing organization | | ||
|
||
Scenario Outline: Attempt to show an organization which does not exist | ||
When the administrator get to the show organization page with id equals "<id> | ||
Then the administrator should see the message "Page not found" | ||
Examples: | ||
| id | | ||
| 999 | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Feature: Updating an organization | ||
|
||
Background: | ||
Given there are following organizations: | ||
| id | name | description | | ||
| 1 | example organization | existing organization | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully updating an organization name | ||
Given the administrator is on the update meetup page with id equals "<id>" | ||
When the administrator fills in "name" with "<name>" | ||
And the administrator sends the form | ||
Then the administrator should see the message "Organization successfully updated" | ||
And the administrator should see "name" matches "<name>" | ||
Examples: | ||
| id | name | | ||
| 1 | updated organization | | ||
|
||
Scenario Outline: Attempt to update an organization without credentials | ||
Given the administrator is on the update organization page with id equals "<id>" | ||
When the administrator sends the form | ||
Then the administrator should see the message "Name field is required" | ||
Examples: | ||
| id | | ||
| 1 | | ||
|
||
Scenario Outline: Attempt to update an organization which does not exist | ||
When the administrator get to the update organization page with id equals "<id>" | ||
Then the administrator should see the message "Page not found" | ||
Examples: | ||
| id | | ||
| 999 | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Creating a speaker | ||
|
||
Background: | ||
Given the administrator is logged in | ||
And the administrator is on the create speaker page | ||
|
||
Scenario Outline: Successfully creating a speaker | ||
When the administrator fills in "name" with "<name>" | ||
And the administrator fills in "description" with "<description>" | ||
And the administrator submits the form | ||
Then the speaker with following data should be created: | ||
| name | <name> | | ||
| description | <description> | | ||
And the administrator should see the message "Speaker successfully created" | ||
Examples: | ||
| name | description | | ||
| test speaker | new speaker | | ||
|
||
Scenario: Attempt to create a speaker without credentials | ||
When the administrator sends the form | ||
Then the administrator should see the message "name field is required" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Deleting a speaker | ||
|
||
Background: | ||
Given there are following speakers: | ||
| id | name | description | | ||
| 1 | example speaker | existing speaker | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully deleting a speaker | ||
Given the administrator is on the deleting speaker page with meetup id <id> | ||
When the administrator clicks on the delete speaker button | ||
Then the administrator should see the message "Speaker successfully deleted" | ||
Examples: | ||
| id | | ||
| 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: Showing a speaker | ||
|
||
Background: | ||
Given there are following speakers | ||
| id | name | description | | ||
| 1 | example speaker | existing speaker | | ||
And the administrator is logged in | ||
|
||
Scenario Outline: Successfully showing a speaker | ||
Given the administrator is on the showing speaker page with speaker id <id> | ||
Then the administrator should see "name" with "<name>" | ||
And the administrator should see "description" with "<description>" | ||
Examples: | ||
| id | name | description | | ||
| 1 | example speaker | existing speaker | | ||
|
||
Scenario Outline: Attempt to show a speaker which does not exist | ||
When the administrator get to the show speaker page with id equals "<id>" | ||
Then the administrator should see the message "Page not found" | ||
Examples: | ||
| id | | ||
| 999 | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be good to add unhappy paths scenarios (what happen if email will be empty or invalid).