Skip to content

Commit 6ac6fa4

Browse files
committed
Fix auth tests
1 parent cefb098 commit 6ac6fa4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cypress/e2e/auth.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Authentication', () => {
2020
it('should not login with incorrect credentials', () => {
2121
ListPage.navigate();
2222
ListPage.logout();
23-
LoginPage.login('foo', 'bar');
23+
LoginPage.login('foo', 'bar', true);
2424
cy.contains('Authentication failed, please retry');
2525
});
2626
it('should login with correct credentials', () => {

cypress/support/LoginPage.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ export default url => ({
1616
cy.get(this.elements.username);
1717
},
1818

19-
login(username = 'login', password = 'password') {
19+
login(username = 'login', password = 'password', shouldFail = false) {
2020
cy.get(this.elements.username).clear().type(username);
2121
cy.get(this.elements.password).clear().type(password);
2222
cy.get(this.elements.submitButton).click();
23-
cy.get(this.elements.title);
24-
cy.get(this.elements.appLoader);
23+
if (!shouldFail) {
24+
cy.get(this.elements.title);
25+
cy.get(this.elements.appLoader);
26+
}
2527
},
2628
});

0 commit comments

Comments
 (0)