From a301f3b248059fd2d7fbf947d933b388493d80e7 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska Date: Mon, 21 Mar 2022 22:27:59 +0100 Subject: [PATCH 1/9] #7 - First basic features in Gherkin --- .../admin_panel/access_to_admin_panel.feature | 14 +++++ .../adding_user_to_admin_panel.feature | 27 +++++++++ .../admin_panel/creating_new_admin.feature | 29 ++++++++++ features/admin_panel/meetup_crud.feature | 34 +++++++++++ .../admin_panel/organization_crud.feature | 30 ++++++++++ features/admin_panel/speakers_crud.feature | 30 ++++++++++ features/authentication/login.feature | 30 ++++++++++ features/authentication/register.feature | 19 +++++++ features/meetup/meetup_crud.feature | 56 +++++++++++++++++++ 9 files changed, 269 insertions(+) create mode 100644 features/admin_panel/access_to_admin_panel.feature create mode 100644 features/admin_panel/adding_user_to_admin_panel.feature create mode 100644 features/admin_panel/creating_new_admin.feature create mode 100644 features/admin_panel/meetup_crud.feature create mode 100644 features/admin_panel/organization_crud.feature create mode 100644 features/admin_panel/speakers_crud.feature create mode 100644 features/authentication/login.feature create mode 100644 features/authentication/register.feature create mode 100644 features/meetup/meetup_crud.feature diff --git a/features/admin_panel/access_to_admin_panel.feature b/features/admin_panel/access_to_admin_panel.feature new file mode 100644 index 00000000..bebcc08c --- /dev/null +++ b/features/admin_panel/access_to_admin_panel.feature @@ -0,0 +1,14 @@ +Feature: Access to admin panel + In order to managing app + As an admin user + I want to see admin panel + + Scenario: I have access to admin panel + Given I am logged in as an admin user + When I get to admin panel route + Then I should see admin panel page + + Scenario: Unauthorized access + Given I am not logged in as an admin user + When I get to admin panel route + Then I should see "You do not have access" \ No newline at end of file diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/features/admin_panel/adding_user_to_admin_panel.feature new file mode 100644 index 00000000..323794d4 --- /dev/null +++ b/features/admin_panel/adding_user_to_admin_panel.feature @@ -0,0 +1,27 @@ +Feature: + In order to add user to admin panel + As an admin user + I want to send email to user with invitation link + + Background: + Given I logged in as an admin user + And I am on the page with invitation form + + Scenario Outline: Successfully send invitation + Given invited user is not an admin yet + When I fill "email" with + And I send the form + Then I should see "Successfully send invitation" + And invited user should get an invitation link on + Examples: + | email | + | firstuser@example.com | + + Scenario Outline: Invited user already are admin + Given user with already are admin user + When I fill "email" with + And I send the form + Then I should see message "This user already are admin user" + Examples: + | email | + | existingadmin@example.com | \ No newline at end of file diff --git a/features/admin_panel/creating_new_admin.feature b/features/admin_panel/creating_new_admin.feature new file mode 100644 index 00000000..72bca8f3 --- /dev/null +++ b/features/admin_panel/creating_new_admin.feature @@ -0,0 +1,29 @@ +Feature: Creating new admin user + In order to have access to admin panel + As a invited user + I want to be able to creating account with admin privileges + + Background: + Given there are invited users: + | email | + | user@example.com | + + Scenario: Invited user already have account + Given I get to authentication route by invitation link + When I log in as "user@example.com" + Then I become admin user + + Scenario Outline: Successfully created an account + Given I get to authentication route by invitation link + When I fill "email" with + And I fill "password" with > + And I fill "name" with + Then I create new account with email + And I become admin user + Examples: + | email | password | name | + | user@example.com | validpassword | newadmin | + Scenario: Invitation is expired + Given Invitation was send more than 7 days ago + When I get to authentication route by invitation link + Then I should see message "Your invitation is expired" \ No newline at end of file diff --git a/features/admin_panel/meetup_crud.feature b/features/admin_panel/meetup_crud.feature new file mode 100644 index 00000000..7d5ecdcd --- /dev/null +++ b/features/admin_panel/meetup_crud.feature @@ -0,0 +1,34 @@ +Feature: Meetup CRUD operations + In order to managing meetups + As a admin user + I want to be able to use CRUD operations for 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 I am logged in as admin + + Scenario Outline: Creating new meetup + Given I am on the create meetup page with meetup id + When I fill the "title" with + And I fill the "date" with <date> + And I fill the "place" with <place> + And I fill the "language" with <language> + Then New meetup with matching data should be created + And I should see message "Meetup was created" + Examples: + | title | date | place | language | + | test meetup | 2023-02-02 10:10:10 | test place | pl | + + Scenario Outline: Updating meetup + Given I am on the update meetup page + When I change the "title" with <title> + And I change the "date" with <date> + And I change the "place" with <place> + And I change the "language" with <language> + Then I should see updating meetup with matching data + And I should see message "Meetup was updated" + Examples: + | id | title | date | place | language | + | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | \ No newline at end of file diff --git a/features/admin_panel/organization_crud.feature b/features/admin_panel/organization_crud.feature new file mode 100644 index 00000000..4083e626 --- /dev/null +++ b/features/admin_panel/organization_crud.feature @@ -0,0 +1,30 @@ +Feature: Organization CRUD operations + In order to managing organizations + As a admin user + I want to be able to use CRUD operations for organization + + Background: + Given there are following organization + | id | name | description | + | 1 | example organization | existing organization | + And I am logged in as admin + + Scenario Outline: Creating new organization + Given I am on the create organization page + When I fill the "name" with <name> + And I fill the "description" with <description> + Then New organization with matching data should be created + And I should see message "Organization was created" + Examples: + | name | description | + | test organization | new organization | + + Scenario Outline: Updating organization + Given I am on the update organization page with organization id equals <id> + When I change the "name" with <name> + And I change the "description" with <description> + Then I should see updating organization with matching data + And I should see message "Organization was updated" + Examples: + | id | name | description | + | 1 | updated organization | updated organization | \ No newline at end of file diff --git a/features/admin_panel/speakers_crud.feature b/features/admin_panel/speakers_crud.feature new file mode 100644 index 00000000..9ee0c1b8 --- /dev/null +++ b/features/admin_panel/speakers_crud.feature @@ -0,0 +1,30 @@ +Feature: Speaker CRUD operations + In order to managing speakers + As a admin user + I want to be able to use CRUD operations for speakers + + Background: + Given there are following speakers + | id | name | description | + | 1 | example speaker | existing speaker | + And I am logged in as admin + + Scenario Outline: Creating new organization + Given I am on the create speaker page + When I fill the "name" with <name> + And I fill the "description" with <description> + Then New speaker with matching data should be created + And I should see message "Speaker was created" + Examples: + | name | description | + | test speaker | new speaker | + + Scenario Outline: Updating speaker + Given I am on the update speaker page with speaker id equals <id> + When I change the "name" with <name> + And I change the "description" with <description> + Then I should see updating speaker with matching data + And I should see message "Speaker was updated" + Examples: + | id | name | description | + | 1 | updated speaker | updated speaker | \ No newline at end of file diff --git a/features/authentication/login.feature b/features/authentication/login.feature new file mode 100644 index 00000000..e4ffede9 --- /dev/null +++ b/features/authentication/login.feature @@ -0,0 +1,30 @@ +Feature: Logging to app + + Background: + Given there are following users: + | email | password | + | existinguser@example.com | correctpassword | + + Scenario Outline: attempt to log in with correct credentials + When I fill "email" with <email> + And I fill "password" with <password> + Then I have successfully logged in + Examples: + | email | password | + | existinguser@example.com | correctpassword | + + Scenario Outline: attempt to log in with wrong password + When I fill "email" with <email> + And I fill "password" with <password> + Then I should see message "bad credentials" + Examples: + | email | password | + | existinguser@example.com | wrongpassword | + + Scenario Outline: attempt to log in as unregistered user + When I fill "email" with <email> + And I fill "password" with <password> + Then I should see message "bad credentials" + Examples: + | email | password | + | nonexistinguser@example.com | password | \ No newline at end of file diff --git a/features/authentication/register.feature b/features/authentication/register.feature new file mode 100644 index 00000000..a8f636b4 --- /dev/null +++ b/features/authentication/register.feature @@ -0,0 +1,19 @@ +Feature: Register to app + + Scenario Outline: Register with valid data + When I fill "email" with <email> + And I fill "password" with <password> + And I fill "name" with <name> + Then I have successfully sign up + And I should get an email on <email> + Examples: + | email | password | name | + | existinguser@example.com | correctpassword | existinguser | + + Scenario: Register using existing email + Given there are following users + | email | password | + | existinguser@example.com | password | + When I fill "email" with "existinguser@example.com" + And I fill "password" with "password" + Then I should see message "User with this email actually exist" \ No newline at end of file diff --git a/features/meetup/meetup_crud.feature b/features/meetup/meetup_crud.feature new file mode 100644 index 00000000..8d767f4b --- /dev/null +++ b/features/meetup/meetup_crud.feature @@ -0,0 +1,56 @@ +Feature: Meetup CRUD operations + In order to managing meetup + As a meetup organizer without admin privileges + I want to be able to use CRUD operations for meetup + + Background: + Given there are following meetups + | organizer_id | title | date | place | language | + | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + And I am logged in as user with id equals "1" + And I am not an admin user + + Scenario Outline: Creating new meetup + Given I am on the create meetup page + When I fill the "title" with <title> + And I fill the "date" with <date> + And I fill the "place" with <place> + And I fill the "language" with <language> + And I submit form + Then New meetup with matching data should be created + And Organizer id should be 1 + And I should see message "Meetup was created" + Examples: + | title | date | place | language | + | test meetup | 2023-02-02 10:10:10 | test place | pl | + + Scenario Outline: Updating meetup as organizer + Given I get to the update meetup page with organizer id equals <id> + When I change the "title" with <title> + And I change the "date" with <date> + And I change the "place" with <place> + And I change the "language" with <language> + And I submit form + Then I should see updating meetup with matching data + And I should see message "Meetup was updated" + Examples: + | id | organizer_id | title | date | place | language | + | 1 | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | + + Scenario: Updating meetup as not an organizer + When I get to the update meetup page with organizer id equals "2" + Then I should see "You do not have access" + + Scenario Outline: Show meetup + When I am on the show meetup page with <id> + Then I should see meetup details + Examples: + | id | organizer_id | title | date | place | language | + | 1 | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + + Scenario: Deleting meetup as organizer + Given I get to the meetup page with organizer id equals "1" + When I click for delete meetup + Then I should see message "Meetup was deleted" From 84aaa0f57d686b9305a5e09e05fe47943101655e Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Tue, 29 Mar 2022 12:46:37 +0200 Subject: [PATCH 2/9] #7 - fix misspellings --- .../admin_panel/access_to_admin_panel.feature | 2 +- .../adding_user_to_admin_panel.feature | 6 +++--- features/admin_panel/creating_new_admin.feature | 13 +++++++------ features/admin_panel/meetup_crud.feature | 4 ++-- features/admin_panel/organization_crud.feature | 4 ++-- features/admin_panel/speakers_crud.feature | 4 ++-- features/authentication/login.feature | 12 ++++++------ features/authentication/register.feature | 15 ++++++++++----- features/meetup/meetup_crud.feature | 2 +- 9 files changed, 34 insertions(+), 28 deletions(-) diff --git a/features/admin_panel/access_to_admin_panel.feature b/features/admin_panel/access_to_admin_panel.feature index bebcc08c..a10801cc 100644 --- a/features/admin_panel/access_to_admin_panel.feature +++ b/features/admin_panel/access_to_admin_panel.feature @@ -11,4 +11,4 @@ Feature: Access to admin panel Scenario: Unauthorized access Given I am not logged in as an admin user When I get to admin panel route - Then I should see "You do not have access" \ No newline at end of file + Then I should see "You do not have access" diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/features/admin_panel/adding_user_to_admin_panel.feature index 323794d4..bca90a5c 100644 --- a/features/admin_panel/adding_user_to_admin_panel.feature +++ b/features/admin_panel/adding_user_to_admin_panel.feature @@ -17,11 +17,11 @@ Feature: | email | | firstuser@example.com | - Scenario Outline: Invited user already are admin + Scenario Outline: Invited user is already an administrator Given user with <email> already are admin user When I fill "email" with <email> And I send the form - Then I should see message "This user already are admin user" + Then I should see message "This user is already an administrator" Examples: | email | - | existingadmin@example.com | \ No newline at end of file + | existingadmin@example.com | diff --git a/features/admin_panel/creating_new_admin.feature b/features/admin_panel/creating_new_admin.feature index 72bca8f3..7bfaa293 100644 --- a/features/admin_panel/creating_new_admin.feature +++ b/features/admin_panel/creating_new_admin.feature @@ -9,21 +9,22 @@ Feature: Creating new admin user | user@example.com | Scenario: Invited user already have account - Given I get to authentication route by invitation link - When I log in as "user@example.com" + Given Invited user get to authentication route by invitation link + When I log in as <email> Then I become admin user Scenario Outline: Successfully created an account Given I get to authentication route by invitation link When I fill "email" with <email> - And I fill "password" with <password>> + And I fill "password" with <password> And I fill "name" with <name> Then I create new account with email <email> And I become admin user Examples: | email | password | name | | user@example.com | validpassword | newadmin | - Scenario: Invitation is expired - Given Invitation was send more than 7 days ago + + Scenario: Invitation has expired + Given invitation was send more than 7 days ago When I get to authentication route by invitation link - Then I should see message "Your invitation is expired" \ No newline at end of file + Then I should see message "Your invitation is expired" diff --git a/features/admin_panel/meetup_crud.feature b/features/admin_panel/meetup_crud.feature index 7d5ecdcd..000ecc0c 100644 --- a/features/admin_panel/meetup_crud.feature +++ b/features/admin_panel/meetup_crud.feature @@ -15,7 +15,7 @@ Feature: Meetup CRUD operations And I fill the "date" with <date> And I fill the "place" with <place> And I fill the "language" with <language> - Then New meetup with matching data should be created + Then new meetup with matching data should be created And I should see message "Meetup was created" Examples: | title | date | place | language | @@ -31,4 +31,4 @@ Feature: Meetup CRUD operations And I should see message "Meetup was updated" Examples: | id | title | date | place | language | - | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | \ No newline at end of file + | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | diff --git a/features/admin_panel/organization_crud.feature b/features/admin_panel/organization_crud.feature index 4083e626..cca516c9 100644 --- a/features/admin_panel/organization_crud.feature +++ b/features/admin_panel/organization_crud.feature @@ -13,7 +13,7 @@ Feature: Organization CRUD operations Given I am on the create organization page When I fill the "name" with <name> And I fill the "description" with <description> - Then New organization with matching data should be created + Then new organization with matching data should be created And I should see message "Organization was created" Examples: | name | description | @@ -27,4 +27,4 @@ Feature: Organization CRUD operations And I should see message "Organization was updated" Examples: | id | name | description | - | 1 | updated organization | updated organization | \ No newline at end of file + | 1 | updated organization | updated organization | diff --git a/features/admin_panel/speakers_crud.feature b/features/admin_panel/speakers_crud.feature index 9ee0c1b8..41957c7e 100644 --- a/features/admin_panel/speakers_crud.feature +++ b/features/admin_panel/speakers_crud.feature @@ -13,7 +13,7 @@ Feature: Speaker CRUD operations Given I am on the create speaker page When I fill the "name" with <name> And I fill the "description" with <description> - Then New speaker with matching data should be created + Then new speaker with matching data should be created And I should see message "Speaker was created" Examples: | name | description | @@ -27,4 +27,4 @@ Feature: Speaker CRUD operations And I should see message "Speaker was updated" Examples: | id | name | description | - | 1 | updated speaker | updated speaker | \ No newline at end of file + | 1 | updated speaker | updated speaker | diff --git a/features/authentication/login.feature b/features/authentication/login.feature index e4ffede9..c2cacc15 100644 --- a/features/authentication/login.feature +++ b/features/authentication/login.feature @@ -5,15 +5,15 @@ Feature: Logging to app | email | password | | existinguser@example.com | correctpassword | - Scenario Outline: attempt to log in with correct credentials + Scenario Outline: Attempt to log in with correct credentials When I fill "email" with <email> - And I fill "password" with <password> - Then I have successfully logged in + And I "password" with <password> + Then I successfully logged in Examples: | email | password | | existinguser@example.com | correctpassword | - Scenario Outline: attempt to log in with wrong password + Scenario Outline: Attempt to log in with wrong password When I fill "email" with <email> And I fill "password" with <password> Then I should see message "bad credentials" @@ -21,10 +21,10 @@ Feature: Logging to app | email | password | | existinguser@example.com | wrongpassword | - Scenario Outline: attempt to log in as unregistered user + Scenario Outline: Attempt to log in as unregistered user When I fill "email" with <email> And I fill "password" with <password> Then I should see message "bad credentials" Examples: | email | password | - | nonexistinguser@example.com | password | \ No newline at end of file + | nonexistinguser@example.com | password | diff --git a/features/authentication/register.feature b/features/authentication/register.feature index a8f636b4..b9fdc0a5 100644 --- a/features/authentication/register.feature +++ b/features/authentication/register.feature @@ -1,9 +1,13 @@ Feature: Register to app + Background: + Given I am on the register page + Scenario Outline: Register with valid data - When I fill "email" with <email> - And I fill "password" with <password> - And I fill "name" with <name> + When I fill "email" with "<email>" + And I fill "password" with "<password>" + And I fill "name" with "<name>" + And I submit form Then I have successfully sign up And I should get an email on <email> Examples: @@ -11,9 +15,10 @@ Feature: Register to app | existinguser@example.com | correctpassword | existinguser | Scenario: Register using existing email - Given there are following users + Given there are following users: | email | password | | existinguser@example.com | password | When I fill "email" with "existinguser@example.com" And I fill "password" with "password" - Then I should see message "User with this email actually exist" \ No newline at end of file + And I submit form + Then I should see message "User with this email actually exist" diff --git a/features/meetup/meetup_crud.feature b/features/meetup/meetup_crud.feature index 8d767f4b..64ca58ea 100644 --- a/features/meetup/meetup_crud.feature +++ b/features/meetup/meetup_crud.feature @@ -18,7 +18,7 @@ Feature: Meetup CRUD operations And I fill the "place" with <place> And I fill the "language" with <language> And I submit form - Then New meetup with matching data should be created + Then new meetup with matching data should be created And Organizer id should be 1 And I should see message "Meetup was created" Examples: From b7fdd9b4bdb42497cc053e20ac917a08df27c622 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Sat, 2 Apr 2022 03:08:10 +0200 Subject: [PATCH 3/9] #7 - add scenarios to the features and refactor CRUDs --- .../admin_panel/access_to_admin_panel.feature | 27 ++++--- .../adding_user_to_admin_panel.feature | 42 ++++++---- .../admin_panel/creating_new_admin.feature | 34 ++++---- features/admin_panel/meetup/create.feature | 28 +++++++ features/admin_panel/meetup/delete.feature | 15 ++++ features/admin_panel/meetup/show.feature | 24 ++++++ features/admin_panel/meetup/update.feature | 65 ++++++++++++++++ features/admin_panel/meetup_crud.feature | 34 -------- .../admin_panel/organization/create.feature | 22 ++++++ .../admin_panel/organization/delete.feature | 15 ++++ .../admin_panel/organization/show.feature | 22 ++++++ .../admin_panel/organization/update.feature | 32 ++++++++ .../admin_panel/organization_crud.feature | 30 -------- features/admin_panel/speakers/create.feature | 21 +++++ features/admin_panel/speakers/delete.feature | 15 ++++ features/admin_panel/speakers/show.feature | 22 ++++++ features/admin_panel/speakers/update.feature | 32 ++++++++ features/admin_panel/speakers_crud.feature | 30 -------- features/authentication/login.feature | 26 ++++--- features/authentication/register.feature | 77 +++++++++++++++---- features/meetup/create.feature | 35 +++++++++ features/meetup/delete.feature | 24 ++++++ features/meetup/meetup_crud.feature | 56 -------------- features/meetup/show.feature | 30 ++++++++ features/meetup/update.feature | 67 ++++++++++++++++ 25 files changed, 602 insertions(+), 223 deletions(-) create mode 100644 features/admin_panel/meetup/create.feature create mode 100644 features/admin_panel/meetup/delete.feature create mode 100644 features/admin_panel/meetup/show.feature create mode 100644 features/admin_panel/meetup/update.feature delete mode 100644 features/admin_panel/meetup_crud.feature create mode 100644 features/admin_panel/organization/create.feature create mode 100644 features/admin_panel/organization/delete.feature create mode 100644 features/admin_panel/organization/show.feature create mode 100644 features/admin_panel/organization/update.feature delete mode 100644 features/admin_panel/organization_crud.feature create mode 100644 features/admin_panel/speakers/create.feature create mode 100644 features/admin_panel/speakers/delete.feature create mode 100644 features/admin_panel/speakers/show.feature create mode 100644 features/admin_panel/speakers/update.feature delete mode 100644 features/admin_panel/speakers_crud.feature create mode 100644 features/meetup/create.feature create mode 100644 features/meetup/delete.feature delete mode 100644 features/meetup/meetup_crud.feature create mode 100644 features/meetup/show.feature create mode 100644 features/meetup/update.feature diff --git a/features/admin_panel/access_to_admin_panel.feature b/features/admin_panel/access_to_admin_panel.feature index a10801cc..3a3adcf6 100644 --- a/features/admin_panel/access_to_admin_panel.feature +++ b/features/admin_panel/access_to_admin_panel.feature @@ -1,14 +1,17 @@ -Feature: Access to admin panel - In order to managing app - As an admin user - I want to see admin panel +Feature: Access to the admin panel - Scenario: I have access to admin panel - Given I am logged in as an admin user - When I get to admin panel route - Then I should see admin panel page + 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: Unauthorized access - Given I am not logged in as an admin user - When I get to admin panel route - Then I should see "You do not have access" + 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 diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/features/admin_panel/adding_user_to_admin_panel.feature index bca90a5c..697b8d90 100644 --- a/features/admin_panel/adding_user_to_admin_panel.feature +++ b/features/admin_panel/adding_user_to_admin_panel.feature @@ -1,27 +1,35 @@ -Feature: - In order to add user to admin panel - As an admin user - I want to send email to user with invitation link +Feature: Adding a user to admin panel Background: - Given I logged in as an admin user - And I am on the page with invitation form + Given the administrator is logged in + And the administrator is on the page with invitation form - Scenario Outline: Successfully send invitation - Given invited user is not an admin yet - When I fill "email" with <email> - And I send the form - Then I should see "Successfully send invitation" - And invited user should get an invitation link on <email> + 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 | | firstuser@example.com | - Scenario Outline: Invited user is already an administrator - Given user with <email> already are admin user - When I fill "email" with <email> - And I send the form - Then I should see message "This user is already an administrator" + 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 | | existingadmin@example.com | + + 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 | + | firstuser@example.com | diff --git a/features/admin_panel/creating_new_admin.feature b/features/admin_panel/creating_new_admin.feature index 7bfaa293..f7c4ba0f 100644 --- a/features/admin_panel/creating_new_admin.feature +++ b/features/admin_panel/creating_new_admin.feature @@ -1,30 +1,24 @@ -Feature: Creating new admin user - In order to have access to admin panel - As a invited user - I want to be able to creating account with admin privileges +Feature: Creating a admin user Background: Given there are invited users: | email | | user@example.com | - Scenario: Invited user already have account - Given Invited user get to authentication route by invitation link - When I log in as <email> - Then I become admin user + 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 I get to authentication route by invitation link - When I fill "email" with <email> - And I fill "password" with <password> - And I fill "name" with <name> - Then I create new account with email <email> - And I become admin user + 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 | password | name | - | user@example.com | validpassword | newadmin | + | email | + | user@example.com | - Scenario: Invitation has expired - Given invitation was send more than 7 days ago - When I get to authentication route by invitation link - Then I should see message "Your invitation is expired" + 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" diff --git a/features/admin_panel/meetup/create.feature b/features/admin_panel/meetup/create.feature new file mode 100644 index 00000000..0ac089f0 --- /dev/null +++ b/features/admin_panel/meetup/create.feature @@ -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" diff --git a/features/admin_panel/meetup/delete.feature b/features/admin_panel/meetup/delete.feature new file mode 100644 index 00000000..3b1c2f01 --- /dev/null +++ b/features/admin_panel/meetup/delete.feature @@ -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> + When the administrator clicks on the delete meetup button + Then the administrator should see the message "Meetup successfully deleted" + Examples: + | id | + | 1 | diff --git a/features/admin_panel/meetup/show.feature b/features/admin_panel/meetup/show.feature new file mode 100644 index 00000000..2614ae57 --- /dev/null +++ b/features/admin_panel/meetup/show.feature @@ -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> + Then the administrator should see the message "Page not found" + Examples: + | id | + | 999 | diff --git a/features/admin_panel/meetup/update.feature b/features/admin_panel/meetup/update.feature new file mode 100644 index 00000000..03260b4a --- /dev/null +++ b/features/admin_panel/meetup/update.feature @@ -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 | diff --git a/features/admin_panel/meetup_crud.feature b/features/admin_panel/meetup_crud.feature deleted file mode 100644 index 000ecc0c..00000000 --- a/features/admin_panel/meetup_crud.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Meetup CRUD operations - In order to managing meetups - As a admin user - I want to be able to use CRUD operations for 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 I am logged in as admin - - Scenario Outline: Creating new meetup - Given I am on the create meetup page with meetup id <id> - When I fill the "title" with <title> - And I fill the "date" with <date> - And I fill the "place" with <place> - And I fill the "language" with <language> - Then new meetup with matching data should be created - And I should see message "Meetup was created" - Examples: - | title | date | place | language | - | test meetup | 2023-02-02 10:10:10 | test place | pl | - - Scenario Outline: Updating meetup - Given I am on the update meetup page - When I change the "title" with <title> - And I change the "date" with <date> - And I change the "place" with <place> - And I change the "language" with <language> - Then I should see updating meetup with matching data - And I should see message "Meetup was updated" - Examples: - | id | title | date | place | language | - | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | diff --git a/features/admin_panel/organization/create.feature b/features/admin_panel/organization/create.feature new file mode 100644 index 00000000..012b332d --- /dev/null +++ b/features/admin_panel/organization/create.feature @@ -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" diff --git a/features/admin_panel/organization/delete.feature b/features/admin_panel/organization/delete.feature new file mode 100644 index 00000000..02688f3c --- /dev/null +++ b/features/admin_panel/organization/delete.feature @@ -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 | diff --git a/features/admin_panel/organization/show.feature b/features/admin_panel/organization/show.feature new file mode 100644 index 00000000..4c186e9e --- /dev/null +++ b/features/admin_panel/organization/show.feature @@ -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 | diff --git a/features/admin_panel/organization/update.feature b/features/admin_panel/organization/update.feature new file mode 100644 index 00000000..52c834f2 --- /dev/null +++ b/features/admin_panel/organization/update.feature @@ -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 | diff --git a/features/admin_panel/organization_crud.feature b/features/admin_panel/organization_crud.feature deleted file mode 100644 index cca516c9..00000000 --- a/features/admin_panel/organization_crud.feature +++ /dev/null @@ -1,30 +0,0 @@ -Feature: Organization CRUD operations - In order to managing organizations - As a admin user - I want to be able to use CRUD operations for organization - - Background: - Given there are following organization - | id | name | description | - | 1 | example organization | existing organization | - And I am logged in as admin - - Scenario Outline: Creating new organization - Given I am on the create organization page - When I fill the "name" with <name> - And I fill the "description" with <description> - Then new organization with matching data should be created - And I should see message "Organization was created" - Examples: - | name | description | - | test organization | new organization | - - Scenario Outline: Updating organization - Given I am on the update organization page with organization id equals <id> - When I change the "name" with <name> - And I change the "description" with <description> - Then I should see updating organization with matching data - And I should see message "Organization was updated" - Examples: - | id | name | description | - | 1 | updated organization | updated organization | diff --git a/features/admin_panel/speakers/create.feature b/features/admin_panel/speakers/create.feature new file mode 100644 index 00000000..cb57e2a0 --- /dev/null +++ b/features/admin_panel/speakers/create.feature @@ -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" diff --git a/features/admin_panel/speakers/delete.feature b/features/admin_panel/speakers/delete.feature new file mode 100644 index 00000000..4ed3a759 --- /dev/null +++ b/features/admin_panel/speakers/delete.feature @@ -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 | diff --git a/features/admin_panel/speakers/show.feature b/features/admin_panel/speakers/show.feature new file mode 100644 index 00000000..50b77e0a --- /dev/null +++ b/features/admin_panel/speakers/show.feature @@ -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 | diff --git a/features/admin_panel/speakers/update.feature b/features/admin_panel/speakers/update.feature new file mode 100644 index 00000000..08becb87 --- /dev/null +++ b/features/admin_panel/speakers/update.feature @@ -0,0 +1,32 @@ +Feature: Updating 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 updating a speaker name + Given the administrator is on the update speaker 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 speaker | + + Scenario Outline: Attempt to update a speaker without credentials + Given the administrator is on the update speaker 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 a speaker which does not exist + When the administrator get to the update speaker page with id equals "<id>" + Then the administrator should see the message "Page not found" + Examples: + | id | + | 999 | diff --git a/features/admin_panel/speakers_crud.feature b/features/admin_panel/speakers_crud.feature deleted file mode 100644 index 41957c7e..00000000 --- a/features/admin_panel/speakers_crud.feature +++ /dev/null @@ -1,30 +0,0 @@ -Feature: Speaker CRUD operations - In order to managing speakers - As a admin user - I want to be able to use CRUD operations for speakers - - Background: - Given there are following speakers - | id | name | description | - | 1 | example speaker | existing speaker | - And I am logged in as admin - - Scenario Outline: Creating new organization - Given I am on the create speaker page - When I fill the "name" with <name> - And I fill the "description" with <description> - Then new speaker with matching data should be created - And I should see message "Speaker was created" - Examples: - | name | description | - | test speaker | new speaker | - - Scenario Outline: Updating speaker - Given I am on the update speaker page with speaker id equals <id> - When I change the "name" with <name> - And I change the "description" with <description> - Then I should see updating speaker with matching data - And I should see message "Speaker was updated" - Examples: - | id | name | description | - | 1 | updated speaker | updated speaker | diff --git a/features/authentication/login.feature b/features/authentication/login.feature index c2cacc15..31332dcc 100644 --- a/features/authentication/login.feature +++ b/features/authentication/login.feature @@ -1,30 +1,36 @@ -Feature: Logging to app +Feature: User logging Background: Given there are following users: | email | password | | existinguser@example.com | correctpassword | + And the user is on the login page Scenario Outline: Attempt to log in with correct credentials - When I fill "email" with <email> - And I "password" with <password> - Then I successfully logged in + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + Then the user has successfully logged in Examples: | email | password | | existinguser@example.com | correctpassword | Scenario Outline: Attempt to log in with wrong password - When I fill "email" with <email> - And I fill "password" with <password> - Then I should see message "bad credentials" + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + Then the user should see message "bad credentials" Examples: | email | password | | existinguser@example.com | wrongpassword | Scenario Outline: Attempt to log in as unregistered user - When I fill "email" with <email> - And I fill "password" with <password> - Then I should see message "bad credentials" + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + Then the user should see the message "bad credentials" Examples: | email | password | | nonexistinguser@example.com | password | + + Scenario: Attempt to log in without data + When the user submits form + Then the user should see "email field is required" + And the user should see "password field is required" diff --git a/features/authentication/register.feature b/features/authentication/register.feature index b9fdc0a5..9eb2cf77 100644 --- a/features/authentication/register.feature +++ b/features/authentication/register.feature @@ -1,24 +1,73 @@ -Feature: Register to app +Feature: User registration Background: - Given I am on the register page + Given the user is on the register page Scenario Outline: Register with valid data - When I fill "email" with "<email>" - And I fill "password" with "<password>" - And I fill "name" with "<name>" - And I submit form - Then I have successfully sign up - And I should get an email on <email> + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + And the user fills in "confirm password" with "<password>" + And the user fills in "name" with "<name>" + And the user submits form + Then the user has successfully sign up + And the user should get an email on <email> Examples: | email | password | name | - | existinguser@example.com | correctpassword | existinguser | + | testuser@example.com | correctpassword | testuser | - Scenario: Register using existing email + Scenario Outline: Register using an existing email Given there are following users: | email | password | | existinguser@example.com | password | - When I fill "email" with "existinguser@example.com" - And I fill "password" with "password" - And I submit form - Then I should see message "User with this email actually exist" + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + And the user fills in "confirm password" with "<password>" + And the user submits form + Then the user should see the message "User with this email actually exist" + Examples: + | email | password | + | existinguser@example.com | password | + + Scenario Outline: Register using an invalid email + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + And the user fills in "confirm password" with "<password>" + And the user fills in "name" with "<name>" + And the user submits form + Then the user should see "Invalid email" + Examples: + | email | password | name | + | user | correctpassword | testuser | + + Scenario: Register without credentials + When the user submits form + Then the user should see "Email field is required" + And the user should see "Password field is required" + And the user fills in "Confirm password" with "<password>" + And the user should see "Name field is required" + + Scenario: A logged user attempting to get to the register page + Given the user is logged in + Then the user should be redirected to the home page + + Scenario Outline: Attempt to register with mismatching passwords + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + And the user fills in "confirm password" with "<confirmation_password>" + And the user fills in "name" with "<name>" + And the user submits form + Then the user should see "Password and confirmation password do not match" + Examples: + | email | password | confirmation_password | name | + | testuser@example.com | correctpassword | wrongpassword | testuser | + + Scenario Outline: Attempt to register with with too short password + When the user fills in "email" with "<email>" + And the user fills in "password" with "<password>" + And the user fills in "confirm password" with "<password>" + And the user fills in "name" with "<name>" + And the user submits form + Then the user should see "Password is too short" + Examples: + | email | password | name | + | testuser@example.com | 123 | testuser | diff --git a/features/meetup/create.feature b/features/meetup/create.feature new file mode 100644 index 00000000..57f64072 --- /dev/null +++ b/features/meetup/create.feature @@ -0,0 +1,35 @@ +Feature: Creating a meetup + + Background: + Given there are following meetups: + | organizer_id | title | date | place | language | + | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + And the user with id equals "1" is logged in + And the user is not an administrator + + Scenario Outline: Successfully creating a meetup + Given the user is on the create meetup page + When the user fill in the "title" with "<title>" + And the user fill in the "date" with "<date>" + And the user fill in the "place" with "<place>" + And the user fill in the "language" with "<language>" + And the user submit form + Then new meetup with following data should be created: + |organizer_id | 1 | + | title | <title> | + | date | <date> | + | place | <place> | + | language | <language> | + And the user should see the message "Meetup successfully 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 + Given the user is on the create meetup page + When the user submits the form + Then the user should see "Title field is required" + And the user should see "Date field is required" + And the user should see "Place field is required" + And the user should see "Language field is required" diff --git a/features/meetup/delete.feature b/features/meetup/delete.feature new file mode 100644 index 00000000..4f42ec8e --- /dev/null +++ b/features/meetup/delete.feature @@ -0,0 +1,24 @@ +Feature: Deleting a meetup + + Background: + Given there are following meetups: + | organizer_id | title | date | place | language | + | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + And the user with id equals "1" is logged in + And the user is not an administrator + + Scenario Outline: Deleting a meetup as an organizer + Given the user is on the meetup page with organizer id equals "<id>" + When the user clicks on the delete meetup button + Then the user should see message "Meetup successfully deleted" + Examples: + | id | + | 1 | + + Scenario Outline: Attempt to delete a meetup not as an organizer + Given the user is on the meetup page with organizer id equals "<id>" + Then the user should see the message "You are not allowed to access this page" + Examples: + | id | + | 2 | diff --git a/features/meetup/meetup_crud.feature b/features/meetup/meetup_crud.feature deleted file mode 100644 index 64ca58ea..00000000 --- a/features/meetup/meetup_crud.feature +++ /dev/null @@ -1,56 +0,0 @@ -Feature: Meetup CRUD operations - In order to managing meetup - As a meetup organizer without admin privileges - I want to be able to use CRUD operations for meetup - - Background: - Given there are following meetups - | organizer_id | title | date | place | language | - | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | - | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | - And I am logged in as user with id equals "1" - And I am not an admin user - - Scenario Outline: Creating new meetup - Given I am on the create meetup page - When I fill the "title" with <title> - And I fill the "date" with <date> - And I fill the "place" with <place> - And I fill the "language" with <language> - And I submit form - Then new meetup with matching data should be created - And Organizer id should be 1 - And I should see message "Meetup was created" - Examples: - | title | date | place | language | - | test meetup | 2023-02-02 10:10:10 | test place | pl | - - Scenario Outline: Updating meetup as organizer - Given I get to the update meetup page with organizer id equals <id> - When I change the "title" with <title> - And I change the "date" with <date> - And I change the "place" with <place> - And I change the "language" with <language> - And I submit form - Then I should see updating meetup with matching data - And I should see message "Meetup was updated" - Examples: - | id | organizer_id | title | date | place | language | - | 1 | 1 | updated meetup | 2024-02-02 10:10:10 | updated place | en | - - Scenario: Updating meetup as not an organizer - When I get to the update meetup page with organizer id equals "2" - Then I should see "You do not have access" - - Scenario Outline: Show meetup - When I am on the show meetup page with <id> - Then I should see meetup details - Examples: - | id | organizer_id | title | date | place | language | - | 1 | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | - | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | - - Scenario: Deleting meetup as organizer - Given I get to the meetup page with organizer id equals "1" - When I click for delete meetup - Then I should see message "Meetup was deleted" diff --git a/features/meetup/show.feature b/features/meetup/show.feature new file mode 100644 index 00000000..ab823e4e --- /dev/null +++ b/features/meetup/show.feature @@ -0,0 +1,30 @@ +Feature: Showing a meetup + + Background: + Given there are following meetups + | id | organizer_id | title | date | place | language | + | 1 | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + And The user with id equals "1" is logged in + And the user is not an administrator + + Scenario Outline: Successfully showing a meetup + When the user is on the show meetup page with <id> + Then the user should see following meetup details: + | id | <id> | + | organizer_id | <organizer_id> | + | title | <title> | + | date | <date> | + | place | <place> | + | language | <language> | + Examples: + | id | organizer_id | title | date | place | language | + | 1 | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + + Scenario Outline: Attempt to show a meetup which does not exist + When the user in on the show meetup page with id equals "<id> + Then the user should see the message "Page not found" + Examples: + | id | + | 999 | diff --git a/features/meetup/update.feature b/features/meetup/update.feature new file mode 100644 index 00000000..f02caf7a --- /dev/null +++ b/features/meetup/update.feature @@ -0,0 +1,67 @@ +Feature: Updating a meetup + + Background: + Given there are following meetups + | organizer_id | title | date | place | language | + | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | + | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | + And the user with id equals "1" is logged in + And the user is not an administrator + + Scenario Outline: Successfully updating a meetup title as organizer + Given the user is on the update meetup page with id equals "<id>" + When the user fills in "title" with "<title>" + And the user sends the form + Then the user should see message "Meetup successfully updated" + And the user should see "title" matches "<title>" + Examples: + | id | title | + | 1 | updated meetup | + + Scenario Outline: Successfully updating a meetup date as organizer + Given the user is on the update meetup page with id equals "<id>" + When the user fills in "date" with "<date>" + And the user sends the form + Then the user should see message "Meetup successfully updated" + And the user should see "date" matches "<date>" + Examples: + | id | date | + | 1 | 2024-02-02 10:10:10 | + + Scenario Outline: Successfully updating a meetup place as organizer + Given the user is on the update meetup page with id equals "<id>" + When the user fills in "place" with "<place>" + And the user sends the form + Then the user should see message "Meetup successfully updated" + And the user should see "place" matches "<place>" + Examples: + | id | place | + | 1 | updated place | + + Scenario Outline: Successfully updating a meetup language as organizer + Given the user is on the update meetup page with id equals "<id>" + When the user fills in "language" with "<language>" + And the user sends the form + Then the user should see message "Meetup successfully updated" + And the user should see "language" matches "<language>" + Examples: + | id | language | + | 1 | en | + + Scenario Outline: Attempt to update a meetup without credentials + Given the user is on the update meetup page with id equals "<id>" + When the user sends the form + Then the user should see the message "Title field is required" + And the user should see the message "Date field are required" + And the user should see the message "Place field are required" + And the user should see the message "Language field are required" + Examples: + | id | + | 1 | + + Scenario Outline: Updating meetup as not an organizer + When The user is on the update meetup page with organizer id equals "<id>" + Then The user should see "You are not allowed to do this" + Examples: + | id | + | 2 | From 10cb27722e2346bed0bb031d3b37b03ba71a9265 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Sat, 2 Apr 2022 03:09:05 +0200 Subject: [PATCH 4/9] #7 - add changing password feature --- features/user/changing_password.feature | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 features/user/changing_password.feature diff --git a/features/user/changing_password.feature b/features/user/changing_password.feature new file mode 100644 index 00000000..5a923520 --- /dev/null +++ b/features/user/changing_password.feature @@ -0,0 +1,48 @@ +Feature: Changing a password + + Background: + Given there are following users: + | email | password | + | existinguser@example.com | correctpassword | + + Scenario Outline: Successfully changing password + Given the user is logged in as "<email>" + When the user fills in "old password" with "<old_password>" + And the user fills in "new password" with "<new_password>" + And the user fills in "confirm new password" with "<new_password>" + Then the user should see "Password successfully changed" + Examples: + | email | old_password | new_password | + | existinguser@example.com | correctpassword | newpassword | + + Scenario Outline: Attempt to change the password with mismatching passwords + Given the user is logged in as "<email>" + When the user fills in "old password" with "<old_password>" + And the user fills in "new password" with "<new_password>" + And the user fills in "confirm new password" with "<confirmation_password>" + Then the user should see "Password and confirmation password do not match" + Examples: + | email | old_password | new_password | confirmation_password | + | existinguser@example.com | correctpassword | newpassword | wrongpassword | + + Scenario Outline: Attempt to change the password with wrong old password + Given the user is logged in as "<email>" + When the user fills in "old password" with "<old_password>" + And the user fills in "new password" with "<new_password>" + And the user fills in "confirm new password" with "<new_password>" + Then the user should see "Incorrect password" + + Examples: + | email | old_password | new_password | + | existinguser@example.com | wrongpassword | newpassword | + + Scenario Outline: Attempt to change the password with too short new password + Given the user is logged in as "<email>" + When the user fills in "old password" with "<old_password>" + And the user fills in "new password" with "<new_password>" + And the user fills in "confirm new password" with "<new_password>" + Then the user should see "New password is too short" + + Examples: + | email | old_password | new_password | + | existinguser@example.com | correctpassword | 123 | From 173c3d47e103888978811c3bcc55f4b28ccd0134 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Tue, 12 Apr 2022 12:00:35 +0200 Subject: [PATCH 5/9] #7 - add missing quotation marks and correct typos --- features/admin_panel/creating_new_admin.feature | 2 +- features/admin_panel/meetup/create.feature | 2 +- features/admin_panel/meetup/delete.feature | 2 +- features/admin_panel/meetup/show.feature | 4 ++-- features/admin_panel/organization/delete.feature | 2 +- features/admin_panel/organization/show.feature | 4 ++-- features/admin_panel/speakers/delete.feature | 2 +- features/admin_panel/speakers/show.feature | 2 +- features/authentication/register.feature | 2 +- features/meetup/show.feature | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/features/admin_panel/creating_new_admin.feature b/features/admin_panel/creating_new_admin.feature index f7c4ba0f..33dbec22 100644 --- a/features/admin_panel/creating_new_admin.feature +++ b/features/admin_panel/creating_new_admin.feature @@ -12,7 +12,7 @@ Feature: Creating a 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 + When the invited user registers with "<email>" email address Then new administrator with email "<email>" should be created Examples: | email | diff --git a/features/admin_panel/meetup/create.feature b/features/admin_panel/meetup/create.feature index 0ac089f0..683c8630 100644 --- a/features/admin_panel/meetup/create.feature +++ b/features/admin_panel/meetup/create.feature @@ -15,7 +15,7 @@ Feature: Creating a meetup | date | <date> | | place | <place> | | language | <language> | - And the administrator should see the message "Meetup succesfully created" + And the administrator should see the message "Meetup successfully created" Examples: | title | date | place | language | | test meetup | 2023-02-02 10:10:10 | test place | pl | diff --git a/features/admin_panel/meetup/delete.feature b/features/admin_panel/meetup/delete.feature index 3b1c2f01..ae8c8774 100644 --- a/features/admin_panel/meetup/delete.feature +++ b/features/admin_panel/meetup/delete.feature @@ -7,7 +7,7 @@ Feature: Deleting a meetup 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> + Given the administrator is on the deleting meetup page with meetup id equals "<id>" When the administrator clicks on the delete meetup button Then the administrator should see the message "Meetup successfully deleted" Examples: diff --git a/features/admin_panel/meetup/show.feature b/features/admin_panel/meetup/show.feature index 2614ae57..f5f992db 100644 --- a/features/admin_panel/meetup/show.feature +++ b/features/admin_panel/meetup/show.feature @@ -7,7 +7,7 @@ Feature: Showing a meetup 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>" + Given the administrator is on the showing meetup page with meetup id equals "<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>" @@ -17,7 +17,7 @@ Feature: Showing a meetup | 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> + When the administrator get to the show meetup page with id equals "<id>" Then the administrator should see the message "Page not found" Examples: | id | diff --git a/features/admin_panel/organization/delete.feature b/features/admin_panel/organization/delete.feature index 02688f3c..506ef4f0 100644 --- a/features/admin_panel/organization/delete.feature +++ b/features/admin_panel/organization/delete.feature @@ -7,7 +7,7 @@ Feature: Deleting an 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> + 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: diff --git a/features/admin_panel/organization/show.feature b/features/admin_panel/organization/show.feature index 4c186e9e..e8b7fd4f 100644 --- a/features/admin_panel/organization/show.feature +++ b/features/admin_panel/organization/show.feature @@ -7,7 +7,7 @@ Feature: Showing an 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> + Given the administrator is on the showing organization page with organization id equals "<id>" Then the administrator should see "name" with "<name>" And the administrator should see "description" with "<description>" Examples: @@ -15,7 +15,7 @@ Feature: Showing an organization | 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> + 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 | diff --git a/features/admin_panel/speakers/delete.feature b/features/admin_panel/speakers/delete.feature index 4ed3a759..870eba2b 100644 --- a/features/admin_panel/speakers/delete.feature +++ b/features/admin_panel/speakers/delete.feature @@ -7,7 +7,7 @@ Feature: Deleting a 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> + Given the administrator is on the deleting speaker page with meetup id equals "<id>" When the administrator clicks on the delete speaker button Then the administrator should see the message "Speaker successfully deleted" Examples: diff --git a/features/admin_panel/speakers/show.feature b/features/admin_panel/speakers/show.feature index 50b77e0a..056afa2c 100644 --- a/features/admin_panel/speakers/show.feature +++ b/features/admin_panel/speakers/show.feature @@ -7,7 +7,7 @@ Feature: Showing a 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> + Given the administrator is on the showing speaker page with speaker id equals "<id>" Then the administrator should see "name" with "<name>" And the administrator should see "description" with "<description>" Examples: diff --git a/features/authentication/register.feature b/features/authentication/register.feature index 9eb2cf77..8c96b3f5 100644 --- a/features/authentication/register.feature +++ b/features/authentication/register.feature @@ -10,7 +10,7 @@ Feature: User registration And the user fills in "name" with "<name>" And the user submits form Then the user has successfully sign up - And the user should get an email on <email> + And the user should get an email on "<email>" Examples: | email | password | name | | testuser@example.com | correctpassword | testuser | diff --git a/features/meetup/show.feature b/features/meetup/show.feature index ab823e4e..0cc6e838 100644 --- a/features/meetup/show.feature +++ b/features/meetup/show.feature @@ -9,7 +9,7 @@ Feature: Showing a meetup And the user is not an administrator Scenario Outline: Successfully showing a meetup - When the user is on the show meetup page with <id> + When the user is on the show meetup page with id equals "<id>" Then the user should see following meetup details: | id | <id> | | organizer_id | <organizer_id> | @@ -23,7 +23,7 @@ Feature: Showing a meetup | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | Scenario Outline: Attempt to show a meetup which does not exist - When the user in on the show meetup page with id equals "<id> + When the user in on the show meetup page with id equals "<id>" Then the user should see the message "Page not found" Examples: | id | From dfed83121bc7980b363defa5c88dc3c8aa3e3c49 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <67736611+Anna-Sokolowska@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:29:42 +0200 Subject: [PATCH 6/9] Update features/authentication/register.feature Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> --- features/authentication/register.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/authentication/register.feature b/features/authentication/register.feature index 8c96b3f5..3dfd82f2 100644 --- a/features/authentication/register.feature +++ b/features/authentication/register.feature @@ -61,7 +61,7 @@ Feature: User registration | email | password | confirmation_password | name | | testuser@example.com | correctpassword | wrongpassword | testuser | - Scenario Outline: Attempt to register with with too short password + Scenario Outline: Attempt to register with too short password When the user fills in "email" with "<email>" And the user fills in "password" with "<password>" And the user fills in "confirm password" with "<password>" From 92c1d6c018f5f6b4e1cfa117dad06f9ba16df3d2 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Fri, 22 Apr 2022 13:34:26 +0200 Subject: [PATCH 7/9] #7 - add validation scenarios to adding_user_to_admin_panel.feature --- features/admin_panel/adding_user_to_admin_panel.feature | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/features/admin_panel/adding_user_to_admin_panel.feature index 697b8d90..d173b302 100644 --- a/features/admin_panel/adding_user_to_admin_panel.feature +++ b/features/admin_panel/adding_user_to_admin_panel.feature @@ -14,6 +14,15 @@ Feature: Adding a user to admin panel | email | | firstuser@example.com | + Scenario: An administrator fills in invited user email field with invalid email + When the administrator fills in "email" with "wrongemail@" + And the administrator sends the form + Then the administrator should see "Invalid email" + + Scenario: An administrator sends the form with empty invited user email field + When the administrator sends the form + Then the administrator should see "Email field is required" + 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>" From 09f0a4879e4394eb186747322428580ceb384ce5 Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Fri, 22 Apr 2022 14:11:10 +0200 Subject: [PATCH 8/9] #7 - change unnecessary outline scenarios --- .../adding_user_to_admin_panel.feature | 29 +++++++------------ .../admin_panel/creating_new_admin.feature | 11 +++---- features/admin_panel/meetup/delete.feature | 7 ++--- features/admin_panel/meetup/show.feature | 7 ++--- features/admin_panel/meetup/update.feature | 14 +++------ .../admin_panel/organization/delete.feature | 7 ++--- .../admin_panel/organization/show.feature | 7 ++--- .../admin_panel/organization/update.feature | 14 +++------ features/admin_panel/speakers/delete.feature | 7 ++--- features/admin_panel/speakers/show.feature | 7 ++--- features/admin_panel/speakers/update.feature | 14 +++------ features/meetup/delete.feature | 14 +++------ features/meetup/show.feature | 7 ++--- features/meetup/update.feature | 14 +++------ 14 files changed, 48 insertions(+), 111 deletions(-) diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/features/admin_panel/adding_user_to_admin_panel.feature index d173b302..d70b75d6 100644 --- a/features/admin_panel/adding_user_to_admin_panel.feature +++ b/features/admin_panel/adding_user_to_admin_panel.feature @@ -4,15 +4,12 @@ Feature: Adding a user to admin panel Given the administrator is logged in And the administrator is on the page with invitation form - Scenario Outline: Successfully send invitation to unregistered user + Scenario Successfully send invitation to unregistered user Given the invited user doesn't have an account - When the administrator fills in "email" with "<email>" + When the administrator fills in "email" with "firstuser@example.com" 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 | - | firstuser@example.com | + And the invited user should get an invitation link on "firstuser@example.com" Scenario: An administrator fills in invited user email field with invalid email When the administrator fills in "email" with "wrongemail@" @@ -23,22 +20,16 @@ Feature: Adding a user to admin panel When the administrator sends the form Then the administrator should see "Email field is required" - 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>" + Scenario: The invited user is already an administrator + Given the user with "existingadmin@example.com" email address is already an administrator + When the administrator fills in "email" with "existingadmin@example.com" And the administrator sends the form Then the administrator should see the message "This user is already an administrator" - Examples: - | email | - | existingadmin@example.com | - Scenario Outline: Successfully send invitation to already registered user - Given There is a user with "<email>" email address + Scenario: Successfully send invitation to already registered user + Given There is a user with "firstuser@example.com" email address And the invited user is not an administrator yet - When the administrator fills in "email" with "<email>" + When the administrator fills in "email" with "firstuser@example.com" 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 | - | firstuser@example.com | + And invited user should get an invitation link on "firstuser@example.com" diff --git a/features/admin_panel/creating_new_admin.feature b/features/admin_panel/creating_new_admin.feature index 33dbec22..0e4ca18e 100644 --- a/features/admin_panel/creating_new_admin.feature +++ b/features/admin_panel/creating_new_admin.feature @@ -7,16 +7,13 @@ Feature: Creating a admin user 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>" + When the invited user logs in as "user@example.com " Then the invited user becomes admin user - Scenario Outline: Successfully created an account + Scenario: Successfully created an account Given the invited user is on the authentication route by invitation link - When the invited user registers with "<email>" email address - Then new administrator with email "<email>" should be created - Examples: - | email | - | user@example.com | + When the invited user registers with "user@example.com " email address + Then new administrator with email "user@example.com " should be created Scenario: The invitation has expired Given the invitation was send more than 7 days ago diff --git a/features/admin_panel/meetup/delete.feature b/features/admin_panel/meetup/delete.feature index ae8c8774..98b7986d 100644 --- a/features/admin_panel/meetup/delete.feature +++ b/features/admin_panel/meetup/delete.feature @@ -6,10 +6,7 @@ Feature: Deleting a meetup | 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 equals "<id>" + Scenario: Successfully deleting a meetup + Given the administrator is on the deleting meetup page with meetup id equals "1" When the administrator clicks on the delete meetup button Then the administrator should see the message "Meetup successfully deleted" - Examples: - | id | - | 1 | diff --git a/features/admin_panel/meetup/show.feature b/features/admin_panel/meetup/show.feature index f5f992db..4c016ea2 100644 --- a/features/admin_panel/meetup/show.feature +++ b/features/admin_panel/meetup/show.feature @@ -16,9 +16,6 @@ Feature: Showing a meetup | 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>" + Scenario: Attempt to show a meetup which does not exist + When the administrator get to the show meetup page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/admin_panel/meetup/update.feature b/features/admin_panel/meetup/update.feature index 03260b4a..387c9055 100644 --- a/features/admin_panel/meetup/update.feature +++ b/features/admin_panel/meetup/update.feature @@ -46,20 +46,14 @@ Feature: Updating a meetup | 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>" + Scenario: Attempt to update a meetup without credentials + Given the administrator is on the update meetup page with id equals "1" 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>" + Scenario: Attempt to update a meetup which does not exist + When the administrator get to the update meetup page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/admin_panel/organization/delete.feature b/features/admin_panel/organization/delete.feature index 506ef4f0..dc62281f 100644 --- a/features/admin_panel/organization/delete.feature +++ b/features/admin_panel/organization/delete.feature @@ -6,10 +6,7 @@ Feature: Deleting an organization | 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>" + Scenario: Successfully deleting an organization + Given the administrator is on the deleting organization page with organization id "1" When the administrator clicks on the delete organization button Then the administrator should see the message "Organization successfully deleted" - Examples: - | id | - | 1 | diff --git a/features/admin_panel/organization/show.feature b/features/admin_panel/organization/show.feature index e8b7fd4f..ede26764 100644 --- a/features/admin_panel/organization/show.feature +++ b/features/admin_panel/organization/show.feature @@ -14,9 +14,6 @@ Feature: Showing an organization | 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>" + Scenario: Attempt to show an organization which does not exist + When the administrator get to the show organization page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/admin_panel/organization/update.feature b/features/admin_panel/organization/update.feature index 52c834f2..76d95a9e 100644 --- a/features/admin_panel/organization/update.feature +++ b/features/admin_panel/organization/update.feature @@ -16,17 +16,11 @@ Feature: Updating an organization | 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>" + Scenario: Attempt to update an organization without credentials + Given the administrator is on the update organization page with id equals "1" 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>" + Scenario: Attempt to update an organization which does not exist + When the administrator get to the update organization page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/admin_panel/speakers/delete.feature b/features/admin_panel/speakers/delete.feature index 870eba2b..795b88a0 100644 --- a/features/admin_panel/speakers/delete.feature +++ b/features/admin_panel/speakers/delete.feature @@ -6,10 +6,7 @@ Feature: Deleting a speaker | 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 equals "<id>" + Scenario: Successfully deleting a speaker + Given the administrator is on the deleting speaker page with meetup id equals "1" When the administrator clicks on the delete speaker button Then the administrator should see the message "Speaker successfully deleted" - Examples: - | id | - | 1 | diff --git a/features/admin_panel/speakers/show.feature b/features/admin_panel/speakers/show.feature index 056afa2c..fe7735e8 100644 --- a/features/admin_panel/speakers/show.feature +++ b/features/admin_panel/speakers/show.feature @@ -14,9 +14,6 @@ Feature: Showing a speaker | 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>" + Scenario: Attempt to show a speaker which does not exist + When the administrator get to the show speaker page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/admin_panel/speakers/update.feature b/features/admin_panel/speakers/update.feature index 08becb87..cfc7f2b3 100644 --- a/features/admin_panel/speakers/update.feature +++ b/features/admin_panel/speakers/update.feature @@ -16,17 +16,11 @@ Feature: Updating a speaker | id | name | | 1 | updated speaker | - Scenario Outline: Attempt to update a speaker without credentials - Given the administrator is on the update speaker page with id equals "<id>" + Scenario: Attempt to update a speaker without credentials + Given the administrator is on the update speaker page with id equals "1" 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 a speaker which does not exist - When the administrator get to the update speaker page with id equals "<id>" + Scenario: Attempt to update a speaker which does not exist + When the administrator get to the update speaker page with id equals "999" Then the administrator should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/meetup/delete.feature b/features/meetup/delete.feature index 4f42ec8e..42bb0035 100644 --- a/features/meetup/delete.feature +++ b/features/meetup/delete.feature @@ -8,17 +8,11 @@ Feature: Deleting a meetup And the user with id equals "1" is logged in And the user is not an administrator - Scenario Outline: Deleting a meetup as an organizer - Given the user is on the meetup page with organizer id equals "<id>" + Scenario: Deleting a meetup as an organizer + Given the user is on the meetup page with organizer id equals "1" When the user clicks on the delete meetup button Then the user should see message "Meetup successfully deleted" - Examples: - | id | - | 1 | - Scenario Outline: Attempt to delete a meetup not as an organizer - Given the user is on the meetup page with organizer id equals "<id>" + Scenario: Attempt to delete a meetup not as an organizer + Given the user is on the meetup page with organizer id equals "2" Then the user should see the message "You are not allowed to access this page" - Examples: - | id | - | 2 | diff --git a/features/meetup/show.feature b/features/meetup/show.feature index 0cc6e838..31efcd50 100644 --- a/features/meetup/show.feature +++ b/features/meetup/show.feature @@ -22,9 +22,6 @@ Feature: Showing a meetup | 1 | 1 | my meetup | 2023-01-01 10:10:10 | place | pl | | 2 | 2 | foreign meetup | 2023-01-01 10:10:10 | place | pl | - Scenario Outline: Attempt to show a meetup which does not exist - When the user in on the show meetup page with id equals "<id>" + Scenario: Attempt to show a meetup which does not exist + When the user in on the show meetup page with id equals "999" Then the user should see the message "Page not found" - Examples: - | id | - | 999 | diff --git a/features/meetup/update.feature b/features/meetup/update.feature index f02caf7a..9580bdcf 100644 --- a/features/meetup/update.feature +++ b/features/meetup/update.feature @@ -48,20 +48,14 @@ Feature: Updating a meetup | id | language | | 1 | en | - Scenario Outline: Attempt to update a meetup without credentials - Given the user is on the update meetup page with id equals "<id>" + Scenario: Attempt to update a meetup without credentials + Given the user is on the update meetup page with id equals "1" When the user sends the form Then the user should see the message "Title field is required" And the user should see the message "Date field are required" And the user should see the message "Place field are required" And the user should see the message "Language field are required" - Examples: - | id | - | 1 | - Scenario Outline: Updating meetup as not an organizer - When The user is on the update meetup page with organizer id equals "<id>" + Scenario: Updating meetup as not an organizer + When The user is on the update meetup page with organizer id equals "2" Then The user should see "You are not allowed to do this" - Examples: - | id | - | 2 | From da6b1ba12f9bbf606169408bb837d8fc7327e3cf Mon Sep 17 00:00:00 2001 From: Anna-Sokolowska <anna.sokolowska343@gmail.com> Date: Fri, 22 Apr 2022 14:15:30 +0200 Subject: [PATCH 9/9] #7 - move features --- .../features}/admin_panel/access_to_admin_panel.feature | 0 .../features}/admin_panel/adding_user_to_admin_panel.feature | 0 .../features}/admin_panel/creating_new_admin.feature | 0 {features => tests/features}/admin_panel/meetup/create.feature | 0 {features => tests/features}/admin_panel/meetup/delete.feature | 0 {features => tests/features}/admin_panel/meetup/show.feature | 0 {features => tests/features}/admin_panel/meetup/update.feature | 0 .../features}/admin_panel/organization/create.feature | 0 .../features}/admin_panel/organization/delete.feature | 0 .../features}/admin_panel/organization/show.feature | 0 .../features}/admin_panel/organization/update.feature | 0 {features => tests/features}/admin_panel/speakers/create.feature | 0 {features => tests/features}/admin_panel/speakers/delete.feature | 0 {features => tests/features}/admin_panel/speakers/show.feature | 0 {features => tests/features}/admin_panel/speakers/update.feature | 0 {features => tests/features}/authentication/login.feature | 0 {features => tests/features}/authentication/register.feature | 0 {features => tests/features}/meetup/create.feature | 0 {features => tests/features}/meetup/delete.feature | 0 {features => tests/features}/meetup/show.feature | 0 {features => tests/features}/meetup/update.feature | 0 {features => tests/features}/user/changing_password.feature | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {features => tests/features}/admin_panel/access_to_admin_panel.feature (100%) rename {features => tests/features}/admin_panel/adding_user_to_admin_panel.feature (100%) rename {features => tests/features}/admin_panel/creating_new_admin.feature (100%) rename {features => tests/features}/admin_panel/meetup/create.feature (100%) rename {features => tests/features}/admin_panel/meetup/delete.feature (100%) rename {features => tests/features}/admin_panel/meetup/show.feature (100%) rename {features => tests/features}/admin_panel/meetup/update.feature (100%) rename {features => tests/features}/admin_panel/organization/create.feature (100%) rename {features => tests/features}/admin_panel/organization/delete.feature (100%) rename {features => tests/features}/admin_panel/organization/show.feature (100%) rename {features => tests/features}/admin_panel/organization/update.feature (100%) rename {features => tests/features}/admin_panel/speakers/create.feature (100%) rename {features => tests/features}/admin_panel/speakers/delete.feature (100%) rename {features => tests/features}/admin_panel/speakers/show.feature (100%) rename {features => tests/features}/admin_panel/speakers/update.feature (100%) rename {features => tests/features}/authentication/login.feature (100%) rename {features => tests/features}/authentication/register.feature (100%) rename {features => tests/features}/meetup/create.feature (100%) rename {features => tests/features}/meetup/delete.feature (100%) rename {features => tests/features}/meetup/show.feature (100%) rename {features => tests/features}/meetup/update.feature (100%) rename {features => tests/features}/user/changing_password.feature (100%) diff --git a/features/admin_panel/access_to_admin_panel.feature b/tests/features/admin_panel/access_to_admin_panel.feature similarity index 100% rename from features/admin_panel/access_to_admin_panel.feature rename to tests/features/admin_panel/access_to_admin_panel.feature diff --git a/features/admin_panel/adding_user_to_admin_panel.feature b/tests/features/admin_panel/adding_user_to_admin_panel.feature similarity index 100% rename from features/admin_panel/adding_user_to_admin_panel.feature rename to tests/features/admin_panel/adding_user_to_admin_panel.feature diff --git a/features/admin_panel/creating_new_admin.feature b/tests/features/admin_panel/creating_new_admin.feature similarity index 100% rename from features/admin_panel/creating_new_admin.feature rename to tests/features/admin_panel/creating_new_admin.feature diff --git a/features/admin_panel/meetup/create.feature b/tests/features/admin_panel/meetup/create.feature similarity index 100% rename from features/admin_panel/meetup/create.feature rename to tests/features/admin_panel/meetup/create.feature diff --git a/features/admin_panel/meetup/delete.feature b/tests/features/admin_panel/meetup/delete.feature similarity index 100% rename from features/admin_panel/meetup/delete.feature rename to tests/features/admin_panel/meetup/delete.feature diff --git a/features/admin_panel/meetup/show.feature b/tests/features/admin_panel/meetup/show.feature similarity index 100% rename from features/admin_panel/meetup/show.feature rename to tests/features/admin_panel/meetup/show.feature diff --git a/features/admin_panel/meetup/update.feature b/tests/features/admin_panel/meetup/update.feature similarity index 100% rename from features/admin_panel/meetup/update.feature rename to tests/features/admin_panel/meetup/update.feature diff --git a/features/admin_panel/organization/create.feature b/tests/features/admin_panel/organization/create.feature similarity index 100% rename from features/admin_panel/organization/create.feature rename to tests/features/admin_panel/organization/create.feature diff --git a/features/admin_panel/organization/delete.feature b/tests/features/admin_panel/organization/delete.feature similarity index 100% rename from features/admin_panel/organization/delete.feature rename to tests/features/admin_panel/organization/delete.feature diff --git a/features/admin_panel/organization/show.feature b/tests/features/admin_panel/organization/show.feature similarity index 100% rename from features/admin_panel/organization/show.feature rename to tests/features/admin_panel/organization/show.feature diff --git a/features/admin_panel/organization/update.feature b/tests/features/admin_panel/organization/update.feature similarity index 100% rename from features/admin_panel/organization/update.feature rename to tests/features/admin_panel/organization/update.feature diff --git a/features/admin_panel/speakers/create.feature b/tests/features/admin_panel/speakers/create.feature similarity index 100% rename from features/admin_panel/speakers/create.feature rename to tests/features/admin_panel/speakers/create.feature diff --git a/features/admin_panel/speakers/delete.feature b/tests/features/admin_panel/speakers/delete.feature similarity index 100% rename from features/admin_panel/speakers/delete.feature rename to tests/features/admin_panel/speakers/delete.feature diff --git a/features/admin_panel/speakers/show.feature b/tests/features/admin_panel/speakers/show.feature similarity index 100% rename from features/admin_panel/speakers/show.feature rename to tests/features/admin_panel/speakers/show.feature diff --git a/features/admin_panel/speakers/update.feature b/tests/features/admin_panel/speakers/update.feature similarity index 100% rename from features/admin_panel/speakers/update.feature rename to tests/features/admin_panel/speakers/update.feature diff --git a/features/authentication/login.feature b/tests/features/authentication/login.feature similarity index 100% rename from features/authentication/login.feature rename to tests/features/authentication/login.feature diff --git a/features/authentication/register.feature b/tests/features/authentication/register.feature similarity index 100% rename from features/authentication/register.feature rename to tests/features/authentication/register.feature diff --git a/features/meetup/create.feature b/tests/features/meetup/create.feature similarity index 100% rename from features/meetup/create.feature rename to tests/features/meetup/create.feature diff --git a/features/meetup/delete.feature b/tests/features/meetup/delete.feature similarity index 100% rename from features/meetup/delete.feature rename to tests/features/meetup/delete.feature diff --git a/features/meetup/show.feature b/tests/features/meetup/show.feature similarity index 100% rename from features/meetup/show.feature rename to tests/features/meetup/show.feature diff --git a/features/meetup/update.feature b/tests/features/meetup/update.feature similarity index 100% rename from features/meetup/update.feature rename to tests/features/meetup/update.feature diff --git a/features/user/changing_password.feature b/tests/features/user/changing_password.feature similarity index 100% rename from features/user/changing_password.feature rename to tests/features/user/changing_password.feature