Semantic assertions must be enabled for your workspace. Ask your QA Wolf team to turn them on. They aren’t available to workspaces whose AI data policy restricts provider data retention.
ai.expect(...).toSatisfy(...) from @qawolf/ai/web.
statement— the requirement the element’s text must satisfyoptions— optional object, see Key options below
Examples
Assert on the meaning of a replyWhen to use
- Your app shows AI-generated text, such as chat replies or summaries, whose wording changes between runs.
- The requirement is what the text means, not the exact words.
- An exact-match assertion would need to list every acceptable phrasing.
toSatisfy for required copy, numbers, IDs, and formats, or to prove what the app did, such as saving a record. Use an exact expect assertion instead.
Key options
Notes
ai.expectoffers onlytoSatisfyand.not.toSatisfy. Useexpectfrom@qawolf/flows/webfor every other matcher.- The locator must match exactly one element.
toSatisfyreads its text, not its visibility or input value, so addtoBeVisible()when visibility matters. - An uncertain judgment or an evaluator error fails both
toSatisfyand.not.toSatisfy. Treat an inconclusive result as a failure to investigate, not a reason to lower the threshold. - Semantic assertions run in web flows, in the editor and in triggered runs. They aren’t available in iOS, Android, or local execution.
- QA Wolf evaluates each assertion with TypeSafe’s Jev model, so flows need no API key.
- When semantic assertions are enabled, the QA Wolf agent uses them for generated text in the flows it writes.