Basically, I made a post to a Rest service and then I listen to WebSocket to see if any new messages are displayed.
The first statement passes, but the second does not. Cypress displays a message saying: "Cannot read properties of undefined (reading 'payload').
The console.log command does not print anything to the console. I think the return message from the WebSocket is not being stored in the "result" variable.
It looks like cypress is not reading all messages sent by WebSocket. Could anyone tell me what's wrong with my code?
`///
import { addStreamCommands } from '@lensesio/cypress-websocket-testing';
I'm trying to get messages from a WebSocket to make assertions using Cypress. I used the example from the website [link] (https://github.com/lensesio/cypress-websocket-testing/blob/master/README.md) to do the automation.
Basically, I made a post to a Rest service and then I listen to WebSocket to see if any new messages are displayed.
The first statement passes, but the second does not. Cypress displays a message saying: "Cannot read properties of undefined (reading 'payload').
The console.log command does not print anything to the console. I think the return message from the WebSocket is not being stored in the "result" variable.
It looks like cypress is not reading all messages sent by WebSocket. Could anyone tell me what's wrong with my code?
`///
import { addStreamCommands } from '@lensesio/cypress-websocket-testing';
addStreamCommands();
describe('Should create investment ', () => {
})`