Class ObscureAll
- java.lang.Object
-
- com.github.loyada.jdollarx.visual.AllElementsObscure
-
- com.github.loyada.jdollarx.singlebrowser.ObscureAll
-
- All Implemented Interfaces:
AutoCloseable
public class ObscureAll extends AllElementsObscure implements AutoCloseable
class that allows to hide elements temporarily. This is useful when doing visual testing, while ignoring elements that are not interesting for the test. For example - testing a chart while ignoring certain labels. This is an Autocloseable: it reverts to the original state when leaving the try{} block.
-
-
Constructor Summary
Constructors Constructor Description ObscureAll(Path element)
Make the first element matching the given path temporarily hidden.ObscureAll(List<Path> elements)
Make the elements matching the given paths temporarily hidden.ObscureAll(List<Path> elements, boolean strict)
Make the elements matching the given paths temporarily hidden.
-
Method Summary
-
Methods inherited from class com.github.loyada.jdollarx.visual.AllElementsObscure
close, getNumberOfElementsObscured, getObscuredElements
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Constructor Detail
-
ObscureAll
public ObscureAll(Path element)
Make the first element matching the given path temporarily hidden. If the element is not found, it ignores it.- Parameters:
element
- the path of the element to obscure
-
ObscureAll
public ObscureAll(List<Path> elements)
Make the elements matching the given paths temporarily hidden. In case there are multiple matches, it will hide the first one. If the element is not found, it ignores it.- Parameters:
elements
- the elements to obscure
-
ObscureAll
public ObscureAll(List<Path> elements, boolean strict)
Make the elements matching the given paths temporarily hidden. In case there are multiple matches, it will hide the first one.- Parameters:
elements
- the elements to obscurestrict
- in strict mode, if the element is not found, it throws am exception and stops
-
-