Commit 895f6b68 authored by Andreas Tolfsen's avatar Andreas Tolfsen
Browse files

Bug 1387447 - Update accessibility pointer-events expectations. r=yzen

With a WebDriver-conforming Element Click implementation, the element
click intercepted error is returned when an element with pointer-events:
"none" causes the click to hit the underlying element.

This patch does not functionally change anything yet about the
accessibility tests, but splits disabled_accessibility_elementIDs into
two lists, aria_disabled_elements and pointer_events_none_elements, in
anticipation of moving Marionette to use a different click implementation.

In the future, the ARIA tests will fail with "element not accessible"
errors as they do now, but the pointer-events tests will fail with
"element click intercepted" instead.

MozReview-Commit-ID: Ks1hyUVyLK7

--HG--
extra : rebase_source : 20dbcc228955626cd2d1617aa055f29f4e5928a4
parent bd4cea63
Loading
Loading
Loading
Loading
+28 −9
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ import unittest
from marionette_driver.by import By
from marionette_driver.errors import (
    ElementNotAccessibleException,
    ElementNotInteractableException
    ElementNotInteractableException,
    ElementClickInterceptedException,
)

from marionette_harness import MarionetteTestCase
@@ -82,8 +83,15 @@ class TestAccessibility(MarionetteTestCase):

    disabled_elementIDs = ["button11", "no_accessible_but_disabled"]

    # Elements that are enabled but otherwise disabled or not explorable via the accessibility API
    disabled_accessibility_elementIDs = ["button12", "button15", "button16"]
    # Elements that are enabled but otherwise disabled or not explorable
    # via the accessibility API
    aria_disabled_elementIDs = ["button12"]

    # pointer-events: "none", which will return
    # ElementClickInterceptedException if clicked
    # when Marionette switches
    # to using WebDriver conforming interaction
    pointer_events_none_elementIDs = ["button15", "button16"]

    # Elements that are reporting selected state
    valid_option_elementIDs = ["option1", "option2"]
@@ -167,20 +175,31 @@ class TestAccessibility(MarionetteTestCase):
    def test_element_is_not_enabled_to_accessbility(self):
        self.setup_accessibility()
        # Buttons are enabled but disabled/not-explorable via the accessibility API
        self.run_element_test(self.disabled_accessibility_elementIDs,
        self.run_element_test(self.aria_disabled_elementIDs,
                              lambda element: self.assertRaises(ElementNotAccessibleException,
                                                                element.is_enabled))
        self.run_element_test(self.pointer_events_none_elementIDs,
                              lambda element: self.assertRaises(ElementNotAccessibleException,
                                                                element.is_enabled))

        # Buttons are enabled but disabled/not-explorable via the accessibility API and thus are not
        # clickable via the accessibility API
        self.run_element_test(self.disabled_accessibility_elementIDs,
        # Buttons are enabled but disabled/not-explorable via
        # the accessibility API and thus are not clickable via the
        # accessibility API.
        self.run_element_test(self.aria_disabled_elementIDs,
                              lambda element: self.assertRaises(ElementNotAccessibleException,
                                                                element.click))
        self.run_element_test(self.pointer_events_none_elementIDs,
                              lambda element: self.assertRaises(ElementNotAccessibleException,
                                                                element.click))

        self.setup_accessibility(False, False)
        self.run_element_test(self.disabled_accessibility_elementIDs,
        self.run_element_test(self.aria_disabled_elementIDs,
                              lambda element: element.is_enabled())
        self.run_element_test(self.pointer_events_none_elementIDs,
                              lambda element: element.is_enabled())
        self.run_element_test(self.disabled_accessibility_elementIDs,
        self.run_element_test(self.aria_disabled_elementIDs,
                              lambda element: element.click())
        self.run_element_test(self.pointer_events_none_elementIDs,
                              lambda element: element.click())

    def test_element_is_enabled_to_accessibility(self):