-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4141c3
commit 1c579ea
Showing
4 changed files
with
90 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
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,24 @@ | ||
import HomePage from "../pages/HomePage"; | ||
import LoginPage from "../pages/LoginPage"; | ||
|
||
const login = new LoginPage(); | ||
|
||
describe('Failing or Succeeding to Login', function () { | ||
|
||
before(() => { | ||
login.visit(); | ||
// login.acceptSelfAssignedCert(); | ||
}); | ||
|
||
it('User should enter username', function () { | ||
login.enterUsername("admin"); | ||
login.getUsernameElement().should('contain.value', 'admin') | ||
}); | ||
|
||
it('User should enter password', function () { | ||
login.enterPassword("adminADMIN!"); | ||
login.getPasswordElement().should('contain.value', 'adminADMIN!'); | ||
}); | ||
|
||
|
||
}); |
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,16 @@ | ||
import LoginPage from "./LoginPage"; | ||
|
||
class HomePage { | ||
constructor() { | ||
} | ||
|
||
visit() { | ||
cy.visit('/'); | ||
} | ||
|
||
goToSign() { | ||
return new LoginPage(); | ||
} | ||
} | ||
|
||
export default HomePage; |
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,49 @@ | ||
class LoginPage { | ||
constructor() { | ||
} | ||
|
||
visit() { | ||
cy.visit('/login'); | ||
} | ||
|
||
getUsernameElement() { | ||
return cy.get(`.inputText .cds--text-input--md`); | ||
} | ||
|
||
getPasswordElement() { | ||
return cy.get(`input#password`); | ||
} | ||
|
||
enterUsername(value) { | ||
const field = this.getUsernameElement(); | ||
field.clear(); | ||
field.type(value); | ||
return this; | ||
} | ||
|
||
enterPassword(value) { | ||
const field = this.getPasswordElement(); | ||
field.clear(); | ||
field.type(value); | ||
return this; | ||
} | ||
|
||
checkInvalidPassword() { | ||
|
||
} | ||
|
||
signIn() { | ||
const button = cy.get(`[type='submit']`); | ||
button.click(); | ||
} | ||
|
||
acceptSelfAssignedCert() { | ||
const detailsOption = cy.get(`#details-button`); | ||
detailsOption.click(); | ||
const link = cy.get(`#proceed-link`); | ||
link.click(); | ||
|
||
} | ||
} | ||
|
||
export default LoginPage; |