assertNotVisible
Verify element disappearance with assertNotVisible using text, ID, or properties.
To assert whether an element is not visible, use the following command that takes the same parameters as tapOn
- assertNotVisible:
# Same exact parameters as tapOnThis command will wait for view to disappear if it is currently visible.
You are most likely going to be using the following properties, but please refer to the Selectors page for an exhaustive list of all available selectors:
text- text in a viewid- id of a viewenabled-trueif view is enabledchecked-trueif view is checkedfocused-trueif view has keyboard focusselected-trueif view is selected
Examples
To check whether view with a text My Button is visible you can run the following command:
- assertNotVisible: "My Button"To check whether view with a text My Button that is also enabled is not visible you can run the following command:
- assertNotVisible:
text: "My Button"
enabled: trueSuch test will fail if either
There is no button with such text
There is a button but it is disabled
Related commands
assertVisibleassertTrueLast updated
Was this helpful?
