Skip to content

Instantly share code, notes, and snippets.

@abhilashshettigar
Last active December 4, 2018 13:02
Show Gist options
  • Save abhilashshettigar/2b6e8bd25589364ada9c1db996975df8 to your computer and use it in GitHub Desktop.
Save abhilashshettigar/2b6e8bd25589364ada9c1db996975df8 to your computer and use it in GitHub Desktop.
Sample code for Cypress without page object pattern
describe('Sanity E2E Test suite for Login page ', () => {
before('Visit Login page', () => {
cy.visit('/login') //Visiting login page before a test run
})
it('Verify if User can login', () => {
cy.get(':nth-child(1) > .form-control').type('[email protected]')
cy.get(':nth-child(2) > .form-control').type('test@123')
cy.get('.btn-red').should('have.value','Signup')
cy.get('.btn').should('have.value','Login').click()
cy.get(':nth-child(1) > .btn-red').should('have.value','Forgot Password')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment