Bug 1432864 - Run unfocussing steps after interaction. r=automatedtester
authorAndreas Tolfsen <ato@sny.no>
Thu, 01 Feb 2018 09:04:00 +0200
changeset 454623 cc6e54bee19e7153ae5ac6cc7887805f001c2470
parent 454622 feae5d29e679fb637a0ca44800464fee9f1bc91f
child 454624 11887cd21e75fcb2a1dd94ad7bd49d81a2acbfe3
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1432864
milestone59.0
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") &&