Saturday 25 March 2017

Testing socket.io with a jQuery client

The app is a fairly simple multi-player game meant to be played via a browser. I use express.io and passport.io for the login and authentication, and also to establish a non-persistent session.Once authenticated, I pass the user to the game room where they'll pick-up the jQuery client and establish the socket.io client connection. From here multiple users can join the room, and the room owner can start the game once there are enough players.To test, I'm using FF with Firebug and Multifox to establish unique sessions for each player. I log in with 4 different ids, one for each Multifox session. I then have to manually go through the game logic to get to the area I want to test.Now that I'm getting deeper into the game logic, the testing time is killing my productivity. For each test I have to bring up at least 4 new browser tabs, set the Multifox session, login, commit some game functions, etc, etc.I'm curious if anyone has come across an easier way to test in these types of scenarios. I've looked through most of the node test solutions, but none seem to give you the ability to simply record the steps from the client and then replay those steps through the browser, versus scripting out client interaction for unit testing.Is there a way to automate any of this?

Submitted March 25, 2017 at 04:32PM by opusprime

No comments:

Post a Comment