Skip to content

Commit

Permalink
Tweaks needed for integrating with the functional test runner (#11469)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
spalger committed Apr 27, 2017
1 parent 73f2ff5 commit 36ccbc1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
.node_binaries
node_modules
trash
/optimize/bundles
/optimize/testdev
/optimize/testUiServer
/optimize
target
/build
.jruby
Expand Down
2 changes: 1 addition & 1 deletion src/functional_test_runner/lib/config/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { readConfigFile } from './create_config';
export { readConfigFile } from './read_config_file';
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/functional_test_runner/lib/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/chrome/directives/kbn_chrome.html
Original file line number Diff line number Diff line change
@@ -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()"
Expand Down
5 changes: 3 additions & 2 deletions test/functional/page_objects/common_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 36ccbc1

Please sign in to comment.