-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add E2E test that checks if login form is visible * Add tests for login where user enters input See DIH-155
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
Feature: Login | ||
I want to be able to see the form | ||
And I want generic feedback when credentials are missing | ||
And I want generic feedback when credentials are wrong | ||
And I want to be able to login with correct credentials | ||
|
||
Scenario: Open login page | ||
Given I open the page "login" | ||
Then I expect that element "email" is visible | ||
Then I expect that element "password" is visible | ||
|
||
Scenario: Unsuccessful login with blank input | ||
Given I open the page "login" | ||
When I press the button "submit" | ||
Then I expect that "messages" contains "The combination of username and password is invalid" | ||
|
||
Scenario: Unsuccessful login with invalid credentials | ||
Given I open the page "login" | ||
When I set "E-mail" to the inputfield "[email protected]" | ||
And I set "Password" to the inputfield "wrongpassword" | ||
And I press the button "submit" | ||
Then I expect that "messages" contains "The combination of username and password is invalid" | ||
|
||
Scenario: Login succeeds with valid credentials | ||
Given I open the page "login" | ||
When I set "E-mail" to the inputfield "[email protected]" | ||
And I set "Password" to the inputfield "password" | ||
And I press the button "submit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import page from './page'; | ||
|
||
module.exports = Object.create(page, { | ||
|
||
email: { | ||
get() { | ||
return browser.element('#email'); | ||
} | ||
}, | ||
|
||
password: { | ||
get() { | ||
return browser.element('#password'); | ||
} | ||
}, | ||
|
||
submit: { | ||
value() { | ||
return browser.click('button#submit'); | ||
} | ||
}, | ||
|
||
messages: { | ||
get() { | ||
return browser.element('li#message'); | ||
} | ||
}, | ||
|
||
open: { | ||
value() { | ||
page.open.call(this, '/login'); | ||
} | ||
} | ||
}); |