assert
Verify widget conditions in a live Flutter app by running an assertion check for existence, visibility, text content, count, state, or enabled status against a specified target.
Instructions
Runs an assertion check on a widget. Use 'check' to specify the type: exists, not_exists, text_equals, text_contains, count, state, visible, or enabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| check | Yes | Type of assertion to perform | |
| target | No | Target string (e.g. '#loginBtn', 'text="Submit"', 'type="ElevatedButton"', 'semanticsLabel="Username"') | |
| expected | No | Expected value. Required for text_equals/text_contains (string), enabled (boolean), or count (integer). | |
| stateKey | No | Widget state property to check (e.g. 'value', 'groupValue'). Required for check='state'. | |
| timeout_ms | No | Implicit wait timeout in milliseconds before failing |