question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Websocket Documentation Missing or Hard to Find

See original GitHub issue

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!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:26
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

39reactions
dwellecommented, Feb 19, 2019

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

3reactions
Drecucommented, Aug 4, 2020

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…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing WebSocket servers - Web APIs | MDN
A WebSocket server is nothing more than an application listening on any port of a TCP server that follows a specific protocol.
Read more >
Creating AsyncAPI for WebSocket API - Step by Step
Learn how to create a complex AsyncAPI document using WebSocket API ... You can just add missing information to the description of a...
Read more >
Chrome Websockets CORS policy - Stack Overflow
I have a hard time believing that the issue with Chrome isn't something with CORS. I have it working by first sending an...
Read more >
WebSockets and Node.js - testing WS and SockJS by building ...
First, require the WS library and use the WebSocket.Server method to create a new WebSocket server on port 7071 (no significance, any port...
Read more >
Authentication - websockets 10.4 documentation
The WebSocket server can use any client authentication mechanism available ... after the WebSocket handshake, making it impossible to monitor authentication ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found