cy.intercept logging option marks route as stubbed when it is not #29324
Labels
stage: needs investigating
Someone from Cypress needs to look at this
stale
no activity on this issue for a long period
type: bug
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
cy.intercept
for 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).cypress open
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
Additional Information
Eg. just this intercept command produces the following falsehoods:
In routes section of command log it displays "Yes" in the "Stubbed" column:
![image](https://private-user-images.githubusercontent.com/599538/313640503-32dac086-5906-4a7b-a491-9450afc68258.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MjcyMTQsIm5iZiI6MTczODgyNjkxNCwicGF0aCI6Ii81OTk1MzgvMzEzNjQwNTAzLTMyZGFjMDg2LTU5MDYtNGE3Yi1hNDkxLTk0NTBhZmM2ODI1OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQwNzI4MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05NDA2MjdhMDEyN2VjNTM0ZWEyMmFjN2M0MjJjNWUwNmRiZDU0OTc5Y2E5NDk0NDFjNDQyMTQ0M2QxOTVmZGY3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.IoV4RUFBJAeoIjpU9yk0cUz_Pg6Ijx0sYPPHw33iVYY)
In the command log (only if
![image](https://private-user-images.githubusercontent.com/599538/313640764-3469c024-a52c-492f-b8c8-6eeacc94dc73.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MjcyMTQsIm5iZiI6MTczODgyNjkxNCwicGF0aCI6Ii81OTk1MzgvMzEzNjQwNzY0LTM0NjljMDI0LWE1MmMtNDkyZi1iOGM4LTZlZWFjYzk0ZGM3My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQwNzI4MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMTkyN2EzNTQzYTJiZTE3OTc0ZDQ5ZjQ5NTQyOWJmZGQ4YWFlMDU5MzczMDE1MGU0NjM3ZmQ3NTNjYzdiZTRjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.gEKyHm-k7G034PM8ZoSXJdcmuifYQaFGJSXGYM1Immw)
{ 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
![image](https://private-user-images.githubusercontent.com/599538/313641730-3a5fc7e9-7839-43f0-9445-a72d7f5a7e80.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MjcyMTQsIm5iZiI6MTczODgyNjkxNCwicGF0aCI6Ii81OTk1MzgvMzEzNjQxNzMwLTNhNWZjN2U5LTc4MzktNDNmMC05NDQ1LWE3MmQ3ZjVhN2U4MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQwNzI4MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYTRhYTJiMDNkMTMwZjNjMmJjNTVhNmVkMDY1YTY4YjUxY2U5ZmY5NWQzZWI3ZTQ4YWFlYTMyODczYTViOGEzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.wvaq2uZ8N-72f9mewhXetfP4gWllixUYfRxxHfrdQBQ)
{ log: true }
), in the console properties display multiple stubbing related false-positives.The text was updated successfully, but these errors were encountered: