Writing Tests

Assertion Steps

Verify that your application is working correctly

Assertion steps verify that your application is in the expected state. Use them to check text, element states, URLs, and more.

AI Assertion

Verify conditions using natural language descriptions — the most powerful assertion tool.

Configuration:

  • assertion (required): Natural language assertion to verify

Best for: Visual states, dynamic content, context-dependent conditions like "The cart looks empty" or "The success message is showing."

Learn more about AI Assertions.

Assert URL

Verify that the current page URL matches a specific pattern.

Configuration:

  • urlRegex (required): Regular expression to match against current URL

Assert Text

Check that an element contains specific text content.

Configuration:

  • elementDescription (required): Description of element to check text in
  • textRegex (required): Regular expression to match element text
  • elementReference (optional): Direct element reference with DOM/UUID or XPath

Assert State

Verify the state of elements (visible, hidden, enabled, disabled).

Configuration:

  • elementDescription (required): Description of element to check state
  • state (required): Expected element state (enabled, disabled, visible, hidden)
  • elementReference (optional): Direct element reference with DOM/UUID or XPath

Assert Attribute

Check that elements have specific HTML attributes and values.

Configuration:

  • elementDescription (required): Description of element to check attribute
  • attributeName (required): Name of attribute to check
  • attributeValue (required): Expected attribute value
  • elementReference (optional): Direct element reference with DOM/UUID or XPath

Assert Download

Verify that files are downloaded with expected names.

Configuration:

  • downloadName (required): Expected download filename

When to Use Which Assertion

AssertionBest for
AI AssertionComplex, context-dependent validations
Assert URLNavigation, redirects, query parameters
Assert TextExact error messages, prices, IDs
Assert StateButton enabled/disabled, element visibility
Assert AttributeAccessibility attributes, CSS classes, link targets
Assert DownloadFile downloads, exports

General rule: Start with AI Assertion for complex validations. Use traditional assertions for precise, technical checks. Combine both for comprehensive coverage.