A Unity Package Manager compatible UI automation testing framework for recording and replaying UI interactions.
| Project | Description | Special Setup |
|---|---|---|
| MTD | Monster Truck Destruction | Add HAS_EZ_GUI define |
| TOR | Trucks Off Road | None required |
Add to your Packages/manifest.json:
{
"dependencies": {
"com.oddgames.uitest": "https://github.com/oddgames/tool_ui_automation.git"
}
}{
"dependencies": {
"com.oddgames.uitest": "file:../../tool_ui_automation"
}
}Add HAS_EZ_GUI to Player Settings > Scripting Define Symbols (all platforms) to enable EZ GUI/AnB UI clickable support for legacy UI buttons (AutoSpriteControlBase, UIButton3D).
No additional setup required. The package works out of the box with Unity UI and TextMeshPro.
using ODDGames.UITest;
using Cysharp.Threading.Tasks;
[UITest(Scenario = 1, Feature = "Login", Story = "User can log in")]
public class LoginTest : UITestBehaviour
{
protected override async UniTask Test()
{
await Click("LoginButton");
await TextInput("EmailField", "test@example.com");
await TextInput("PasswordField", "password123");
await Click("SubmitButton");
await Wait("WelcomeScreen");
}
}| Property | Type | Description |
|---|---|---|
Scenario |
int | Unique test scenario ID (required) |
Feature |
string | Feature being tested |
Story |
string | User story description |
Severity |
TestSeverity | Blocker, Critical, Normal, Minor, Trivial |
Tags |
string[] | Tags for filtering tests |
Description |
string | Detailed test description |
Owner |
string | Test maintainer |
TimeoutSeconds |
int | Test timeout (default: 180) |
DataMode |
TestDataMode | UseDefined, UseCurrent, Ask |
Wait(name)- Wait for element to appearWaitFor(condition)- Wait for custom conditionWaitFramerate(fps)- Wait until framerate stabilizesSceneChange(sceneName)- Wait for scene to load
Click(name)- Click a UI element by nameClickAny(name)- Click any matching elementHold(name, duration)- Hold/long press elementDrag(name, direction)- Drag elementDragFromTo(from, to)- Drag between positionsTextInput(name, text)- Enter text in input field
Find<T>(name)- Find component by name (supports wildcards)FindAll<T>(name)- Find all matching components
CaptureScreenshot()- Capture test screenshotAttachJson(name, data)- Attach JSON data to reportAttachText(name, text)- Attach text to reportAttachFile(path)- Attach file to reportBeginStep(name)- Start named test stepTrackPerformance(name)- Track performance metricsAddParameter(key, value)- Add test parameter
RegisterClickable<T>()- Register custom clickable typeRegisterRaycaster(raycaster)- Register custom raycaster
Use the toolbar "Record Test" button to record user interactions:
- Click the Record button in the Unity toolbar
- Enter a name for your recording
- Interact with the UI as you would in your test
- Stop recording
- Use the Generator window to create test code from the recording
- UniTask - Async/await support
- TextMeshPro - UI text handling
- Unity UI - Core UI system
- Unity Recorder (Editor only) - Video recording for test runs
| Assembly | Platform | Description |
|---|---|---|
ODDGames.UITest |
Runtime | Core test framework |
ODDGames.UITest.Editor |
Editor | Test runner and editor tools |
ODDGames.UITest.Recording |
Runtime | Recording/playback system |
ODDGames.UITest.Recording.Editor |
Editor | Recording toolbar and generator |
ODDGames.UITest.EzGUI |
Runtime | EZ GUI support (HAS_EZ_GUI only) |
See CHANGELOG.md for version history.