Improved testing

This commit is contained in:
Grzegorz Leoniec 2019-01-08 18:37:28 +01:00
parent c563d7ccc1
commit f982ea2c40
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377
2 changed files with 17 additions and 21 deletions

View File

@ -11,18 +11,11 @@ Feature: About me and and location
And I am on the "settings" page
Scenario: I change my name
And I enter "Hansi" as my name
And I press "Save"
And I can click on my profile picture in the top right corner
Then I can see a "Hansi" as my name
When 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
And I can click on my profile picture in the top right corner
Then I can see a "Hansi" as my name
When I visit the "settings" page
And I enter "Peter Lustig" as my name
And I press "Save"
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 enter "<location>" as my location
@ -31,11 +24,10 @@ Feature: About me and and location
Then I can see a "<location>" as my location
Examples: Location
| location |
| New York |
| Germany |
| Berlin |
| Mecklenburg-Vorpommern |
| location | type |
| Paris | City |
| Mecklenburg-Vorpommern | Region |
| Germany | Country |
Scenario: I write about me
When I enter "Some text about me" to about me

View File

@ -172,15 +172,19 @@ When('I enter {string} to about me', text => {
.clear()
.type(text)
})
When('I enter {string} as my name', text => {
When('save {string} as my new name', name => {
cy.get('input[id=name]')
.clear()
.type(text)
.type(name)
cy.contains('Save').click()
})
Then('I can see {string} as my name', text => {
cy.get('input[id=name]')
.clear()
.type(text)
Then(
'I can see my new name {string} when I click on my profile picture in the top right',
name => {
cy.get('input[id=name]')
.clear()
.type(name)
cy.contains('Save').click()
})
When('I press {string}', label => {
cy.contains(label).click()