UserProfile.ChangePassword.feature rename

UserProfile.NameDescriptionLocation.feature
This commit is contained in:
Ulf Gebhardt 2021-04-11 21:40:35 +02:00
parent 4ef7fe518b
commit 7a06c0c5ed
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
16 changed files with 93 additions and 105 deletions

View File

@ -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

View File

@ -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 "<location>"
When I save "<location>" as my location
And I navigate to page "/profile/peter-pan"
Then they can see "<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 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
"""

View File

@ -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
})

View File

@ -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')
})

View File

@ -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')
})

View File

@ -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')
})

View File

@ -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)
})

View File

@ -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)
})

View File

@ -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)

View File

@ -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 "<location>"
When I save "<location>" 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