mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
108c9aa869
commit
f28b1db903
2 changed files with 33 additions and 6 deletions
|
@ -18,18 +18,22 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const log = getService('log');
|
||||
const PageObjects = getPageObjects(['common', 'visualize']);
|
||||
let isOss = true;
|
||||
|
||||
describe('chart types', function () {
|
||||
before(function () {
|
||||
describe('chart types', function() {
|
||||
before(async function() {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new');
|
||||
isOss = await PageObjects.common.isOss();
|
||||
await PageObjects.visualize.navigateToNewVisualization();
|
||||
});
|
||||
|
||||
it('should show the correct chart types', async function () {
|
||||
it('should show the correct chart types', async function() {
|
||||
const expectedChartTypes = [
|
||||
'Area',
|
||||
'Controls',
|
||||
|
@ -50,6 +54,11 @@ export default function ({ getService, getPageObjects }) {
|
|||
'Vega',
|
||||
'Vertical Bar',
|
||||
];
|
||||
if (!isOss) {
|
||||
expectedChartTypes.push('Maps');
|
||||
expectedChartTypes.sort();
|
||||
}
|
||||
log.debug('oss= ' + isOss);
|
||||
|
||||
// find all the chart types and make sure there all there
|
||||
const chartTypes = await PageObjects.visualize.getChartTypes();
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { delay } from 'bluebird';
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
import fetch from 'node-fetch';
|
||||
import getUrl from '../../../src/test_utils/get_url';
|
||||
|
||||
export function CommonPageProvider({ getService, getPageObjects }) {
|
||||
|
@ -394,6 +394,24 @@ export function CommonPageProvider({ getService, getPageObjects }) {
|
|||
return await jsonElement.getVisibleText();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to detect an OSS licensed Kibana
|
||||
* Useful for functional testing in cloud environment
|
||||
*/
|
||||
async isOss() {
|
||||
const baseUrl = this.getEsHostPort();
|
||||
const username = config.get('servers.elasticsearch.username');
|
||||
const password = config.get('servers.elasticsearch.password');
|
||||
const response = await fetch(baseUrl + '/_xpack', {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Basic ' + Buffer.from(username + ':' + password).toString('base64')
|
||||
},
|
||||
});
|
||||
return response.status !== 200;
|
||||
}
|
||||
}
|
||||
|
||||
return new CommonPage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue