updating tests to not depend on angular.scope()

This commit is contained in:
ppisljar 2016-10-03 11:39:29 +02:00
parent d1c6ce47ad
commit 4f83b21a85

View file

@ -110,21 +110,6 @@ export default class Common {
self.debug('returned from get, calling refresh');
return self.remote.refresh();
})
.then(function () {
self.debug('check testStatusPage');
if (testStatusPage !== false) {
self.debug('self.checkForKibanaApp()');
return self.checkForKibanaApp()
.then(function (kibanaLoaded) {
self.debug('kibanaLoaded = ' + kibanaLoaded);
if (!kibanaLoaded) {
var msg = 'Kibana is not loaded, retrying';
self.debug(msg);
throw new Error(msg);
}
});
}
})
.then(function () {
return self.remote.getCurrentUrl();
})
@ -216,37 +201,6 @@ export default class Common {
});
}
getApp() {
var self = this;
return self.remote.setFindTimeout(defaultFindTimeout)
.findByCssSelector('.app-wrapper .application')
.then(function () {
return self.runScript(function () {
var $ = window.$;
var $scope = $('.app-wrapper .application').scope();
return $scope ? $scope.chrome.getApp() : {};
});
});
}
checkForKibanaApp() {
var self = this;
return self.getApp()
.then(function (app) {
var appId = app.id;
self.debug('current application: ' + appId);
return appId === 'kibana';
})
.catch(function (err) {
self.debug('kibana check failed');
self.debug(err);
// not on the kibana app...
return false;
});
}
tryForTime(timeout, block) {
return Try.tryForTime(timeout, block);
}