Checks a particular region of the checkpoint image.
value = eyes.check_region(image, region, tag, ignore_mismatch) value = eyes.check_region(image, region, tag) value = eyes.check_region(image, region)
- Either a string that is a path to a file image, or an object of the Image class from the PIL Image module.
- A non-empty region representing the screen region to check in screenshot pixel coordinates.
- Type:Text [Optional : default = None ]
The tag defines a name for the checkpoint in the Eyes Test Manager. The name may be any string and serves to identify the step to the user in the Test manager. You may change the tag value without impacting testing in any way since Eyes does not use the tag to identify the baseline step that corresponds to the checkpoint - Eyes matches steps based on their content and position in the sequences of images of the test. See How Eyes compares checkpoints and baseline images for details.
- Type:bool [Optional : default = False ]
- This parameter is used to implement retry of a checkpoint. If you are not implementing retry, then don't pass this parameter or pass a value of False. To implement retry, on all retry attempts apart from the last, pass this parameter a value of True. When the method returns, check the return value. A returned value of True means that the checkpoint passed, and you can continue with the next checkpoint. A returned value of False means that that the checkpoint did not match. Since this parameter was passed as True, Eyes will not store the outcome of this checkpoint and will expect that the next image sent is for the current step (i.e. is being retried). On the last retry attempt, pass a value of False. This way, Eyes knows that there will be no more retries, and it will store the results of the last check as the result of the current step. The next checkpoint sent will be treated as the next step. Note that since Eyes allows for new or deleted steps, once there is a mismatch for one step, all subsequent steps will also return a mismatch, and Eyes determines the actual match/mismatch/new/missing status of all the steps when the test is closed.
- Type: bool
- A return value of True indicates that the checkpoint matched, or is a new checkpoint. The meaning of a return value of False depends on whether this is the first checkpoint to return this value or not. For the first checkpoint that returns a value of False, the implication is that there was a mismatch. The test may choose to recapture the image and resend it (when using a check that supports this feature). Once one checkpoint has returned False, all the following checkpoints will also return False. This does not mean that the checkpoint mismatched; it means that Eyes will only know the final status of the checkpoint at the end of the test. If required, the actual result of the checkpoint should be obtained from the StepInfo object in the TestResults returned by the close method.