Skip to content

Instantly share code, notes, and snippets.

View Vacilando's full-sized avatar
🌏
Passenger of spaceship Earth

Tomas Fülöpp Vacilando

🌏
Passenger of spaceship Earth
View GitHub Profile
@paulmwatson
paulmwatson / cypress_test_404_spec.js
Created January 14, 2021 08:33
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited