def test_wait_template(region_and_template): _, template = region_and_template library = Images() library.take_screenshot = lambda: to_image(IMAGES / "source.png") library.matcher = TemplateMatcher(opencv=True) matches = library.wait_template_on_screen(IMAGES / template, timeout=0.52) assert len(matches) == 1
def test_screenshot_region_and_find_it(): library = Images() region = Region(0, 0, 100, 100) first_capture = library.take_screenshot(region=region) find_result = library.find_template_on_screen(first_capture) assert region == find_result[0]