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
--- 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") &&