def test_check_image_fluent_accessibility(eyes): (eyes.configure.set_accessibility_validation( AccessibilitySettings(AccessibilityLevel.AA, AccessibilityGuidelinesVersion.WCAG_2_1))) eyes.open("images", "TestCheckImage_Fluent_Accessibility") eyes.check( "TestCheckImage_Fluent", Target.image(path.join(here, "resources/minions-800x500.jpg")).accessibility( Region(10, 25, 200, 100), AccessibilityRegionType.GraphicalObject), ) test_result = eyes.close(False) check_image_match_settings( eyes, test_result, [ { "actual_name": "accessibility", "expected": [ AccessibilityRegion( 10, 25, 200, 100, AccessibilityRegionType.GraphicalObject) ], }, { "actual_name": "accessibilitySettings", "expected": AccessibilitySettings(AccessibilityLevel.AA, AccessibilityGuidelinesVersion.WCAG_2_1), }, ], )
def test_check_raw_image_delete_result(eyes): # type: (Eyes) -> None eyes.open("images", "TestCheckImage_DeleteResult") origin_image = Image.new("RGBA", (600, 600)) eyes.check("TestCheckImage_Fluent", Target.image(origin_image)) result = eyes.close(False) result.delete()
def test_check_image_path_fluent(eyes): eyes.open("images", "TestCheckImage_Fluent") eyes.check( "TestCheckImage_Fluent", Target.image(path.join(here, "resources/minions-800x500.jpg")), ) eyes.close()
def test_check_image_with_ignore_region_fluent(eyes): eyes.open("images", "TestCheckImageWithIgnoreRegion_Fluent") eyes.check( "TestCheckImage_WithIgnoreRegion_Fluent", Target.image(path.join(here, "resources/minions-800x500.jpg")).ignore( Region(10, 20, 30, 40)), ) eyes.close()
def test_check_raw_image_fluent_must_fail(eyes): eyes.open("images", "TestCheckImage_Fluent") origin_image = Image.new("RGBA", (600, 600)) draw = ImageDraw.Draw(origin_image) draw.rectangle(((0, 00), (500, 100)), fill="white") eyes.check("TestCheckImage_Fluent", Target.image(origin_image)) with pytest.raises(Exception): eyes.close()
def test_check_image_fluent_cut_provider(eyes): eyes.open("images", "TestCheckImage_Fluent_CutProvider") eyes.cut_provider = UnscaledFixedCutProvider(200, 100, 100, 50) eyes.check( "TestCheckImage_Fluent", Target.image(path.join(here, "resources/minions-800x500.jpg")), ) eyes.close()
def test_check_raw_image_fluent(eyes): # type: (Eyes) -> None eyes.open("images", "TestCheckImage_Fluent") origin_image = Image.new("RGBA", (600, 600)) eyes.check("TestCheckImage_Fluent", Target.image(origin_image)) eyes.close()
def test_check_raw_image_fluent(eyes): eyes.open("images", "TestCheckImage_Fluent") eyes.check("TestCheckImage_Fluent", Target().image(Image.new("RGBA", (600, 600)))) eyes.close()