What options do I have for Automation and Unit Testing In Unity?

I wanted to create this topic as a registry, listing all of the prominent options for automating UI testing in Unity. I want to give people a high level comparison of what each package offers. People may not realize that there are now many choices to automate UI testing in Unity, along with additional alternative options for unit testing!

Full disclosure! I created and maintain the Trilleon framework mentioned below. I am also a contributor to the Automated QA package.

Here are some categories I will mark with a âś“ or an X if the frameworks provide them:
Automation Testing
Unit Testing
Full Framework (Meaning that it fully replicates something like Selenium, instead of extending an existing framework, or representing a shell of one to build off of.)
CI Integration
External Driver
Report Generation
Parallel Execution
Custom Editor Window(s)

– In alphabetical order –

AltTester

It’s an end-to-end UI test automation tool allowing you to run tests on real devices (mobile, PCs, etc.) or inside the Unity Editor. It supports tests written in C#, Python and Java.It’ll help you to find elements and get all their properties and also to simulate any kind of device input. The desktop app has recording feature, allowing you to generate tests automatically based on recorded actions.

Automation Testing: âś“
Unit Testing: X
Full Framework: X
CI Integration: âś“
External Driver: âś“ (it can use Appium to interact with the game)
Report Generation: âś“ (test results and reports inside unity editor for C#)
Parallel Execution: âś“
Custom Editor Window(s): âś“
Multiplayer Testing: âś“

website & download link: Tools | Test automation tools for Unity apps and games - AltTester®
github: AltTester · GitHub
wiki: AltTester® — AltTester® Unity SDK 2.1.2 documentation
discord server for questions and support: AltTester® - Game Test Automation

Automated QA (Unity)
[Shelved / Development Paused]

The Automated QA package enables users to record and playback touch or drag interactions with the UI of a Unity Project and optionally use recordings to drive Unity Tests - in the editor, on a local iOS or Android device, or on an Android device managed by Unity in the cloud.

See the full alpha announcement post here .

Automation Testing: âś“ (Record & Playback w/ Customization of generated C# tests)
Unit Testing: ✓X (Full Unit Testing in the associated Unity Test Framework; see below)
Full Framework: ✓X (Links to Unity Test Tools & ML Agents to make larger test ecosystem) (Development in progress)
CI Integration: âś“ (Development in progress)
Cloud & Device Farm: âś“ (Development in progress)
External Driver: ✓X (Uses Appium in Cloud Device Farm test runs to interact with devices)
Report Generation: âś“
Custom Editor Window(s): âś“
Multiplayer Testing: X (On the horizon)

asset store link: Disabled…
github: Disabled…
wiki: Disabled…
product page: Disabled…

Minefield

Not even a wrapper to Unity’s own Test Framework, it is just an extension library and guidelines to help you write pure Unity Test Framework test cases. Its focus is that you should be able to code up a scene navigation test fast enough that you could do it while creating the scene without disrupting your creation flow. It is possible with help from “test beacon” components added to the scene as a metadata and a various yieldable methods to help click on those beacons in the test. Easy installation via Unity Package Manager. Because you are still writing Unity tests, of course you could use it together with something like Performance Testing package to create a performance test of scenes while navigating around.

Automation Testing: âś“
Unit Testing: X
Full Framework: X
CI Integration: X
External Driver: X
Report Generation: X (possible with performance testing package)
Parallel Execution: X
Custom Editor Window(s): X

github: GitHub - 5argon/Minefield: Program a concise navigation play mode test in Unity.
wiki: GitHub - 5argon/Minefield: Program a concise navigation play mode test in Unity. (README.md)

Responsible

Responsible is a reactive asynchronous testing utility primarily designed for, but not limited to be used in high level system tests. It’s inspired by Rx, and uses UniRx under the hood, but can be used without any Rx knowledge. It was designed to run as part of Unity Test Framework execution, but should also work with any other test framework that supports coroutines or observables.

The primary benefits of using Responsible are:

  • Detailed output on test failures and timeouts (operation statuses and async “stack traces”)
  • Declarative, composable, and reusable test code
  • Using Responsible will circumvent a Unity Test Framework bug, where test execution will continue after errors within nested coroutines, sometimes even hiding the first exception.

Automation Testing: âś“
Unit Testing: âś“ (Not the primary use case)
Full Framework: X
CI Integration: X
External Driver: X
Report Generation: X
Parallel Execution: X
Custom Editor Window(s): X
github: GitHub - sbergen/Responsible: Reactive asynchronous automated testing utility for .NET and Unity
wiki: n/a

The Puppetry

The Puppetry gives ability to test a game in Unity Editor and when built and deployed to a device. This is done via additional integration with a device’s driver (like Appium for mobile, SDK for consoles or SDK for VR glasses). It is cross platform framework primarily written in C#.

The Puppetry doesn’t have dependencies from any specific technology so it can be combined with any test runner(Nunit, XUnit, MSTest), any CI system, any reporting tool set, and other required libraries or frameworks.

The main purpose of driver approach is to separate the tests from the application code base, so that you don’t worry about how changing tests will affect the application.

And finally, The Puppetry supports parallel execution of tests right out of the box. So you can run your tests simultaneously on different Unity Editors or builds.

Automation Testing: âś“
Unit Testing: X (Perhaps possible, but not explicitly designed for it)
Full Framework: âś“
CI Integration: ✓__X (Ostensibly capable, but not included)
External Driver: ✓X__
(Custom driver w/ Appium for devices)
Report Generation: X (Could not find sign of reporting. Likely has basic result output.)
Parallel Execution: âś“
Custom Editor Window(s): âś“

github: GitHub - TestUnitLab/Puppetry: Framework for automated UI testing of Unity3d application
wiki: ttps://github.com/GameUnitLab/Puppetry/wiki

Trilleon

A complete, internal automation framework that is entirely self-contained in your game binary. Communicates with CI process (Jenkins, Bamboo, Pipelines) over simple pubsub messaging framework and sockets. Accepts commands to run tests, and then takes care of the rest. Entirely white box testing solution. Adds massive number of additional options for controlling the order that tests run, along with dependencies between tests and test classes. Extensive editor window, “The Nexus”, where you can organize, launch tests, review test results, and customize the framework.

Just as easy to use as a Unit test framework alternative too. Trilleon can handle any Unit test logic that requires the use of Coroutines, or any context specific game code that cannot be tested on compile time!

Automation Testing: âś“
Unit Testing: âś“ (Atypical; not run at compile time.)
Full Framework: âś“
CI Integration: âś“ (Scripts supplied fully for Mac, partially for Windows)
External Driver: ✓__X__ (Uses Appium to load apps onto devices; no further driver usage)
Report Generation: âś“ (Friendly Html/Js/Css report, Standard XML report, In-editor results window)
Parallel Execution: âś“ (Supports through Selenium Grid)
Custom Editor Window(s): âś“

github: GitHub - disruptorbeam/trilleon: Automate all the things.
wiki: Welcome to Trilleon · disruptorbeam/trilleon Wiki · GitHub

Unity Test Framework
(formerly Unity Test Runner)

The built-in way of running unit tests, and scenario-based automation tests. The latter requires test scenes, and does not test the real scene, on devices, as a user would.

Automation Testing: ✓X (Yes & no; it is not true automation tests, but more like a Unit-Integration/Automation hybrid)
Unit Testing: âś“
Full Framework: âś“
CI Integration: âś“ (CLI provided here)
External Driver: X
Report Generation: âś“ (Standard xml report, In-editor results window.)
Parallel Execution: X****âś“ (Not for automation tests)
Custom Editor Window(s): âś“

wiki: About Unity Test Framework | Test Framework | 1.0.18

Unium

Unium is an experimental library for the purposes of facilitating automated testing and tool development for your Unity games.

Automation Testing: âś“
Unit Testing: X
Full Framework: X
CI Integration: ✓__X__ (Ostensibly capable, but not explicitly)
External Driver: X (Facilities use of external drivers. No dependencies on them.)
Report Generation: X (Facilitates integration of existing testing frameworks; ex: mocha, jest, pytest, specflow, etc…)
Parallel Execution: ? (Unknown)
Custom Editor Window(s): âś“

github: GitHub - gwaredd/unium: Automation for Unity games
wiki: n/a

Unity UI Test Automation

This is a basic wrapper for running ui automation tests that works with the Unity Test Framework. The information below describes what this tool offers only, and not what it offers in addition to the Unity Test Framework.

Automation Testing: âś“
Unit Testing: X
Full Framework: X
CI Integration: X
External Driver: X
Report Generation: X
Parallel Execution: X
Custom Editor Window(s): âś“
github: GitHub - taphos/unity-uitest: Unity UI Test Automation Framework
wiki: n/a

If you are an owner of one of these repositories, feel free to provide me an updated elevator pitch for your toolset. Correct me on any mistakes I make. Additionally, if you have an alternative tool to add to this list, let me know as well.

22 Likes

Unity Test Runner is usable in CI - as documented you can launch it test runs from the command line.

2 Likes

Thanks, @superpig

I’ve updated the post.

Much needed topic, It should be Pinned

5 Likes

Great work!

I just want to say that I am also starting a new play mode testing library called Minefield. This completely depends on Unity Test Runner, it is just an extension that adds some useful methods. Though it is still in development currently it could navigate the scene the way I want to. Maybe it is still not that fully fledged like other on your list yet …but it is getting there.

1 Like

Write me a primer like those above, and I will add you to the list.

Hey, great list :).

A small correction, whilst you certainly can use unium and appium togther, there’s no dependency there. Appium is not required neither is unium a wrapper for it in any way - it shares the some of the same philosophy in it’s approach but none of the implementation details.

Also, for clarity there is no report generation - none, zero, zip, nada :wink:

Rather - it facilitates existing testing frameworks (mocha, jest, pytest, specflow, etc…) and all the goodness that comes with them.

1 Like

Thanks for the corrections and updates. Just added them.

Alright, I just hit a milestone on my game with Minefield and quite confident of the state of the API now.

MINEFIELD

Not even a wrapper to Unity’s own Test Runner, it is just an extension library and guidelines to help you write pure Unity Test Runner test cases. Its focus is that you should be able to code up a scene navigation test fast enough that you could do it while creating the scene without disrupting your creation flow. It is possible with help from “test beacon” components added to the scene as a metadata and a various yieldable methods to help click on those beacons in the test. Easy installation via Unity Package Manager. Because you are still writing Unity tests, of course you could use it together with something like Performance Testing package to create a performance test of scenes while navigating around.

Automation Testing: âś“
Unit Testing: X
Full Framework: X
CI Integration: X
External Driver: X
Report Generation: X (possible with performance testing package)
Parallel Execution: X
Custom Editor Window(s): X
github: https://github.com/5argon/Minefield
wiki: https://github.com/5argon/Minefield (README.md)

Added. Thanks.

1 Like

Hey, thanks for this list! Its just what we were looking for. While looking for testing tools, we also found this one: https://www.gamedriver.io/
Have you tried it by chance? Maybe you can add it to the list :slight_smile:

So without being able to freely view the code for gamedriver.io on something like Github, I cannot verify things in the same way as the examples in my first post.

Also, at the moment, I am not going through the the process to get a free 30 day trial and access to the software.

I am more than happy to add a profile for them if a representative of gamedriver.io can write up a pitch for me, and give me at least some limited visibility into their product to reasonably confirm the claims.

1 Like

@tsibiski Trilleon sounds like something I would want to try. How do we use Trilleon on a closed source Unity project and comply with section 4.d of the LGPL? Specifically, how do we provide a way for users to re-link different versions of the Trilleon library? I don’t think there is a way to provide that when building the Unity game to Android or iOS. What do you think about MIT, BSD, Apache licenses to help increase adoption rates? Projects using those licenses still get plenty of pull requests to help improve the software.

Hi @rhino_potato
Unfortunately, I did not choose the license and don’t have control over what license is used. I think that aspect of its use was probably a mistake to omit when choosing a license, rather than indicative of any intent to restrict its use. The intent was that no one took the project and claimed it as their own creation, or tried to make money off of it. There was no other intent behind the license used.

I will try to contact DisruptorBeam to ask for a change to the license, but I have not worked there in 4 years now. So I can’t make any guarantees. Given that I know the intent, I personally would not hesitate to use it in the scenario you supplied above. For what it’s worth.

I contacted someone from the C level, and they also said that it is not intended to be that restrictive. But they will confirm everything and, if agreed, update it. Likely to be MIT if so.

1 Like

Hi,
Great topic, this list is very helpful.

I’d also like to suggest a tool.
AltUnity Tester, is a UI test automation tool allowing you to run tests on real devices (mobile, PCs, etc.) or inside the Unity Editor.
We started developing it a few years ago, after struggling to interact with objects from Unity Games.

Hope it will help some of you. It’s open-source, free and it can be downloaded from the Asset Store: https://assetstore.unity.com/packages/tools/utilities/altunity-tester-ui-test-automation-112101

Could you do me a favor and write up a description of it in the same format as the existing tools above? (Hopefully marking the relevant features like the other tools do). Thanks!

1 Like

@tsibiski here’s the description in the format you asked for. Let me know if you need more info.

AltUnity Tester

It’s an end-to-end UI test automation tool allowing you to run tests on real devices (mobile, PCs, etc.) or inside the Unity Editor. It supports tests written in C#, Python and Java.

It’ll help you to find elements and get all their properties and also to simulate any kind of device input.

Automation Testing: âś“

Unit Testing: X

Full Framework: X

CI Integration: âś“

External Driver: âś“ ( it can use Appium to interact with the game)

Report Generation: âś“ ( test results and reports inside unity editor for C#)

Parallel Execution: X ( is possible, but no special implementation in the tool for it)

Custom Editor Window(s): âś“

Multiplayer Testing: âś“

asset store link: https://assetstore.unity.com/packages/tools/utilities/altunity-tester-ui-test-automation-112101

gitlab: https://gitlab.com/altom/altunity/altunitytester

wiki: https://altom.gitlab.io/altunity/altunitytester/

gitter room for questions and support: https://gitter.im/AltUnityTester/Lobby

Thanks, I added your tool.

1 Like

Hey, thanks for making this list. I’m overloaded with choice!

We are new to automated testing and not sure which is the best one to use. We are working on a mobile puzzle game and we want to have the game run through the levels overnight and check everything is working.

Which ones have people had success with and would recommend?