Files
awx/awx/ui/test/e2e/commands/findThenClick.js
2019-01-14 19:18:47 -05:00

17 lines
551 B
JavaScript

const spinny = "//*[contains(@class, 'spinny')]";
/* Utility function for clicking elements; attempts to scroll to
* the element if necessary, and waits for the page to finish loading.
*
* @param selector - xpath of the element to click. */
exports.command = function findThenClick (selector) {
this.waitForElementPresent(selector, () => {
this.moveToElement(selector, 0, 0, () => {
this.click(selector, () => {
this.waitForElementNotVisible(spinny);
});
});
});
return this;
};