Testing Socketio chat app using Cypres.io
Using Node v12+ install dependencies
$ npm install
$ npm start
Open localhost:8080
- Install Cypress
- Scaffold example tests
- Add Prettier, see How to configure Prettier and VSCode
- Test opening the chat and posting a message
- Add CI
- Optional: add Cypress Dashboard recording
- Test randomly generated user name
- Use API inside the app to simulate the second user
- Implement 2nd Socketio connection from the plugins file to the server
- check the 2nd user connects
- check the 2nd user sends a message
- check we can send the message to the 2nd user
- check the 2nd user leaves and we are notified
- advanced run two Cypress tests at the same time
- advanced sync two Cypress runners using checkpoints and intermediate Socketio server
Copied from bahmutov/cypress-socketio-chat which itself got the chat server from dkhd/node-group-chat.
Author: Gleb Bahmutov <[email protected]> © 2021
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github