Text assertions target the text on your website, ranging from the current page’s URL to content in specific page elements such as paragraphs or buttons. This document explains how to make text assertions and provides a reference for the logic (match types) you can use when making text assertions in Autify Nexus.
Making a text assertion
When making a text assertion, you need to specify the following:
A target
A match type
A given value
The target is the value that you are asserting against. In other words, it’s the value that you are checking on your page or in the browser.
The match type is the logic for the assertion. It compares the target to the given value and passes or fails as a result of the comparison.
The given value represents your expectations for the target based on the match type you have selected.
The equation of a text assertion can be thought of as: target + match type + given value = pass OR fail.
Text assertions are case-sensitive and do not strip whitespace from the target or the given value.
Match types
The following is a reference for all match types that you can use for text assertions in Autify Nexus.
Equals
Asserts that the target and given value are exactly the same.
autify equals autify passes.
autify equals Autify fails.
Does not equal
Asserts that the target and given value are not exactly the same.
autifynexus does not equal autify nexus passes.
autify does not equal autify fails.
Matches regex
Asserts that the target matches the pattern of the given regular expression. Unlike regular expressions used in some programming languages, do not enclose regular expressions with backslashes / when using them in Autify Nexus.
Hello Autify matches regex Hello .+ passes.
Hello Autify matches regex \d+ fails.
Contains
Asserts that the target contains a full subsequence of the characters of the given value.
autify contains aut passes.
autify contains ay fails.
Does not contain
Asserts that the target does not contain the given value.
autify does not contain z passes.
autify does not contain ti fails.
Begins with
Asserts that the beginning of the target is the given value.
autify begins with au passes.
autify begins with fy fails.