Assertions and test subjects¶
The application changes in reaction to user input. For example a button turns green when pressed or a particular network request is made just before video starts playing.
Suitest lets you inspect different objects inside the application and provides flexible ways to create assertions about the object's properties.
To create assertion in the Suitest Test editor use the Assert or the Wait until lines:
Assert makes a single immediate check and returns the result. Wait until will make the same checks periodically and will give up after the specified amount of time.
await suitest.assert.element('homemenu').matches(PROP.BG_COLOR); await suitest.assert.element('homemenu').matches(PROP.BG_COLOR).timeout(2000);
Assertions operate on a test subject. Every test subject has it's own set of comparison operations.
Available test subjects¶
Some test subjects are platform-specific and are available on certain platforms only. Here is the full list:
- Application - the application under testing.
- Cookie - a web cookie with a particular name.
- Current location - the currently opened URL of the application.
- Network request - any network request made by the application during the execution of this test.
- Video - the video playback object.
- View element - a view element from the repository such as a button, image, container etc.