Guest User

Untitled

a guest
Oct 22nd, 2017
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. describe('Log In', () => {
  2. it('succesfully performs login action', () => {
  3. // visit 'baseUrl'
  4. cy.visit('/');
  5. // assert if we are in good place - search for a 'smarter world phrase
  6. cy.contains('smarter world');
  7. // search for a div with 'Teachers' caption, and click it
  8. cy.contains('Teachers').click();
  9. // check if url have changed
  10. cy.url().should('include', 'teachers');
  11. // get Login button and click it
  12. cy.contains('Login').click();
  13. // check if url have changed
  14. cy.url().should('includes', '/login');
  15. // submit inputs and click submit button
  16. cy
  17. .get('input')
  18. .first()
  19. .type('test@email.com');
  20. cy.get('input[type=password]').type('correct_password');
  21. cy.get('button[type=submit]').click();
  22. // verify that we were redirected
  23. cy.url().should('includes', '/c/');
  24. });
  25. });
Add Comment
Please, Sign In to add comment