Forked from paulmwatson/cypress_test_404_spec.js
Created
July 6, 2023 04:05
Revisions
-
paulmwatson created this gist
Jan 14, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ 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