Course lesson

Stub an API Request Status Code and Error Message with cy.intercept

Frontend application can react differently to various server responses. One way to test the application behavior is to change response status code. .intercept() command in Cypress has the ability to stub the status code and error message that the server would...

Duration
1 min
Access
Included
Transcript
Retained from source evidence

Frontend application can react differently to various server responses. One way to test the application behavior is to change response status code. .intercept() command in Cypress has the ability to stub the status code and error message that the server would provide on error.