-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
intercepted request query object missing #25088
Comments
Hi @WORMSS , thanks for letting us know about this! I verified the behavior you described (thanks so much for the simple reproduction!) and, after looking into it a bit, the |
The code for this is done in cypress-io/cypress#25135, but has yet to be released. |
@mike-plummer Thanks for the update. Funny how it's just a simple |
@mike-plummer I know I'm coming late to the party :D. I wanted to use the 'query' property already in Cypress 9.7.0 and it didn't work back then as well. Thanks for the fix! So until then I "serialized" it by myself with this function:
URLSearchParams only returns strings so I thought it's better to just create an object with just strings. The Cypress "query" object returns values of type string|number. I tried to follow SERIALIZABLE_REQ_PROPS but I haven't found any method that serializes that property. Then I found createQueryObject here:
And I wonder where that conversion to the type "string|number" happens. If it happens with JSON.stringify on URLSearchParams there shouldn't be any numbers at all? For full context here's my custom command to verify requests off of an interception:
|
Hi @mirobo , issues in the github repo are reserved for bugs and feature requests. We recommend questions relating to how to use Cypress be asked in our community chat. Also try searching our existing GitHub issues, reading through our documentation, or searching Stack Overflow for relevant answers. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
query is blank, though not what it says in the docs or type.
https://docs.cypress.io/api/commands/intercept#Request-object-properties
Desired behavior
Have this filled in so I can assert on it.
Test code to reproduce
Repo with test : https://github.com/WORMSS/cypress-intercept-query-empty
Cypress Version
11.2.0 and 12.0.2
Node version
19.0.1
Operating System
Windows
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: