MDL-67728 behat: Improve behat app selectors
parent
39d10d142e
commit
1f04f85599
|
@ -72,7 +72,7 @@
|
|||
if (window.M.util.pending_js.length === 1) {
|
||||
runAfterEverything(function() {
|
||||
// Check there isn't a spinner...
|
||||
updateSpinner();
|
||||
checkUIBlocked();
|
||||
|
||||
// Only remove it if the pending array is STILL empty after all that.
|
||||
if (window.M.util.pending_js.length === 1) {
|
||||
|
@ -109,23 +109,23 @@
|
|||
return realOpen.apply(this, arguments);
|
||||
};
|
||||
|
||||
var waitingSpinner = false;
|
||||
var waitingBlocked = false;
|
||||
|
||||
/**
|
||||
* Checks if a loading spinner is present and visible; if so, adds it to the pending array
|
||||
* (and if not, removes it).
|
||||
*/
|
||||
var updateSpinner = function() {
|
||||
var spinner = document.querySelector('span.core-loading-spinner');
|
||||
if (spinner && spinner.offsetParent) {
|
||||
if (!waitingSpinner) {
|
||||
addPending('spinner');
|
||||
waitingSpinner = true;
|
||||
var checkUIBlocked = function() {
|
||||
var blocked = document.querySelector('span.core-loading-spinner, ion-loading, .click-block-active');
|
||||
if (blocked && blocked.offsetParent) {
|
||||
if (!waitingBlocked) {
|
||||
addPending('blocked');
|
||||
waitingBlocked = true;
|
||||
}
|
||||
} else {
|
||||
if (waitingSpinner) {
|
||||
removePending('spinner');
|
||||
waitingSpinner = false;
|
||||
if (waitingBlocked) {
|
||||
removePending('blocked');
|
||||
waitingBlocked = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -167,7 +167,7 @@
|
|||
setTimeout(pollRecentMutation, 500);
|
||||
}
|
||||
// Also update the spinner presence if needed.
|
||||
updateSpinner();
|
||||
checkUIBlocked();
|
||||
};
|
||||
|
||||
// Set listener using the mutation callback.
|
||||
|
@ -182,7 +182,9 @@
|
|||
* @param {function} process Callback function that handles each matched node
|
||||
*/
|
||||
var findPossibleMatches = function(xpath, process) {
|
||||
var matches = document.evaluate(xpath, document);
|
||||
var select = 'ion-alert, ion-popover, ion-action-sheet, core-ion-tab.show-tab ion-page.show-page, ion-page.show-page, html';
|
||||
var parent = document.querySelector(select);
|
||||
var matches = document.evaluate(xpath, parent || document);
|
||||
while (true) {
|
||||
var match = matches.iterateNext();
|
||||
if (!match) {
|
||||
|
|
Loading…
Reference in New Issue