mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Migrating Dashboard TimePicker Tests To Use CCS (#130286)
* Migrated_Dashboard_TimePicker_Tests_To_Use_CCS * Added dashboard to the config file. * Flipped ccs switch conditional. * Added CCS test to its own small describe block for readability. * Added conditional for data. * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed CCS dashboard test. * Removed file that should have been removed via merge. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
3e837ca6ac
commit
605020d79c
8 changed files with 3166 additions and 17 deletions
|
@ -10,27 +10,34 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
|||
|
||||
export default function ({ getService, loadTestFile }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const config = getService('config');
|
||||
const esNode = config.get('esTestCluster.ccs')
|
||||
? getService('remoteEsArchiver' as 'esArchiver')
|
||||
: getService('esArchiver');
|
||||
|
||||
async function loadLogstash() {
|
||||
await browser.setWindowSize(1200, 900);
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esNode.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
}
|
||||
|
||||
async function unloadLogstash() {
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esNode.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
}
|
||||
|
||||
describe('dashboard app - group 3', function () {
|
||||
before(loadLogstash);
|
||||
after(unloadLogstash);
|
||||
|
||||
loadTestFile(require.resolve('./dashboard_time_picker'));
|
||||
loadTestFile(require.resolve('./bwc_shared_urls'));
|
||||
loadTestFile(require.resolve('./panel_replacing'));
|
||||
loadTestFile(require.resolve('./panel_cloning'));
|
||||
loadTestFile(require.resolve('./copy_panel_to'));
|
||||
loadTestFile(require.resolve('./panel_context_menu'));
|
||||
loadTestFile(require.resolve('./dashboard_state'));
|
||||
if (config.get('esTestCluster.ccs')) {
|
||||
loadTestFile(require.resolve('./dashboard_time_picker'));
|
||||
} else {
|
||||
loadTestFile(require.resolve('./dashboard_time_picker'));
|
||||
loadTestFile(require.resolve('./bwc_shared_urls'));
|
||||
loadTestFile(require.resolve('./panel_replacing'));
|
||||
loadTestFile(require.resolve('./panel_cloning'));
|
||||
loadTestFile(require.resolve('./copy_panel_to'));
|
||||
loadTestFile(require.resolve('./panel_context_menu'));
|
||||
loadTestFile(require.resolve('./dashboard_state'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
return {
|
||||
...baseConfig.getAll(),
|
||||
|
||||
testFiles: [require.resolve('./apps/discover')],
|
||||
testFiles: [require.resolve('./apps/dashboard/group3'), require.resolve('./apps/discover')],
|
||||
|
||||
services: {
|
||||
...baseConfig.get('services'),
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,205 @@
|
|||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".kibana": {}
|
||||
},
|
||||
"index": ".kibana_1",
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"config": {
|
||||
"dynamic": "true",
|
||||
"properties": {
|
||||
"buildNum": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dashboard": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"hits": {
|
||||
"type": "integer"
|
||||
},
|
||||
"kibanaSavedObjectMeta": {
|
||||
"properties": {
|
||||
"searchSourceJSON": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"optionsJSON": {
|
||||
"type": "text"
|
||||
},
|
||||
"panelsJSON": {
|
||||
"type": "text"
|
||||
},
|
||||
"refreshInterval": {
|
||||
"properties": {
|
||||
"display": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"pause": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"section": {
|
||||
"type": "integer"
|
||||
},
|
||||
"value": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"timeFrom": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timeRestore": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"timeTo": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"title": {
|
||||
"type": "text"
|
||||
},
|
||||
"uiStateJSON": {
|
||||
"type": "text"
|
||||
},
|
||||
"version": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"index-pattern": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"fieldFormatMap": {
|
||||
"type": "text"
|
||||
},
|
||||
"fields": {
|
||||
"type": "text"
|
||||
},
|
||||
"intervalName": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"notExpandable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"sourceFilters": {
|
||||
"type": "text"
|
||||
},
|
||||
"timeFieldName": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"title": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"columns": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"hits": {
|
||||
"type": "integer"
|
||||
},
|
||||
"kibanaSavedObjectMeta": {
|
||||
"properties": {
|
||||
"searchSourceJSON": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sort": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"title": {
|
||||
"type": "text"
|
||||
},
|
||||
"version": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"server": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"uuid": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"url": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"accessCount": {
|
||||
"type": "long"
|
||||
},
|
||||
"accessDate": {
|
||||
"type": "date"
|
||||
},
|
||||
"createDate": {
|
||||
"type": "date"
|
||||
},
|
||||
"url": {
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"ignore_above": 2048,
|
||||
"type": "keyword"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"visualization": {
|
||||
"dynamic": "strict",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"kibanaSavedObjectMeta": {
|
||||
"properties": {
|
||||
"searchSourceJSON": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"savedSearchId": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"title": {
|
||||
"type": "text"
|
||||
},
|
||||
"uiStateJSON": {
|
||||
"type": "text"
|
||||
},
|
||||
"version": {
|
||||
"type": "integer"
|
||||
},
|
||||
"visState": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"number_of_replicas": "1",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -26,12 +26,12 @@ interface SaveDashboardOptions {
|
|||
}
|
||||
|
||||
export class DashboardPageObject extends FtrService {
|
||||
private readonly config = this.ctx.getService('config');
|
||||
private readonly log = this.ctx.getService('log');
|
||||
private readonly find = this.ctx.getService('find');
|
||||
private readonly retry = this.ctx.getService('retry');
|
||||
private readonly browser = this.ctx.getService('browser');
|
||||
private readonly globalNav = this.ctx.getService('globalNav');
|
||||
private readonly esArchiver = this.ctx.getService('esArchiver');
|
||||
private readonly kibanaServer = this.ctx.getService('kibanaServer');
|
||||
private readonly testSubjects = this.ctx.getService('testSubjects');
|
||||
private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel');
|
||||
|
@ -39,16 +39,24 @@ export class DashboardPageObject extends FtrService {
|
|||
private readonly listingTable = this.ctx.getService('listingTable');
|
||||
private readonly elasticChart = this.ctx.getService('elasticChart');
|
||||
private readonly common = this.ctx.getPageObject('common');
|
||||
private readonly esArchiver = this.ctx.getService('esArchiver');
|
||||
private readonly header = this.ctx.getPageObject('header');
|
||||
private readonly visualize = this.ctx.getPageObject('visualize');
|
||||
private readonly discover = this.ctx.getPageObject('discover');
|
||||
private readonly logstashIndex = this.config.get('esTestCluster.ccs')
|
||||
? 'ftr-remote:logstash-*'
|
||||
: 'logstash-*';
|
||||
private readonly kibanaIndex = this.config.get('esTestCluster.ccs')
|
||||
? 'test/functional/fixtures/kbn_archiver/ccs/dashboard/legacy/legacy.json'
|
||||
: 'test/functional/fixtures/es_archiver/dashboard/legacy';
|
||||
|
||||
async initTests({
|
||||
kibanaIndex = 'test/functional/fixtures/es_archiver/dashboard/legacy',
|
||||
defaultIndex = 'logstash-*',
|
||||
} = {}) {
|
||||
async initTests({ kibanaIndex = this.kibanaIndex, defaultIndex = this.logstashIndex } = {}) {
|
||||
this.log.debug('load kibana index with visualizations and log data');
|
||||
await this.esArchiver.load(kibanaIndex);
|
||||
if (this.config.get('esTestCluster.ccs')) {
|
||||
await this.kibanaServer.importExport.load(kibanaIndex);
|
||||
} else {
|
||||
await this.esArchiver.loadIfNeeded(kibanaIndex);
|
||||
}
|
||||
await this.kibanaServer.uiSettings.replace({ defaultIndex });
|
||||
await this.common.navigateToApp('dashboard');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue