SimpleCore graphical helper extensions.

GraphicalExtensions#

class GraphicalExtensions()

Collection of graphical helper functions.

take#

@staticmethod
def take(testcase)

Take a screenshot and copy it on the host.

Arguments:

  • testcase - reference to the testcase instance

take_background#

@staticmethod
def take_background(testcase, command)

Take a screenshot when something is running and copy it on the host.

Arguments:

  • testcase - reference to the testcase instance

compare#

@staticmethod
def compare(testcase,
            image_ref,
            screenshot,
            crop=False,
            width=0,
            height=0,
            x=0,
            y=0)

Take a screenshot and compare its hash to the hash of a reference image.

Arguments:

  • image_ref - path to the reference image screenshot : name of the screenshot which is to be compared

  • crop - True if it is necessary to crop the image

  • width - width of the cropped image

  • height - height of the cropped image

  • x - abscissa of the cropped image

  • y - ordinate of the cropped image

Returns:

  • Tuple - (phash, base64 encoded screenshot)

remove#

@staticmethod
def remove(screenshot)

Remove the screenshot on the host.

Arguments:

screenshot : name of the screenshot to remove