Cypressで404ページに遷移することを確認したいケースがある
ただCypressdeではデフォルで404ページに遷移するケースはテストが失敗で終わるので、これを失敗にしないようにしたい
failOnStatusCodeを使う
結論 Cypress.request() のfailOnStatusCode
オプションを使う
Option | Default | Description |
---|---|---|
failOnStatusCode | true | Whether to fail on response codes other than 2xx and 3xx |