Last active
December 4, 2018 13:07
-
-
Save abhilashshettigar/2204ed15a2ed195a2e756a67f4868491 to your computer and use it in GitHub Desktop.
Sample code for Cypress with Page object pattern
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
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