-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Description
When you set the log option for a cy.intercept command, it is shown as being stubbed, even if not stubbed.
URL of Issue(s)
https://docs.cypress.io/api/commands/intercept#Disabling-logs-for-a-request
Steps to replicate
- Write a test for a page that performs an AJAX callback.
- Include a
cy.interceptfor the AJAX callback and pass on{ log: false | true }as the second argument (or third argument if you use thecy.intercept(method, url, staticResponse)overload). - Write a command that triggers the AJAX callback to fire.
- Run the test with
cypress open - Analyse the command log and console properties (see below for concrete example).
It marks the route as being stubbed, even though the request went to origin (since there was nothing provided to stub the route).
Note this happens also if you explicitly enable logging with { log: true }. Obviously if you suppress logging, you won't have a line in the command log for this, but it is displayed as stubbed in the routes section above the test body.
Browser
Electron 118
Device
- PC
- Mac
- iPhone
- iPad
- Android Phone
- Android Tablet
Additional Information
Eg. just this intercept command produces the following falsehoods:
cy.intercept({ method: "GET", url: "/dashboard-icon" }, { log: true });In routes section of command log it displays "Yes" in the "Stubbed" column:

In the command log (only if { log: true }) it displays a circle instead of a disc, which indicates a stubbed response:

When you click that line in the command log (only if { log: true }), in the console properties display multiple stubbing related false-positives.
