UI Automation testing framework recommendations

I am looking for a framework to use for writing UI Automation tests. I want to be able to write automated tests that drive the game in a way similar to how a user would, and the tests need to be able to run on device. Are there any frameworks that enable this type of automation?

The testing/assertion/injection framework itself is many ways the easiest part of this problem. Unity has a simple unit testing framework (Unity Blog) and there are some dependency injection frameworks that may be of use, but really the key here is ensuring your design/approach is testable.

Although it does depend on the complexity of the game, for automated functional testing you will likely need to design your assets in a way that facilitates this (e.g. ensure sufficient abstraction between user input and its effect on the game world). Similar to functional tests for browser you need to include some leeway in most of your functional tests, most games aren’t deterministic.