added
Assert/IF against variables using template strings
over 3 years ago by Andrew Mendelsohn
Now you can create assertions and IF conditions against template strings. Most notably, template strings can include references to variables.
Examples:
- Here we assert that the inner text of an
<h3>
element has the expected text contained in the existing variableexpected_value
. The{{@variableName}}
syntax tells mabl to substitute the value of the variable here.

- Step number 3 is an example of an IF conditional using a variable substitution for
{{@app.url}}
. Because the href value also has a/
at the end, the pattern we use for the expected value is{{@app.url}}/
.

You can combine these variable substitutions with any other text, or even combine multiple variables together like this: {{@first_name}} {{@last_name}}
You can now assert that one variable is equal to another, by selecting a variable as the source for the comparison, and using a template string to compare to a variable value.