Commands
assert
Validate conditions during a test using the assert command.
Description
The assert
command validates that a specific condition is true. It ensures that a task completed successfully by checking the screen for the expected outcome. If the condition isn’t met, the test will fail.
Arguments
Argument | Type | Description |
---|---|---|
expect | string | The condition to check. This should describe what you expect to see on the screen. |
async | boolean | (Optional) If set to true , the test will continue without waiting for the assertion to pass. Default is false . |
Example usage
Example with async
Notes
- Use
async: true
to speed up tests by allowing non-blocking assertions. However, the test will still fail if the condition isn’t met. - Ensure the
expect
string clearly describes the condition to avoid ambiguity.