Closed Bug 1359050 Opened 7 years ago Closed 7 years ago

Test if element is in view with pointer events enabled

Categories

(Remote Protocol :: Marionette, defect)

Version 3
defect
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(1 file)

Marionette should test that the element to be clicked is in-view with pointer-events enabled, following a recent change to the specification:

    https://github.com/w3c/webdriver/commit/ba6ee925b5bc85938d542d65ef5034a761fe73d7
Assignee: nobody → ato
Blocks: 1321516
Status: NEW → ASSIGNED
Comment on attachment 8860960 [details]
Bug 1359050 - Test element in view with pointer events enabled;

https://reviewboard.mozilla.org/r/132970/#review135968

::: testing/marionette/harness/marionette_harness/tests/unit/test_click.py:278
(Diff revision 1)
> +        button = self.marionette.find_element(By.TAG_NAME, "button")
> +        self.assertEqual("none", button.value_of_css_property("pointer-events"))
> +
> +        with self.assertRaisesRegexp(errors.ElementClickInterceptedException,
> +                                     "does not have pointer events enabled"):
> +            button.click()

I just realised this is missing a test for window.clicks.
Comment on attachment 8860960 [details]
Bug 1359050 - Test element in view with pointer events enabled;

https://reviewboard.mozilla.org/r/132970/#review136254

Looks good. One question about tests.

::: testing/marionette/element.js:900
(Diff revision 1)
> +  try {
> +    el.style.pointerEvents = "auto";
> +    const tree = element.getPointerInteractablePaintTree(el);
> -  return tree.includes(el);
> +    return tree.includes(el);
> +  } finally {
> +    el.style.pointerEvents = originalPointerEvents;
> +  }

Are any tests exercising this code path?
Attachment #8860960 - Flags: review?(mjzffr) → review+
Comment on attachment 8860960 [details]
Bug 1359050 - Test element in view with pointer events enabled;

https://reviewboard.mozilla.org/r/132970/#review136254

> Are any tests exercising this code path?

Only test_pointer_events_none in test_click.py.  test_accessibility.py also uses click on element’s with pointer-events: none, but they do not currently use element.isInView.  They will once I switch Marionette over to using the WebDriver-conforming Element Click implementation in https://bugzilla.mozilla.org/show_bug.cgi?id=1321516.
Comment on attachment 8860960 [details]
Bug 1359050 - Test element in view with pointer events enabled;

https://reviewboard.mozilla.org/r/132970/#review136254

> Only test_pointer_events_none in test_click.py.  test_accessibility.py also uses click on element’s with pointer-events: none, but they do not currently use element.isInView.  They will once I switch Marionette over to using the WebDriver-conforming Element Click implementation in https://bugzilla.mozilla.org/show_bug.cgi?id=1321516.

Okay, thumbs up.
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0280c5b6d617
Test element in view with pointer events enabled; r=maja_zf
https://hg.mozilla.org/mozilla-central/rev/0280c5b6d617
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: