diff --git a/cypress/integration/User.ChangePassword.feature b/cypress/integration/UserProfile.ChangePassword.feature similarity index 98% rename from cypress/integration/User.ChangePassword.feature rename to cypress/integration/UserProfile.ChangePassword.feature index 582d56149..a7eec1cce 100644 --- a/cypress/integration/User.ChangePassword.feature +++ b/cypress/integration/UserProfile.ChangePassword.feature @@ -1,4 +1,4 @@ -Feature: User change password +Feature: User profile - change password As a user I want to change my password in my settings For security, e.g. if I exposed my password by accident diff --git a/cypress/integration/User.ChangePassword/I_can_login_successfully.js b/cypress/integration/UserProfile.ChangePassword/I_can_login_successfully.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_can_login_successfully.js rename to cypress/integration/UserProfile.ChangePassword/I_can_login_successfully.js diff --git a/cypress/integration/User.ChangePassword/I_cannot_login_anymore.js b/cypress/integration/UserProfile.ChangePassword/I_cannot_login_anymore.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_cannot_login_anymore.js rename to cypress/integration/UserProfile.ChangePassword/I_cannot_login_anymore.js diff --git a/cypress/integration/User.ChangePassword/I_cannot_submit_the_form.js b/cypress/integration/UserProfile.ChangePassword/I_cannot_submit_the_form.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_cannot_submit_the_form.js rename to cypress/integration/UserProfile.ChangePassword/I_cannot_submit_the_form.js diff --git a/cypress/integration/User.ChangePassword/I_fill_the_password_form_with.js b/cypress/integration/UserProfile.ChangePassword/I_fill_the_password_form_with.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_fill_the_password_form_with.js rename to cypress/integration/UserProfile.ChangePassword/I_fill_the_password_form_with.js diff --git a/cypress/integration/User.ChangePassword/I_see_a_{string}_message.js b/cypress/integration/UserProfile.ChangePassword/I_see_a_{string}_message.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_see_a_{string}_message.js rename to cypress/integration/UserProfile.ChangePassword/I_see_a_{string}_message.js diff --git a/cypress/integration/User.ChangePassword/I_submit_the_form copy.js b/cypress/integration/UserProfile.ChangePassword/I_submit_the_form copy.js similarity index 100% rename from cypress/integration/User.ChangePassword/I_submit_the_form copy.js rename to cypress/integration/UserProfile.ChangePassword/I_submit_the_form copy.js diff --git a/cypress/integration/UserProfile.NameDescriptionLocation.feature b/cypress/integration/UserProfile.NameDescriptionLocation.feature new file mode 100644 index 000000000..891d98748 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation.feature @@ -0,0 +1,38 @@ +Feature: User profile - name, description and location + As a user + I would like to change my name, add a description and a location + So others can see my name, get some info about me and my location + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + And I am logged in as "peter-pan" + And I navigate to page "settings" + + Scenario: Change username + When I save "Hansi" as my new name + Then I can see my new name "Hansi" when I click on my profile picture in the top right + When I refresh the page + Then I can see my new name "Hansi" when I click on my profile picture in the top right + + Scenario Outline: I set my location to "" + When I save "" as my location + And I navigate to page "/profile/peter-pan" + Then they can see "" in the info box below my avatar + Examples: Location + | location | type | + | Paris | City | + | Saxony-Anhalt | Region | + | Germany | Country | + + Scenario: Display a description on profile page + Given I have the following self-description: + """ + Ich lebe fettlos, fleischlos, fischlos dahin, fühle mich aber ganz wohl dabei + """ + When I navigate to page "/profile/peter-pan" + Then they can see the following text in the info box below my avatar: + """ + Ich lebe fettlos, fleischlos, fischlos dahin, fühle mich aber ganz wohl dabei + """ diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js b/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js new file mode 100644 index 000000000..b9e97a304 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/I_can_see_my_new_name_{string}_when_I_click_on_my_profile_picture_in_the_top_right.js @@ -0,0 +1,7 @@ +import { Then } from "cypress-cucumber-preprocessor/steps"; + +Then('I can see my new name {string} when I click on my profile picture in the top right', name => { + cy.get('.avatar-menu').click() // open + cy.get('.avatar-menu-popover').contains(name) + cy.get('.avatar-menu').click() // close again +}) \ No newline at end of file diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/I_have_the_following_self-description.js b/cypress/integration/UserProfile.NameDescriptionLocation/I_have_the_following_self-description.js new file mode 100644 index 000000000..a1bc1c524 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/I_have_the_following_self-description.js @@ -0,0 +1,12 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When('I have the following self-description:', text => { + cy.get('textarea[id=about]') + .clear() + .type(text) + cy.get('[type=submit]') + .click() + .not('[disabled]') + cy.get('.iziToast-message') + .should('contain', 'Your data was successfully updated') + }) \ No newline at end of file diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_location.js b/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_location.js new file mode 100644 index 000000000..de5143b9f --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_location.js @@ -0,0 +1,13 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When('I save {string} as my location', location => { + cy.get('input[id=city]').type(location) + cy.get('.ds-select-option') + .contains(location) + .click() + cy.get('[type=submit]') + .click() + .not('[disabled]') + cy.get('.iziToast-message') + .should('contain', 'Your data was successfully updated') + }) \ No newline at end of file diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_new_name.js b/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_new_name.js new file mode 100644 index 000000000..22e26cbc5 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/I_save_{string}_as_my_new_name.js @@ -0,0 +1,12 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When('I save {string} as my new name', name => { + cy.get('input[id=name]') + .clear() + .type(name) + cy.get('[type=submit]') + .click() + .not('[disabled]') + cy.get('.iziToast-message') + .should('contain', 'Your data was successfully updated') +}) \ No newline at end of file diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_the_following_text_in_the_info_box_below_my_avatar.js b/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_the_following_text_in_the_info_box_below_my_avatar.js new file mode 100644 index 000000000..6d375a406 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_the_following_text_in_the_info_box_below_my_avatar.js @@ -0,0 +1,5 @@ +import { When } from "cypress-cucumber-preprocessor/steps"; + +When('they can see the following text in the info box below my avatar:', text => { + cy.contains(text) +}) \ No newline at end of file diff --git a/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_{string}_in_the_info_box_below_my_avatar.js b/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_{string}_in_the_info_box_below_my_avatar.js new file mode 100644 index 000000000..ea328f441 --- /dev/null +++ b/cypress/integration/UserProfile.NameDescriptionLocation/they_can_see_{string}_in_the_info_box_below_my_avatar.js @@ -0,0 +1,5 @@ +import { Then } from "cypress-cucumber-preprocessor/steps"; + +Then('they can see {string} in the info box below my avatar', location => { + cy.contains(location) +}) \ No newline at end of file diff --git a/cypress/integration/common/.settings.js b/cypress/integration/common/.settings.js index 3dcff141d..568cc49a0 100644 --- a/cypress/integration/common/.settings.js +++ b/cypress/integration/common/.settings.js @@ -2,73 +2,6 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' /* global cy */ -let aboutMeText -let myLocation - -const matchNameInUserMenu = name => { - cy.get('.avatar-menu').click() // open - cy.get('.avatar-menu-popover').contains(name) - cy.get('.avatar-menu').click() // close again -} - -When('I save {string} as my new name', name => { - cy.get('input[id=name]') - .clear() - .type(name) - cy.get('[type=submit]') - .click() - .not('[disabled]') - cy.get('.iziToast-message') - .should('contain', 'Your data was successfully updated') -}) - -When('I save {string} as my location', location => { - cy.get('input[id=city]').type(location) - cy.get('.ds-select-option') - .contains(location) - .click() - cy.get('[type=submit]') - .click() - .not('[disabled]') - cy.get('.iziToast-message') - .should('contain', 'Your data was successfully updated') - myLocation = location -}) - -When('I have the following self-description:', text => { - cy.get('textarea[id=bio]') - .clear() - .type(text) - cy.get('[type=submit]') - .click() - .not('[disabled]') - cy.get('.iziToast-message') - .should('contain', 'Your data was successfully updated') - aboutMeText = text -}) - -When('people visit my profile page', url => { - cy.openPage('/profile/peter-pan') -}) - - -When('they can see the text in the info box below my avatar', () => { - cy.contains(aboutMeText) -}) - -Then('they can see the location in the info box below my avatar', () => { - cy.contains(myLocation) -}) - -Then('the name {string} is still there', name => { - matchNameInUserMenu(name) -}) - -Then( - 'I can see my new name {string} when I click on my profile picture in the top right', - name => matchNameInUserMenu(name) -) - When('I click on the {string} link', link => { cy.get('a') .contains(link) diff --git a/cypress/integration/user_profile/.AboutMeAndLocation.feature b/cypress/integration/user_profile/.AboutMeAndLocation.feature deleted file mode 100644 index 2a512bf3f..000000000 --- a/cypress/integration/user_profile/.AboutMeAndLocation.feature +++ /dev/null @@ -1,37 +0,0 @@ -Feature: About me and location - As a user - I would like to add some about me text and a location - So others can get some info about me and my location - - The location and about me are displayed on the user profile. Later it will be possible - to search for users by location. - - Background: - Given I have a user account - And I am logged in - And I am on the "settings" page - - Scenario: Change username - When I save "Hansi" as my new name - Then I can see my new name "Hansi" when I click on my profile picture in the top right - And when I refresh the page - Then the name "Hansi" is still there - - Scenario Outline: I set my location to "" - When I save "" as my location - When people visit my profile page - Then they can see the location in the info box below my avatar - - Examples: Location - | location | type | - | Paris | City | - | Saxony-Anhalt | Region | - | Germany | Country | - - Scenario: Display a description on profile page - Given I have the following self-description: - """ - Ich lebe fettlos, fleischlos, fischlos dahin, fühle mich aber ganz wohl dabei - """ - When people visit my profile page - Then they can see the text in the info box below my avatar