The undo/redo feature test is used to test the undo/redo system in an automated way, reducing the regressions introduced by new changes.
In the current implementation this means that the serialized state of an object before and after a single test must be the same.
The serialization of objects is carried out automatically and their state is saved in an .xml file structured like the following:
Nodes in more indented levels are children of the nodes in less indented levels.
The undo system supports many different kinds of undos such as undo group detach/attach, prefab extract all, etc, with different setup conditions. For this reason, the actions that are required to set up and execute a single test and its components are exposed via python scripts. This way it is possible to expose editor actions via a flexible and simple scripting language and test Sandbox python APIs at the same time.
|The Test Runner can be accessed via Tools → Advanced → Test Runner in the Sandbox menu.|
For more information about Test Runner, please refer to the Test Runner page.
Custom Test Example
Following is a commented test script example that attaches an object to a group, undoes this and checks if both actions have been performed successfully.