-
Notifications
You must be signed in to change notification settings - Fork 425
Development and Testing
Salman Ahmed edited this page May 14, 2021
·
8 revisions
All initial development of (and further improvements applied) to components in a project should be developed in the VisualTests environment. There are several advantages to doing this.
TestScenes support a limited dynamic compilation engine. This allows for automatic compilation when a .cs
file is changed, followed by reloading of the TestScene. Keep in mind a few limitations:
- This only works with editors that do atomic file writes (ie. if using Rider, you need to turn off "back up files before saving").
- You must have the TestScene you are interested in currently displayed before making file changes.
- The first time a dynamic compilation is initialised will take a while to process the dependency graph. Further compilations will be almost instant.
Here is an example of how this looks in practice:
You can use the AddStep
function to add automatic steps which should be performed. Asserts can also be added as steps. These steps can be run in an interactive environment by the user, but also run in a headless execution, allowing for CI process testing.
The types of steps available to be added are as follows:
- AddStep creates a step that runs a method. Completes successfully if no exceptions are caught.
- AddRepeatStep creates a step that runs a method a specified amount of times. Completes successfully if no exceptions are caught.
- AddToggleStep toggles a flag.
- AddUntilStep adds a step that attempts to run until a condition becomes true, or fails when it times out.
- AddWaitStep adds a step that waits a specified amount of time before continuing to the next step.
- AddSliderStep adds a step that creates a slider-bar that adjusts a set value.
- AddAssert creates a step that fails if the specified value does not return true.
- Dynamic compilation is disabled if the application is started with a debugger attached. Attaching a debugger during execution does not disable dynamic compilation.
- Create your first project
- Learning framework key bindings
- Adding resource stores
- Adding custom key bindings
- Adding custom fonts