Skip to content

Commit

Permalink
Bug 1255955 -Run element enabled check before accessibility checks; r…
Browse files Browse the repository at this point in the history
…=automatedtester

MozReview-Commit-ID: 18OtOKtox3K

--HG--
extra : rebase_source : 2773dbd04f7a728b6b9fcd5db8e57b8abc28abcc
  • Loading branch information
andreastt committed Aug 13, 2016
1 parent 50d1d83 commit cf5f341
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions testing/marionette/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,25 @@ interaction.clickElement = function*(el, strict = false, specCompat = false) {
visibilityCheckEl = interaction.getSelectForOptionElement(el);
}

let visible = false;
let interactable = false;
if (specCompat) {
if (!element.isInteractable(visibilityCheckEl)) {
el.scrollIntoView(false);
}
visible = element.isInteractable(visibilityCheckEl);
interactable = element.isInteractable(visibilityCheckEl);
} else {
visible = element.isVisible(visibilityCheckEl);
interactable = element.isVisible(visibilityCheckEl);
}
if (!interactable) {
throw new ElementNotVisibleError();
}

if (!visible) {
throw new ElementNotVisibleError("Element not visible");
if (!atom.isElementEnabled(el)) {
throw new InvalidElementStateError("Element is not enabled");
}

yield a11y.getAccessible(el, true).then(acc => {
a11y.assertVisible(acc, el, visible);
if (!atom.isElementEnabled(el)) {
throw new InvalidElementStateError("Element is not enabled");
}
a11y.assertVisible(acc, el, interactable);
a11y.assertEnabled(acc, el, true);
a11y.assertActionable(acc, el);
});
Expand Down

0 comments on commit cf5f341

Please sign in to comment.