Joris Eijmberts

Turning crazy ideas into games!

CP Social test project

After designing CP Social’s inner workings I started working on a test project that I could use to test all features of CP Social’s unified api. This project had a couple requirements, it had to be:

  • Quick, nothing fancy
  • Include all functionalities
  • Preferably fast to build

The image below shows a screenshot of the final test project, it consisted of a single page that contained all functionalities that had to be tested.

Initialize button

The test ‘game’ contained a button which could initialize CP Social after the game had been started to check the initialization and authentication of CP Social using a connected debugger, and the debug logs.

App info

To check if CP Social would be running internally on the correct platform, the test project contained some easy to read label that would display what platform CP Social was initialized for internally. The app Id given to CP Social using the CP Social settings configured using the configurator.

User info

The test project also would automatically show all the available user information after the authentication process would complete after initializing CP Social.

Achievement debugging

To test the achievement feature of CP Social, this test project contained a menu for unlocking and resetting an achievements using its universal reference name (explained in the ‘example’ here)

Cloud save

Cloud saving in the test project was done using a simple object containing the current date and in-game time that could be converted to JSON and saved and loaded to the cloud through CP Social’s cloud save service.

By using the current date and in-game time, it was possible to verify it has been saved an loaded correctly by comparing these values later on the the new current date and in-game time.

Unit-testing

At the start of the realization phase I used the Unity test runner to test the steam implementations of CP Social. But when I started implementing the Android and iOS functionalities I found out that when trying to run the test for these platforms I had to create a build, copy it to a test device and then run the tests.

This process took quite a while and after a meeting with Martijn we decided skip the step of implementing test for these platforms and just use the test project itself to test CP Social features.

Steam tests, Unity test runner