End-to-End Testing of Unity Games and Apps
Game Testing Case Study
Key achievements
- Provide fast prototyping, trying out new graphics quick
- Help deploy apps to many platforms such as IOS, Android, Windows and Mac
- Complete automation of the testing process, achieving end-to-end testing of unity apps
Types of testing
- UI Driven Testing
- Functional Testing
- Mobile Application Testing
- Test automation
Tools & technologies
- AltTester® Unity SDK
- Appium
- Unity
Industry
- Game development
- Mobile Apps
The client
A couple of years ago we started working with a company in their New Concepts team as testers and app developers. Our client was creating simple clean apps, testing a lot of new ideas that had to be delivered fast.
The needs and challenges
As part of their team, we were trying out a lot of new ideas, developing small apps, and prototyping a lot of solutions in a very fast-paced environment. Along with new ideas, we also needed to try new graphical designs and we needed to create apps that were fast to develop and could be deployed to a multitude of platforms if needed. We focused mostly on iOS and Android, but we needed to know that the apps could run on Windows and Mac.
Our solution
The incredible agility of Unity for development
After trying out a few options, including some web frameworks, we decided to develop all our apps in Unity. It has support for any platform that we could ever need and it’s excellent for fast prototyping, with incredible graphics on every platform and with an abundance of ready-made artworks, scripts, plugins, and solutions available on their Asset Store.
The struggles of test automation using Appium and image recognition
While Unity allowed us to be very productive on the development side, we were again struggling on the testing side.
We had to deal with a lot of apps that still required a lot of testing. Most of these apps also had to work together as part of a system, and we often found ourselves trying to figure out ways to deploy and run some automated checks on our environment automatically.
While the apps were relatively simple and would have been the perfect candidate for simple automated checks with Appium (which works on Android, iOS, and even Windows nowadays), Unity didn’t have a solution for running these types of system-level / UI driven tests on real devices.
Finding a solution for UI driven test automation in Unity
While searching for a solution for these two problems, Rasmus Selsmark, a fellow tester who works at Unity in Helsinki, told us about this hack-day project that provides one possible option for running Appium tests against Unity games and getting feedback from Unity about the objects on the screen via the Debug.Log() functionality – so essentially by injecting information about specific objects in the device logs (logcat on Android or syslog on iOS), from where they can then be parsed and used inside the Appium tests.
We tried it out and then decided to try to implement something similar using a TCP socket running from the Unity game that can listen to commands sent from the tests. And so we created AltTester® Unity SDK.
The result
One of the biggest challenges of this project was to provide solutions for fast delivery. The needs were simple: create fast to develop mobile apps, that could be deployed to a multitude of platforms. Our first solution was to use Unity, for fast prototyping. Our second solution was to create a new testing tool for UI driven test automation.
Struggling with game test automation?
We can find a solution suitable for you!
or call +40 371 426 297