Skip to content

Latest commit

 

History

History

logging-in__xhr-web-forms

logging-in-xhr-web-form

Log into the server using XHR from end-to-end tests

See the login XHR code in login.hbs

Tests

  • Test an AJAX backed username/password form.
  • Test errors submitting invalid data.
  • Stub JSON based XHR requests.
  • Stub application functions.
  • Create a custom cy.login() test command.
  • Bypass needing to use your actual UI.
  • Increase speed of testing with cy.request().

Test files in cypress/e2e folder show:

tip to start the server and run Cypress GUI use script npm run dev

Highly recommended: watch video "Organizing Tests, Logging In, Controlling State"