Skip to content

Instantly share code, notes, and snippets.

@abhilashshettigar
Last active December 4, 2018 13:07
Show Gist options
  • Save abhilashshettigar/2204ed15a2ed195a2e756a67f4868491 to your computer and use it in GitHub Desktop.
Save abhilashshettigar/2204ed15a2ed195a2e756a67f4868491 to your computer and use it in GitHub Desktop.
Sample code for Cypress with Page object pattern
import {
Login
} from '../../support/login-po.js';
var login = new Login();
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', () => {
login.getUsername().should('have.attr', 'placeholder', 'Email/Username').type('[email protected]')
login.getPassword().should('have.attr', 'placeholder', 'Password').type('test@123')
login.getSignupBtn().should('have.value', 'Signup')
login.getLoginBtn().should('have.value','Login').should('not.be.disabled').click()
login.getForgotPasswordBtn().should('have.value','Forgot Password')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment