示例#1
0
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),
            },
        ],
    )
示例#2
0
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()