-
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
cy.intercept() breaks multipart form submissions #14527
Comments
I am not sure I understand the steps to reproduce it. The references image problem should be broken in 6.2.0 and fixed in 6.2.1. You report the opposite. Can you add screenshots or better yet create a reproducible example? We have a recipe that shows checking a multipart form here: https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/stubbing-spying__intercept see "form-spec.js" file. Maybe you can use it as the starting point? |
This might be related as well #14535 |
Yeah, I'm reporting the exact opposite than that other ticket. I even took the reproducing example from there to do the testing and I see the complete opposite: working in 6.2.0 and broken in 6.2.1. I cloned the example from that ticket and added some Dockerfiles in order to try to isolate this as much as possible. https://github.com/javitonino/cypress-intercept-buffer-bug This is what I see: git clone https://github.com/javitonino/cypress-intercept-buffer-bug.git
cd cypress-intercept-buffer-bug
docker build . -f Dockerfile6.2.0 -t cypress-intercept-6.2.0
docker build . -f Dockerfile6.2.1 -t cypress-intercept-6.2.1 docker run cypress-intercept-6.2.0
[...]
✔ All specs passed! 00:03 3 3 - - - docker run cypress-intercept-6.2.1
[...]
✖ 1 of 1 failed (100%) 00:10 3 1 2 - - |
Is this issue localized to Docker? I'm trying to recreate the issue from the repo you provided, but I see the provided tests always failing in Cypress 6.2.0, 6.2.1, and 6.3.0. |
No, it's not. I just used Docker to try to isolate as many factors as possible but I can reproduce without it. In my case, by running the repo outside docker I see the same behaviour (works in 6.2.0, breaks in 6.2.1). I just tested 6.3.0 and it breaks (same as 6.2.1) for me. Are you running the built in upload server ( |
So, I debugged a bit what is happening here, and the problem seems to be the following:
This only happens when you It did not happen in 6.2.0 because the body was always converted to string before sending it to the driver and, since strings are not objects, the driver did not run |
Also had this problem upgrading from cypress 4.x. It certainly made upgrading to 6.5 a lot more difficult than expected. I wrote a small command that makes it easy to work with multipart requests and make assertions on the body, IMO it should have been handled by Cypress, but until then I'm using: https://www.npmjs.com/package/cypress-intercept-formdata |
We also impacted by this issue. Anyone find any workaround ? |
We are also impacted by this issue, to the point of having to revert back to an older Version of Cypress. We have to intercept every single request in order to add an Therefore this makes Cypress 6.2.1+ unusable. |
This appears to not be an issue in the newest release of Cypress (the repro no longer fails). Please open a new issue if you are encountering issues with multipart and |
Current behavior
Since upgrading to Cypress 6.2.1, multipart form submissions no longer work when they are
intercept()
ed. This seems to be a regression introduced by #9359Desired behavior
I can intercept multipart uploads, as I was able to do in Cypress 6.0.0 - 6.2.0
Test code to reproduce
As a minimal reproducing program, I used https://github.com/AlexCSR/cypress-intercept-buffer-bug (from the #9359 ticket). In my system, that tests works fine in 6.2.0, but breaks in 6.2.1. It seems to be the opposite of what people on that ticket where experiencing.
If I inspect network traffic using that test in 6.2.1:
{}
(no multipart boundaries included)Versions
Broken in Cypress 6.2.1, works in Cypress 6.0.0 - 6.2.0
Tested with Node 15.4.0, 10.20.1 and 12.18.2 running on Linux (Arch Linux & Ubuntu)
Chromium 87 (although that seems irrelevant, I can reproduce by sending HTTP requests to the Cypress proxy using curl)
Maybe @AlexCSR can comment on what versions they use? Since I'm using their code to reproduce and get the opposite results.
The text was updated successfully, but these errors were encountered: