Cypress · Senior · Question 28 of 76
Why are WebSocket features harder to test in Cypress?
- 1Cypress closes all WebSocket connections on load
- 2WebSockets work only in component tests
- 3
cy.interceptdoesn't stub WebSocket traffic
Show the answer
Correct answer: cy.intercept doesn't stub WebSocket traffic
Explanation
Teams stub the socket client in the app, use a test server, or test the real connection with assertions on the UI.