Created
September 11, 2020 15:39
-
-
Save nadvolod/b3479692492c1b8e9d70ee7868d881ef to your computer and use it in GitHub Desktop.
Sample Cypress tests
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
context('Login page', ()=>{ | |
beforeEach(()=> { | |
cy.visit('https://www.saucedemo.com/') | |
}) | |
it('can open page', () => { | |
cy.title().should('eq', 'Swag Labs') | |
}) | |
it('can login', () => { | |
cy.get('#user-name').type('standard_user') | |
cy.get('#password').type('secret_sauce') | |
cy.get('#login-button').click() | |
cy.get('#inventory_filter_container').should('exist') | |
}) | |
it('can login with chaining', () => { | |
cy.get('#user-name').type('standard_user') | |
.get('#password').type('secret_sauce') | |
.get('#login-button').click() | |
.get('#inventory_filter_container').should('exist') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment