waitForState minor refactor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-11-02 17:42:46 +01:00
parent 65f4a432aa
commit b95de5d788
1 changed files with 8 additions and 3 deletions

View File

@ -123,15 +123,20 @@ let actions = {
}, },
waitForState: async function(state) { waitForState: async function(state) {
await this.waitFor(state => { await this.waitForFunction(state => {
let $state = angular.element(document.body).injector().get('$state'); let $state = angular.element(document.body).injector().get('$state');
return !$state.transition && $state.is(state); return !$state.transition && $state.is(state);
}, {}, state); }, {}, state);
await this.waitForFunction(() => {
return angular.element(() => {
return true;
});
});
await this.waitForSpinnerLoad(); await this.waitForSpinnerLoad();
}, },
waitForTransition: async function() { waitForTransition: async function() {
await this.waitFor(() => { await this.waitForFunction(() => {
const $state = angular.element(document.body).injector().get('$state'); const $state = angular.element(document.body).injector().get('$state');
return !$state.transition; return !$state.transition;
}); });
@ -522,7 +527,7 @@ let actions = {
}, },
waitForSpinnerLoad: async function() { waitForSpinnerLoad: async function() {
await this.waitFor('vn-topbar vn-spinner', {hidden: true}); await this.waitForSelector('vn-topbar vn-spinner', {hidden: true});
}, },
waitForWatcherData: async function(selector) { waitForWatcherData: async function(selector) {