waitForState minor refactor #442

Merged
bernat merged 3 commits from 2568-ticket_basic_data_e2e_fix into dev 2020-11-05 09:40:48 +00:00
1 changed files with 8 additions and 3 deletions
Showing only changes of commit b95de5d788 - Show all commits

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) {