Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 879 Bytes

asserttrue.md

File metadata and controls

36 lines (26 loc) · 879 Bytes

assertTrue

Asserts whether given value is either true, non-empty, or truthy (in JavaScript terms):

- assertTrue: ${value}

This command is primarily designed to be used in combination with JavaScript values. For example, you can assert that two views have the same text:

- copyTextFrom: View A
- evalScript: ${output.viewA = maestro.copiedText}
- copyTextFrom: View B
- assertTrue: ${output.viewA == maestro.copiedText}

You can also use it to immediately fail the test:

- assertTrue:
    condition: ${false}
    label: This will always fail

Related commands

{% content-ref url="assertvisible.md" %} assertvisible.md {% endcontent-ref %}

{% content-ref url="assertnotvisible.md" %} assertnotvisible.md {% endcontent-ref %}