cypress-documentation
                                
                                 cypress-documentation copied to clipboard
                                
                                    cypress-documentation copied to clipboard
                            
                            
                            
                        Websocket Documentation Missing or Hard to Find
Tremendous work on Cypress! I'm a solo dev that always found testing a nuisance, but now it's part of my work flow thanks to you!
Cypress mentions " You can control WebSocket messages from within Cypress, conditionally load 3rd party scripts, or call functions directly on your application." https://docs.cypress.io/guides/overview/key-differences.html#New-kind-of-testing
I'm running Apollo/GraphQL on the front end, and I would like to mock several web socket frames.
But I cannot find any docs or API for web socket hooks.  Websockets are tricky because they need a stateful, persistent server, and it doesn't look like cy.server() provides that, so I'm not sure where to begin.
Any help is appreciated!
In https://docs.cypress.io/faq/questions/general-questions-faq.html#We-use-WebSockets-will-Cypress-work-with-that there's:
We use WebSockets, will Cypress work with that?
Yes.
Shouldn't that be changed to No, or at least an explanation that you can't mock/stub/route it? I'm not sure what the Yes means at all.
/cc @jennifer-shehane
@LawJolla @dwelle I've created small lib to "mock" WebSockets that works with Cypress, maybe someone will find it useful
Example:
- https://github.com/baal-cadar/manual-web-socket-example/blob/master/cypress/integration/mws-without-comments.spec.js
Repository & npm:
- Cypress example: https://github.com/baal-cadar/manual-web-socket-example
- npm page: https://www.npmjs.com/package/manual-web-socket
@baal-cadar looks interesting..
Any updates?
When can we expect websockets to be supported by cypress? That would narrow down the problem of having to many 3rd party dependencies, which cypress was intended to prevent and be a "all in one solution". (Think of selenium ,etc...)