Class ComparisonResult
- java.lang.Object
-
- io.appium.java_client.imagecomparison.ComparisonResult
-
- Direct Known Subclasses:
FeaturesMatchingResult
,OccurrenceMatchingResult
,SimilarityMatchingResult
public abstract class ComparisonResult extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
commandResult
-
Constructor Summary
Constructors Constructor Description ComparisonResult(java.lang.Object commandResult)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.lang.Object>
getResultAsMap()
byte[]
getVisualization()
Returns the visualization of the matching result.static org.openqa.selenium.Point
mapToPoint(java.util.Map<java.lang.String,java.lang.Object> map)
Transforms a map intoPoint
object.static org.openqa.selenium.Rectangle
mapToRect(java.util.Map<java.lang.String,java.lang.Object> map)
Transforms a map intoRectangle
object.void
storeVisualization(java.io.File destination)
Stores visualization image into the given file.protected void
verifyPropertyPresence(java.lang.String propertyName)
Verifies if the corresponding property is present in the commend result and throws an exception if not.
-
-
-
Method Detail
-
getResultAsMap
protected java.util.Map<java.lang.String,java.lang.Object> getResultAsMap()
-
verifyPropertyPresence
protected void verifyPropertyPresence(java.lang.String propertyName)
Verifies if the corresponding property is present in the commend result and throws an exception if not.- Parameters:
propertyName
- the actual property name to be verified for presence
-
getVisualization
public byte[] getVisualization()
Returns the visualization of the matching result.- Returns:
- The visualization of the matching result represented as base64-encoded PNG image.
-
storeVisualization
public void storeVisualization(java.io.File destination) throws java.io.IOException
Stores visualization image into the given file.- Parameters:
destination
- File path to save the image to.- Throws:
java.io.IOException
- On file system I/O error.
-
mapToRect
public static org.openqa.selenium.Rectangle mapToRect(java.util.Map<java.lang.String,java.lang.Object> map)
Transforms a map intoRectangle
object.- Parameters:
map
- the source map.- Returns:
Rectangle
object
-
mapToPoint
public static org.openqa.selenium.Point mapToPoint(java.util.Map<java.lang.String,java.lang.Object> map)
Transforms a map intoPoint
object.- Parameters:
map
- the source map.- Returns:
Point
object
-
-