separate wait for when we’re expecting login not to succeed

This commit is contained in:
Adina Parpalita
2017-11-13 12:44:42 +02:00
parent 4040e80db7
commit a46f4f063f
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -150,7 +150,7 @@ describe('Login', () => {
it('shows error when entering nonexistent user', () => {
loginPage
.loginWith('nonexistent-user', 'any-password')
.tryLoginWith('nonexistent-user', 'any-password')
.then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
expect(errorMessage.isDisplayed()).toBe(true);
@@ -161,7 +161,7 @@ describe('Login', () => {
const { username } = johnDoe;
loginPage
.loginWith(username, 'incorrect-password')
.tryLoginWith(username, 'incorrect-password')
.then(() => {
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
expect(errorMessage.isDisplayed()).toBe(true);