Class ComparisonResult

    • 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 into Point object.
      static org.openqa.selenium.Rectangle mapToRect​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Transforms a map into Rectangle 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • commandResult

        protected final java.lang.Object commandResult
    • Constructor Detail

      • ComparisonResult

        public ComparisonResult​(java.lang.Object commandResult)
    • 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 into Rectangle 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 into Point object.
        Parameters:
        map - the source map.
        Returns:
        Point object