cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.69k stars 3.16k forks source link

Implement backend events for stubbing/spying WebSockets #7655

Open flotwig opened 4 years ago

flotwig commented 4 years ago

Build out backend events to support stubbing/spying WebSockets for #199

eventName from to payload description
ws:connect server driver CyIncomingRequest, CyWebSocket fired when a new WS connection is received
ws:connect:continue driver server CyIncomingRequest fired when driver wishes to pass the connection on to destination
ws:disconnect server driver CyWebSocket fired when a WS disconnects
ws:frame:outgoing server driver CyWebSocket, CyWebSocketMessage fired when browser sends a ws frame
ws:frame:outgoing:continue driver server CyWebSocketMessage continue passing frame to upstream
ws:frame:incoming server driver CyWebSocket, CyWebSocketMessage fired when upstream server sends a ws frame
ws:frame:incoming:continue driver server CyWebSocketMessage continue passing frame to browser

Depends on #687

unlikelyzero commented 3 years ago

This would be a game-changer for test automation. I can't wait for this to land! Let me know if you'd like me to test a preview PR!

deepanshuverma commented 3 years ago

any update on this one guys, when can we expect this ?

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

Andarist commented 1 year ago

this feature would be awesome, bump for a stale bot

suppadeliux commented 11 months ago

Would be awesome to support this!

jove4015 commented 10 months ago

Would be so great to have this! We are waiting on data from a websocket to refresh and right now we have to go through hurdles to update hidden dom elements on the page so that we can notify cypress that the data is done loading.... it's beyond kludgy. Having a "cy.intercept" that works with websocket messages would be so helpful.