Mozilla Iris  1.0
A visual test suite for Firefox
iris.api.core.region Namespace Reference

Classes

class  Region
 

Functions

def highlight (region=None, seconds=None, color=None, pattern=None, location=None)
 
def generate_region_by_markers (top_left_marker_img=None, bottom_right_marker_img=None)
 
def create_region_from_patterns (top=None, bottom=None, left=None, right=None, padding_top=None, padding_bottom=None, padding_left=None, padding_right=None)
 
def text (image_processing, in_region=None, debug=False)
 
def hover (where=None, duration=0, in_region=None)
 
def find (image_name, region=None)
 
def find_all (what, in_region=None)
 
def wait (image_name, timeout=None, region=None)
 
def exists (pattern, timeout=None, in_region=None)
 
def wait_vanish (pattern, timeout=None, in_region=None)
 

Function Documentation

◆ create_region_from_patterns()

def iris.api.core.region.create_region_from_patterns (   top = None,
  bottom = None,
  left = None,
  right = None,
  padding_top = None,
  padding_bottom = None,
  padding_left = None,
  padding_right = None 
)
Returns a region created from combined area of one or more patterns. Argument names are just for convenience and
don't influence outcome.

:param top: Top pattern used to generate the region.
:param bottom: Bottom pattern used to generate the region.
:param left: Left pattern used to generate the region.
:param right: Right pattern used to generate the region.
:param padding_top: Padding to be added to the pattern's top.
:param padding_bottom: Padding to be added to the pattern's bottom.
:param padding_left: Padding to be added to the pattern's left.
:param padding_right: Padding to be added to the pattern's right.
:return: region created from combined area of one or more patterns.

◆ exists()

def iris.api.core.region.exists (   pattern,
  timeout = None,
  in_region = None 
)
Check if Pattern or image exists.

:param pattern: String or Pattern.
:param timeout: Number as maximum waiting time in seconds.
:param in_region: Region object in order to minimize the area.
:return: True if found.

◆ find()

def iris.api.core.region.find (   image_name,
  region = None 
)
Look for a single match of a Pattern or image.

:param image_name: String or Pattern.
:param region: Region object in order to minimize the area.
:return: Location object.

◆ find_all()

def iris.api.core.region.find_all (   what,
  in_region = None 
)
Look for multiple matches of a Pattern or image.

:param what: String or Pattern.
:param in_region: Region object in order to minimize the area.
:return: List[Location].

◆ generate_region_by_markers()

def iris.api.core.region.generate_region_by_markers (   top_left_marker_img = None,
  bottom_right_marker_img = None 
)
Generate a region starting from 2 markers.

:param top_left_marker_img: Top left pattern used to generate the region.
:param bottom_right_marker_img: Bottom right pattern used to generate the region.
:return: Screen region generated.

◆ highlight()

def iris.api.core.region.highlight (   region = None,
  seconds = None,
  color = None,
  pattern = None,
  location = None 
)
:param region: Screen region to be highlighted.
:param seconds: How many seconds the region is highlighted. By default the region is highlighted for 2 seconds.
:param color: Color used to highlight the region. Default color is red.
:param pattern: Pattern.
:param location: Location.
:return: None.

◆ hover()

def iris.api.core.region.hover (   where = None,
  duration = 0,
  in_region = None 
)
Hover over a Location, Pattern or image.

:param where: Location, Pattern or image name for hover target.
:param duration: Speed of hovering from current location to target.
:param in_region: Region object in order to minimize the area.
:return: None.

◆ text()

def iris.api.core.region.text (   image_processing,
  in_region = None,
  debug = False 
)
Get all text from a Region or full screen.

:param bool with_image_processing: With extra dpi and contrast image processing.
:param Region in_region: In certain Region or full screen.
:param debug: Boolean for saving ocr images.
:return: List of matches.

◆ wait()

def iris.api.core.region.wait (   image_name,
  timeout = None,
  region = None 
)
Wait for a Pattern or image to appear.

:param image_name: String or Pattern.
:param timeout: Number as maximum waiting time in seconds.
:param region: Region object in order to minimize the area.
:return: True if found.

◆ wait_vanish()

def iris.api.core.region.wait_vanish (   pattern,
  timeout = None,
  in_region = None 
)
Wait until a Pattern disappears.

:param pattern: Pattern.
:param timeout:  Number as maximum waiting time in seconds.
:param in_region: Region object in order to minimize the area.
:return: True if vanished.