cypress: cy.writeFiles runs into errors
Current behavior
Hello,
while integrating Cypress version 12.15.0 some of our tests failed with PayloadTooLargeError: request entity too large. The problematic test cases write files around 200 - 300 kb. Cypress UI shows the error message cy.writeFile() must only be invoked from the spec or support file
Desired behavior
On Cypress 12.14.0 the same tests ran fine.
Test code to reproduce
https://github.com/JanUrb/cypress-test-writefiles-error
Cypress Version
12.15.0
Node version
v20.3.0
Operating System
macOS 13.3.1
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 21 (10 by maintainers)
Same error, but with cy.readFile() after updating to 12.15.0
cy.readFile() must only be invoked from the spec file or support file.@bimanpathirage
If you are using npm, then simply
For Yarn
This is still not resolved, as we are also getting the same error:
The bespoke code resides in a custom class, which implements the
cy.writeFile()function like so:cy.writeFile('cypress/support/data/paymentOrders/groupOrders.json', data);Is there a workaround for this, or is downgrading to 12.14.0 the only option?