Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.intercept logging option marks route as stubbed when it is not #29324

Closed
1 of 6 tasks
verheyenkoen opened this issue Mar 18, 2024 · 2 comments
Closed
1 of 6 tasks

cy.intercept logging option marks route as stubbed when it is not #29324

verheyenkoen opened this issue Mar 18, 2024 · 2 comments
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period type: bug

Comments

@verheyenkoen
Copy link
Contributor

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

  1. Write a test for a page that performs an AJAX callback.
  2. Include a cy.intercept for the AJAX callback and pass on { log: false | true } as the second argument (or third argument if you use the cy.intercept(method, url, staticResponse) overload).
  3. Write a command that triggers the AJAX callback to fire.
  4. Run the test with cypress open
  5. 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:
image

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

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

@jennifer-shehane jennifer-shehane transferred this issue from cypress-io/cypress-documentation Apr 12, 2024
@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Apr 16, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Oct 14, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period type: bug
Projects
None yet
Development

No branches or pull requests

3 participants