Bug 1432864 - Run unfocussing steps after interaction. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Wed, 24 Jan 2018 19:07:18 +0000
changeset 737946 806a0eb4d34af6868e9b83556060b4bb892c5129
parent 737945 86d6c2cff3948faf38da491ebbdacf14967d92d8
child 737947 5c66c27a0c6f7be09e7425de32334bb9f56d5d9f
child 737948 508de68a15d798f3f7c941a22e73a38254f59ec3
push id96803
push userbmo:ato@sny.no
push dateThu, 25 Jan 2018 12:02:16 +0000
reviewersautomatedtester
bugs1432864
milestone60.0a1
Bug 1432864 - Run unfocussing steps after interaction. r?automatedtester A couple of commands were not running the appropriate unfocussing steps as the WebDriver standards says they should. MozReview-Commit-ID: FyuRvkct19m
testing/marionette/interaction.js
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -282,16 +282,17 @@ interaction.selectOption = function(el) 
       el.selected = true;
     }
     event.input(containerEl);
     event.change(containerEl);
   }
 
   event.mouseup(containerEl);
   event.click(containerEl);
+  containerEl.blur();
 };
 
 /**
  * Clears the form control or the editable element, if required.
  *
  * Before clearing the element, it will attempt to scroll it into
  * view if it is not already in the viewport.  An error is raised
  * if the element cannot be brought into view.
@@ -493,16 +494,17 @@ interaction.uploadFile = async function(
   event.mousedown(el);
   el.focus();
   event.mouseup(el);
   event.click(el);
 
   el.mozSetFileArray(fs);
 
   event.change(el);
+  el.blur();
 };
 
 /**
  * Sets a form element's value.
  *
  * @param {DOMElement} el
  *     An form element, e.g. input, textarea, etc.
  * @param {string} value
@@ -569,16 +571,18 @@ async function webdriverSendKeysToElemen
   if (el.type == "file") {
     await interaction.uploadFile(el, value);
   } else if ((el.type == "date" || el.type == "time") &&
       Preferences.get("dom.forms.datetime")) {
     interaction.setFormControlValue(el, value);
   } else {
     event.sendKeysToElement(value, el, win);
   }
+
+  el.blur();
 }
 
 async function legacySendKeysToElement(el, value, a11y) {
   const win = getWindow(el);
 
   if (el.type == "file") {
     await interaction.uploadFile(el, value);
   } else if ((el.type == "date" || el.type == "time") &&