Recorded Playback
This package enables users to record and play back recordings for UI interactions in a Unity project.
Requirements & Limitations
- Game objects included in recordings must have a unique combination of name and tags in the scene at the time they are interacted with.
- Only touch, click, and drag actions are recorded, we do not yet support keyboard input.
- Native device interactions, such as phone keyboards or purchase confirmations, are not currently supported.
- Only input for Unity UI is supported.
Usage
- With your project open in the Unity Editor, open the Recorded Playback window (Window -> Automated QA -> Recorded Playback)
- Press "Record" to start recording. Press "Stop" to stop. Your recording will automatically be saved to the project's Assets/Recordings folder.
- Press "Play" to the right of the recording to play back your recording.
Creating Recorded Tests
We recommend creating Recorded Tests from Recorded Playbacks in order to quickly validate the success (or failure) of a recorded playback. Recorded tests can be run in the Editor or on a standalone build: on your dev machine, on a local device, on your build machine, or on an Android phone in a cloud device farm.
See the Recorded Testing Documentation for instructions.
[Advanced] Manually Editing Recordings
Some users may want to manually edit recording files in order to send or receive signals from core game code. For example, to instruct the recording not to begin until the main menu is loaded.
Recorded Playback File Structure
Recordings are saved to the Assets/Recordings folder and named recording-[timestamp].json
. Recordings are stored as json files containing a timestamped list of touch data on Game Objects - each defined by its name and tags.
parameter name | type |
---|---|
position | vector 2 |
eventType | integer, eventType enumeration |
timeSinceStart | number |
pointerId | integer |
waitSignal | string |
emitSignal | string |
objectName | string |
objectTag | string |
eventType | meaning |
---|---|
0 | non-interaction, used for signals |
1 | pointer down |
2 | pointer up |
If waitSignal
is specified and non-empty, playback halts until the RecordingInputModule
is provided the specified signal through the SendSignal(string signal)
function (included in RecordingInputModule.cs).
If emitSignal
is specified and non-empty, RecordingInputModule
will invoke the callback UnityEvent
with the provided string parameter.
example file:
{
"touchData" : [
{
"position" : {
"y" : 0.508287310600281,
"x" : 0.457231730222702
},
"eventType" : 1,
"timeSinceStart" : 0.582690715789795,
"pointerId" : -1,
"waitSignal" : "",
"emitSignal": "",
"objectName": "MenuButton",
"objectTag": "Untagged"
},
{
"waitSignal" : "",
"pointerId" : -1,
"position" : {
"y" : 0.508287310600281,
"x" : 0.457231730222702
},
"timeSinceStart" : 1.04915285110474,
"eventType" : 2,
"emitSignal": "",
"objectName": "MenuButton",
"objectTag": "Untagged"
},
{
"eventType": 0,
"timeSinceStart" : 1.05,
"waitSignal": "continue",
"emitSignal": ""
},
{
"eventType": 0,
"timeSinceStart": 5,
"waitSignal" : "",
"emitSignal": "done"
}
]
}