Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Log In', () => {
- it('succesfully performs login action', () => {
- // visit 'baseUrl'
- cy.visit('/');
- // assert if we are in good place - search for a 'smarter world phrase
- cy.contains('smarter world');
- // search for a div with 'Teachers' caption, and click it
- cy.contains('Teachers').click();
- // check if url have changed
- cy.url().should('include', 'teachers');
- // get Login button and click it
- cy.contains('Login').click();
- // check if url have changed
- cy.url().should('includes', '/login');
- // submit inputs and click submit button
- cy
- .get('input')
- .first()
- .type('test@email.com');
- cy.get('input[type=password]').type('correct_password');
- cy.get('button[type=submit]').click();
- // verify that we were redirected
- cy.url().should('includes', '/c/');
- });
- });
Add Comment
Please, Sign In to add comment