Bug 1255955 - Scroll element into view when not visible; r=automatedtester, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 05 Aug 2016 10:53:06 +0100
changeset 349835 decf2949ae6ca51b8591e901fe7e78455b5b4d12
parent 349834 2f7f2aa1c730f74abb54271c5ba517281e8383ce
child 349836 f1da984b8731e75e13b1b523cee9f275d6276939
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1255955
milestone50.0a2
Bug 1255955 - Scroll element into view when not visible; r=automatedtester, a=test-only The if-condition in the specification compatible interactability check for interaction.clickElement is wrong. It should scroll an element into view when it is _not_ visible. If it is visible it does not matter. MozReview-Commit-ID: 2n34QddDkQv
testing/marionette/interaction.js
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -87,17 +87,17 @@ this.interaction = {};
  *     Use WebDriver specification compatible interactability definition.
  */
 interaction.clickElement = function(el, strict = false, specCompat = false) {
   let win = getWindow(el);
 
   let visible = false;
   if (specCompat) {
     visible = element.isInteractable(el);
-    if (visible) {
+    if (!visible) {
       el.scrollIntoView(false);
     }
   } else {
     visible = element.isVisible(el);
   }
 
   if (!visible) {
     throw new ElementNotVisibleError("Element is not visible");