How to record tests
After connecting to an instrumented build, choose the Recorder
tab and press the Start Recording
button.
You’ll be able to record the following commands:
Load scene
Go to the Manage Scenes
button, choose the way you want to load the scene (Single
or Additive
) and select the scene you want to be loaded in the test.
Load a scene with Single
selected:
Load a scene with Additive
selected:
Wait for object
With Select object
active, click on any element from the screenshot area or from the game objects hierarchy area to record a step that waits for the selected object to be present.
Click on object
With Select object
inactive and Default action
set to Click/Press
, choose Click objects
from the dropdown then, by clicking on an object in the screenshot area, it will record the click command on that object.
Click on coordinates
With Select object
inactive, choose Click coordinates
and then, by clicking on an object in the screenshot area, it will record the click command on the screen position where the click was made.
Tap on object
Now change the Default action
to Tap/Swipe
, keep Select object
inactive. Choose Click objects
from the dropdown and tap on an object in the screenshot area. This will record a tap command on the selected object.
Tap on coordinates
Keep the Default action
set to Tap/Swipe
and Select object
inactive. Choose Click coordinates
from the dropdown and tap on an object in the screenshot area. This will record a BeginTouch and an EndTouch command on the screen position where the tap was made.
Swipe
Keep the Default action
set to Tap/Swipe
and Select object
inactive. Choose Click objects
from the dropdown and swipe from one object to another one. In the example below the swipe was recorded from the StoreButton to the StartButton.
Press key
Press any key that controls your game. In the example below the left arrow was pressed to avoid an obstacle on the road.
Set text
For objects that have a text component, like a label, button, input field etc., you can select the Text
input field in the game element details area and change the content during recording. After hitting enter, a new step will be generated in the test that sets the text from the object to the one that was given.
Before changing the text:
After changing the text:
Add assertion
For objects that have a text component, you can click on the Text
label in the game element details area and it will record a WaitForComponentProperty command on the input field’s current content. This is equivalent to an assertion with the only difference that it has a timeout and will wait 20 seconds, by default, for the appropriate variable to have the specified value.
You can also navigate to the Fields
and Properties
columns and click on a primitive field/property label. This will also generate a WaitForComponentProperty command in the recorded steps.