百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

unity-uitest

> 编程语言
开源

Unity UI 测试自动化框架

200 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Unity UI 测试自动化框架

Unity UI Test Automation Framework

This version of framework is supported by Unity 2017 and later.

Comparing to the previous version it is integrated with Unity PlayMode Test Runner instead of custom runner implementation. Note that running tests in platform players (for example Standalone, Android, or iOS) from command line is not currently supported by Unity. https://docs.unity3d.com/Manual/testing-editortestsrunner.html

If you would like to execute tests from command line or write tests for older Unity versions check out previous version of the framework https://github.com/taphos/unity-uitest/tree/1.0

Features

  • Allows to write automated tests that drive the game in a way similar to how a user would
  • Integrated with Unity UI solution, can easily be integrated with custom solutions like NGUI or EZGUI
  • Integrated with Unity Test Runner
  • Tests can be executed in Unity Player or Editor (PlayMode)
  • Includes lightweight dependency injection framework for object mocking

Running

  • In Editor Open Window->Test Runner
  • Switch to PlayMode tab
  • Click Run

Implementing tests

  • To add a new test create a new class anywhere in the project extending UITest
  • Use UnityTest, SetUp and TearDown attributes same way as you would in Unit tests
  • Checkout example in Assets/UITest/Examples/UITestExample.cs

API

API is designed to be readable as a natural language so it can be understood by non technical people too. All API calls are designed to wait until its function could be executed with a certain timeout.

  • Press() - Simulates a button press. If an object with a given name is not found in the scene, it waits for it to appear.
  • LoadScene() - Load new scene and wait until scene is fully loaded.
  • AssertLabel(, ) - Asserts text value, waits until value is changed.
  • WaitFor() - Generic method to wait until given condition is satisfied.
  • WaitFor(new LabelTextAppeared(, )) - Wait for label with given text to appear
  • WaitFor(new SceneLoaded()) - Wait until scene is fully loaded
  • WaitFor(new ObjectAppeared()) - Wait for object with given name to appear
  • WaitFor(new ObjectAppeared()) - Wait for object with component of given type to appear
  • WaitFor(new ObjectDisappeared()) - Wait for object with given name to disappear
  • WaitFor(new ObjectDisappeared()) - Wait for object with component of given type to disappear
  • WaitFor(new BoolCondition()) - Generic condition is satisfied when a given bool expression becomes true

Check out my blog post for in depth description http://blog.filippkeks.com/2016/11/21/why-game-developers-are-afraid-of-test-automation.html Have fun testing ;)

Filipp Keks

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言