Skip to content

Commit

Permalink
Merge branch 'master' into fixTestTimeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDr committed Apr 27, 2016
2 parents d97b4bc + 26a6e56 commit 790fb1f
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/dashboard/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dashboard-grid {
.panel-content {
display: flex;
flex: 1 1 100%;
height: auto;
height: 100%;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ body { overflow-x: hidden; }
&.hidden-chrome { left: 0; }
&-panel {
.flex-parent(@shrink: 0);
height: 100%;
box-shadow: -4px 0px 3px rgba(0,0,0,0.2);
}

Expand Down
1 change: 1 addition & 0 deletions src/ui/public/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ ul.navbar-inline li {
.flex-parent(@shrink: 0);
position: relative;
z-index: 0;
max-height: 100%;
background-color: @white;
}

Expand Down
1 change: 1 addition & 0 deletions src/ui/public/visualize/visualize.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ visualize {
overflow: auto;
-webkit-transition: opacity 0.01s;
transition: opacity 0.01s;
max-height: 100%;

&.spy-only {
display: none;
Expand Down
18 changes: 18 additions & 0 deletions test/support/pages/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ define(function (require) {
var parse = require('intern/dojo/node!url').parse;
var format = require('intern/dojo/node!url').format;
var path = require('intern/dojo/node!path');
var ShieldPage = require('../../support/pages/shield_page');

var shieldPage;

function injectTimestampQuery(func, url) {
var formatted = modifyQueryString(url, function (parsed) {
Expand Down Expand Up @@ -43,6 +46,7 @@ define(function (require) {
remote.get.wrapper = injectTimestampQuery;
this.remote.getCurrentUrl = _.wrap(this.remote.getCurrentUrl, removeTimestampQuery);
}
shieldPage = new ShieldPage(this.remote);
}


Expand Down Expand Up @@ -90,6 +94,20 @@ define(function (require) {
.then(function () {
return self.remote.getCurrentUrl();
})
.then(function (currentUrl) {
var loginPage = new RegExp('login').test(currentUrl);
if (loginPage) {
self.debug('Found loginPage = ' + loginPage + ', username = '
+ config.servers.kibana.shield.username);
return shieldPage.login(config.servers.kibana.shield.username,
config.servers.kibana.shield.password)
.then(function () {
return self.remote.getCurrentUrl();
});
} else {
return currentUrl;
}
})
.then(function (currentUrl) {
currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
var navSuccessful = new RegExp(appUrl).test(currentUrl);
Expand Down
35 changes: 35 additions & 0 deletions test/support/pages/shield_page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// in test/support/pages/shield_page.js
define(function (require) {
var config = require('intern').config;
var defaultTimeout = config.timeouts.default;

// the page object is created as a constructor
// so we can provide the remote Command object
// at runtime
function ShieldPage(remote) {
this.remote = remote;
}

ShieldPage.prototype = {
constructor: ShieldPage,

login: function login(user, pwd) {
var remote = this.remote;
return remote.setFindTimeout(5000)
.findById('username')
.type(user)
.then(function () {
return remote.findById('password')
.type(pwd);
})
.then(function () {
return remote.findByCssSelector('.btn')
.click();
});
}


};

return ShieldPage;
});

0 comments on commit 790fb1f

Please sign in to comment.