Created
October 30, 2020 02:53
-
-
Save ckenst/4667e1a0f8ada064e976df54d56a9561 to your computer and use it in GitHub Desktop.
Login Examples
This file contains hidden or 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
describe('My Login application', () => { | |
it('Should login with valid credentials', () =>{ | |
cy.visit(`https://the-internet.herokuapp.com/login`); | |
cy.get('#username') | |
.type('tomsmith') | |
cy.get('#password') | |
.type('SuperSecretPassword!') | |
cy.get('button[type="submit"]') | |
.click(); | |
cy.get('#flash') | |
.should('exist') | |
.contains('You logged into a secure area!'); | |
}) | |
}); |
This file contains hidden or 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
describe('My Login application', () => { | |
it('Should login with valid credentials', () =>{ | |
}) | |
}); |
This file contains hidden or 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
describe('My Login application', () => { | |
it('should login with valid credentials', () => { | |
browser.url('https://the-internet.herokuapp.com/login'); | |
$('#username').setValue('tomsmith'); | |
$('#password').setValue('SuperSecretPassword!'); | |
$('button[type="submit"]').click(); | |
expect($('#flash')).toBeExisting(); | |
expect($('#flash')).toHaveTextContaining( | |
'You logged into a secure area!'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment