We have a service which verifies user before it can access data. I need to know if the request is coming from Cypress. I understand I can look into user-agent or I can also set request header but I am trying to find any other way that normal user can't do from browser. Is there anything else Cypress sends with request that we can use?
Asked
Active
Viewed 372 times
1 Answers
1
All Cypress commands are executed in the browser. Like you mentioned you can set a custom request-header to identify Cypress requests. However these can in theory alway be set outside Cypress via Postman or an http interceptor.
Best option is to set the custom request header with a secret which gets validated in the application itself.

tlolkema
- 260
- 1
- 8