Closed nehalbadelhafez closed 4 years ago
Hi @nehalbadelhafez , what do you mean by "channel name"?
var payload = { command: "subscribe", identifier: '{"channel":"LogsChannel"}' }; like this, as I have number of channel and I need to subscribe to specific one
You can use the startUpMessage property of the cy.streamRequest, as in the docs. That payload will be sent once the connection has been made, and you should set takeWhileFn to check for the confirmation message for your subscription.
could you please show me an example, also the docs where ? as the docs contains typescript I need javascript example
See this example: https://github.com/lensesio/cypress-websocket-testing/blob/master/examples/cypress/integration/examples/streamRequest.spec.ts#L60
It's the same in Javascript, just remove the types.
ok I will try it thank you so much
Closing issue then.
what I need to do is to subscribe on the channel and wait until special message come, I have tried cy.stream with subscribe but I can't find where I should but channel name to get a confirmation message on subscription