There seems to be an issue with the Cypress test runner where it is removing X-CSRFToken
from the request header, leading to a 403 Forbidden
error. I have compared the headers between a manual run and a Cypress test run, and you can see the difference in the screenshots below:
Screenshot taken during navigation in Chrome browser: https://i.stack.imgur.com/VPk9D.png
Screenshot taken during Cypress test run: https://i.stack.imgur.com/HT27A.png
To verify this issue, I tried replaying the request using curl
and including the X-CSRFToken
, which resolved the problem. How can I address this issue when running tests with Cypress?
NOTE: This problem arises specifically when performing drag and drop events using the trigger()
function.