-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix(network-shim): handle 304s from different scenarios in the same feature #261
fix(network-shim): handle 304s from different scenarios in the same feature #261
Conversation
e119fb1
to
33ef97b
Compare
@HendrikThePendric won't the chosen second option be hit-or-miss whether tests pass or fail though? |
Could you explain why? You might be right though... I still don't really see why, but I'm trying my fix in the approval app now and am still seeing tests fail. |
@amcgee I think you're completely right about this. In the approval app my original problem (empty response body) is gone, but now I have a new problem, which is that it's returning the wrong response. I've put this PR back into draft mode and will have to make some more fundamental changes to the networkShim:
|
@amcgee I've implemented things as I summarised in #261 (comment). This solution makes a lot more sense, thanks for realising the flaw in the original fix in #261 (comment). |
I've tried this fix in the approval-app and it resolved the issue there. |
I also considered adding an additional test to verify that this solution is backwards compatible. However setting this up would be quite involved. Instead I have manually tested this in the approval-app:
Both stub runs produced exactly the same results. So the solution is backwards compatible. |
## [8.0.2](v8.0.1...v8.0.2) (2021-08-23) ### Bug Fixes * **network-shim:** handle 304s from different scenarios in the same feature ([#261](#261)) ([0242c1e](0242c1e))
🎉 This PR is included in version 8.0.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Stub mode was failing for me in the approval-app. In essence, the problem was that we uniquely identify requests per scenario (within a feature), but the browser doesn't get refreshed between scenarios (it does between features). So the browser was classifying requests as duplicates (304) while we were detecting them as unique....
There would have been two possible ways to tackle this issue:
This PR contains a lot of changes to generated files. When reviewing only these are relevant:
examples/platform-app/cypress/integration/not_modified.feature
examples/platform-app/cypress/integration/common/index.js
examples/platform-app/cypress/integration/listing/index.js
packages/cypress-commands/src/setups/enableNetworkShim/stubRequests.js
packages/cypress-commands/src/setups/enableNetworkShim/utils.js