Cypress · Senior · Question 48 of 76
How can Cypress tests verify analytics events without real tracking?
- 1Check the analytics dashboard the next day
- 2Analytics can't be tested in end-to-end tests
- 3Intercept tracking calls and assert their payloads
Show the answer
Correct answer: Intercept tracking calls and assert their payloads
Explanation
Stubbing tracking endpoints keeps data clean and checks the right events and properties fire.