Tweaks needed for integrating with the functional test runner (#11469)

* [git] ignore the entire root optimize directory

* [ftr] fix readConfigFile export

* [ftr/config] set default hostname and protocols for urls

* [chrome] make top-level chrome a test-subject

* [ftr/CommonPage] only auto-login when not navigating to the login page
This commit is contained in:
Spencer 2017-04-27 09:01:54 -07:00 committed by spalger
parent 7ef0f6cbfe
commit b31e4be076
6 changed files with 9 additions and 10 deletions

4
.gitignore vendored
View file

@ -5,9 +5,7 @@
.node_binaries
node_modules
trash
/optimize/bundles
/optimize/testdev
/optimize/testUiServer
/optimize
target
/build
.jruby

View file

@ -1 +1 @@
export { readConfigFile } from './create_config';
export { readConfigFile } from './read_config_file';

View file

@ -2,7 +2,7 @@ import { defaultsDeep } from 'lodash';
import { Config } from './config';
export async function readConfigFile(log, configFile, settingOverrides) {
export async function readConfigFile(log, configFile, settingOverrides = {}) {
log.debug('Loading config file from %j', configFile);
const configModule = require(configFile);

View file

@ -8,8 +8,8 @@ const ID_PATTERN = /^[a-zA-Z0-9_]+$/;
const INSPECTING = process.execArgv.includes('--inspect');
const urlPartsSchema = () => Joi.object().keys({
protocol: Joi.string().valid('http', 'https'),
hostname: Joi.string().hostname(),
protocol: Joi.string().valid('http', 'https').default('http'),
hostname: Joi.string().hostname().default('localhost'),
port: Joi.number(),
auth: Joi.string().regex(/^[^:]+:.+$/, 'username and password seperated by a colon'),
username: Joi.string(),

View file

@ -1,4 +1,4 @@
<div class="content" chrome-context >
<div class="content" chrome-context data-test-subj="kibanaChrome">
<global-nav
chrome="chrome"
is-visible="chrome.getVisible()"

View file

@ -79,8 +79,9 @@ export function CommonPageProvider({ getService, getPageObjects }) {
return remote.getCurrentUrl();
})
.then(function (currentUrl) {
const loginPage = new RegExp('login').test(currentUrl);
if (loginPage) {
const loginPage = currentUrl.includes('/login');
const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout');
if (loginPage && !wantedLoginPage) {
log.debug('Found loginPage username = '
+ config.get('servers.kibana.username'));
return PageObjects.shield.login(config.get('servers.kibana.username'),