From b89b42c7c5317816b4ff53afb7667cd8d14e151a Mon Sep 17 00:00:00 2001 From: Aleksey Gerasimov Date: Wed, 8 Apr 2020 15:39:36 +0300 Subject: [PATCH 1/5] Add new scenario, move common steps to background --- src/features/login.feature | 14 ++++++++++---- test/specs/authorization_success.spec.js | 14 -------------- 2 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 test/specs/authorization_success.spec.js diff --git a/src/features/login.feature b/src/features/login.feature index 41573241..ec748640 100644 --- a/src/features/login.feature +++ b/src/features/login.feature @@ -6,15 +6,21 @@ Feature: Login page Background: Given I open the url "https://dash-staging.accumatic.com/sign-in" + When I set "aleksey.gerasimov@akvelon.com" to the inputfield "#dash-form-field-email" + When I set "beepbeep" to the inputfield "#dash-form-field-password" + And I press "Enter" # The @Verbose tag adds a screenshot and additional test metadata. @Verbose - Scenario: Searching for unknown term - When I set "" to the inputfield "#dash-form-field-email" - When I set "" to the inputfield "#dash-form-field-password" - And I press "Enter" + Scenario: Sucessful log-in Then I expect that element ".sign-in-notice" becomes not displayed + @Verbose + Scenario: Sucessful log-out + Then I wait on element "div.user-info a.button" for 5000ms to be displayed + When I click on the button "div.user-info a.button" + Then I expect that element "form.dash-form" becomes displayed + # The @Verbose tag adds a screenshot and additional test metadata. # @Verbose # Scenario Outline: Searching for term "" diff --git a/test/specs/authorization_success.spec.js b/test/specs/authorization_success.spec.js deleted file mode 100644 index 1648377d..00000000 --- a/test/specs/authorization_success.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -import LoginPage from '../pages/login' - -describe('Login page', () => { - it('should allow Authorize', () => { - browser.url('https://dash-staging.accumatic.com') - - LoginPage.open() - LoginPage.username.setValue('foo') - LoginPage.password.setValue('bar') - LoginPage.submit() - - expect(LoginPage.flash.getText()).to.contain('Your username is invalid!') - }) -}) \ No newline at end of file From 74183dcd85926154b984e8bae132e795a8ec6a22 Mon Sep 17 00:00:00 2001 From: Aleksey Gerasimov Date: Thu, 9 Apr 2020 15:04:14 +0300 Subject: [PATCH 2/5] Need to start session wit logout --- src/features/login.feature | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/login.feature b/src/features/login.feature index ec748640..11901b68 100644 --- a/src/features/login.feature +++ b/src/features/login.feature @@ -5,7 +5,9 @@ Feature: Login page Because I want to get access to report processing Background: - Given I open the url "https://dash-staging.accumatic.com/sign-in" + Given I open the url "https://dash-staging.accumatic.com/sign-out" + Then I wait on element "form.dash-form" for 5000ms to be displayed + When I open the url "https://dash-staging.accumatic.com/sign-in" When I set "aleksey.gerasimov@akvelon.com" to the inputfield "#dash-form-field-email" When I set "beepbeep" to the inputfield "#dash-form-field-password" And I press "Enter" From 4ad2e602b6c56e18ab022650139104fceb4bcc4d Mon Sep 17 00:00:00 2001 From: Aleksey Gerasimov Date: Thu, 9 Apr 2020 17:45:50 +0300 Subject: [PATCH 3/5] temporary gor chck ci --- src/features/login.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/login.feature b/src/features/login.feature index 11901b68..9db0ef92 100644 --- a/src/features/login.feature +++ b/src/features/login.feature @@ -13,7 +13,7 @@ Feature: Login page And I press "Enter" # The @Verbose tag adds a screenshot and additional test metadata. - @Verbose + @Verbose, @Pending Scenario: Sucessful log-in Then I expect that element ".sign-in-notice" becomes not displayed From 90bfe2eff73f8a6614c68d5e86e9573023c5917d Mon Sep 17 00:00:00 2001 From: Aleksey Gerasimov Date: Thu, 9 Apr 2020 17:54:02 +0300 Subject: [PATCH 4/5] actual necessary state --- src/features/login.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/login.feature b/src/features/login.feature index 9db0ef92..11901b68 100644 --- a/src/features/login.feature +++ b/src/features/login.feature @@ -13,7 +13,7 @@ Feature: Login page And I press "Enter" # The @Verbose tag adds a screenshot and additional test metadata. - @Verbose, @Pending + @Verbose Scenario: Sucessful log-in Then I expect that element ".sign-in-notice" becomes not displayed From 007d2681a983c2a20a28472339d01d4310ff44f1 Mon Sep 17 00:00:00 2001 From: Aleksey Gerasimov Date: Thu, 9 Apr 2020 18:03:14 +0300 Subject: [PATCH 5/5] playing with order --- src/features/login.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/login.feature b/src/features/login.feature index 11901b68..1c1c80d6 100644 --- a/src/features/login.feature +++ b/src/features/login.feature @@ -8,8 +8,8 @@ Feature: Login page Given I open the url "https://dash-staging.accumatic.com/sign-out" Then I wait on element "form.dash-form" for 5000ms to be displayed When I open the url "https://dash-staging.accumatic.com/sign-in" - When I set "aleksey.gerasimov@akvelon.com" to the inputfield "#dash-form-field-email" When I set "beepbeep" to the inputfield "#dash-form-field-password" + When I set "aleksey.gerasimov@akvelon.com" to the inputfield "#dash-form-field-email" And I press "Enter" # The @Verbose tag adds a screenshot and additional test metadata.