assert_element
Validates element conditions such as visibility or text content in automated tests, returning pass/fail status and actual value.
Instructions
Assert a condition on an element. Returns whether the assertion passed, the actual value, and a message. Essential for automated testing workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assertion | Yes | Type of assertion to check | |
| selector | Yes | CSS selector for the element | |
| expected | No | Expected value for textEquals, textContains, or valueEquals | |
| attributeName | No | Attribute name for hasAttribute assertion | |
| className | No | Class name for hasClass assertion | |
| tabId | No | Target tab ID (defaults to currently active tab) | |
| apiKey | No | API key for authentication if enabled |