From f982ea2c409737b957f66d4bc2c6aac10fc09e22 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Tue, 8 Jan 2019 18:37:28 +0100 Subject: [PATCH] Improved testing --- .../integration/AboutMeAndLocation.feature | 22 ++++++------------- cypress/integration/common/steps.js | 16 +++++++++----- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/cypress/integration/AboutMeAndLocation.feature b/cypress/integration/AboutMeAndLocation.feature index ab2f2c276..d013823c0 100644 --- a/cypress/integration/AboutMeAndLocation.feature +++ b/cypress/integration/AboutMeAndLocation.feature @@ -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 "" When I enter "" as my location @@ -31,11 +24,10 @@ Feature: About me and and location Then I can see a "" 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 diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 77a864e2c..4e7ac892d 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -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()