Migrating test/new_visualize_flow/fixtures/es_archiver/kibana to kbnArchiver (#136768)

This commit is contained in:
Bhavya RM 2022-07-26 11:59:25 -04:00 committed by GitHub
parent 0523cd2019
commit 004cfbb227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 4971 deletions

View file

@ -98,7 +98,6 @@ enabled:
- test/interactive_setup_functional/manual_configuration_without_tls.config.ts
- test/interactive_setup_functional/manual_configuration.config.ts
- test/interpreter_functional/config.ts
- test/new_visualize_flow/config.ts
- test/node_roles_functional/all.config.ts
- test/node_roles_functional/background_tasks.config.ts
- test/node_roles_functional/ui.config.ts

View file

@ -19,6 +19,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel');
const testSubjects = getService('testSubjects');
const dashboardVisualizations = getService('dashboardVisualizations');
const dashboardExpect = getService('dashboardExpect');
describe('create and add embeddables', () => {
before(async () => {
@ -191,6 +193,36 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.clickDashboard();
});
});
describe('adds metric and markdown by value to a new dashboard', () => {
before(async () => {
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.preserveCrossAppState();
await PageObjects.dashboard.clickNewDashboard();
});
it('adding a metric visualization', async function () {
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
expect(originalPanelCount).to.eql(0);
await dashboardVisualizations.createAndEmbedMetric('Embedding Vis Test');
await PageObjects.dashboard.waitForRenderComplete();
await dashboardExpect.metricValuesExist(['0']);
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.eql(1);
});
it('adding a markdown', async function () {
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
expect(originalPanelCount).to.eql(1);
await dashboardVisualizations.createAndEmbedMarkdown({
name: 'Embedding Markdown Test',
markdown: 'Nice to meet you, markdown is my name',
});
await PageObjects.dashboard.waitForRenderComplete();
await dashboardExpect.markdownWithValuesExists(['Nice to meet you, markdown is my name']);
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.eql(2);
});
});
});
});
}

View file

@ -1,143 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const commonConfig = await readConfigFile(require.resolve('../functional/config.base.js'));
return {
testFiles: [require.resolve('./index.ts')],
pageObjects: commonConfig.get('pageObjects'),
services: commonConfig.get('services'),
servers: commonConfig.get('servers'),
esTestCluster: commonConfig.get('esTestCluster'),
kbnTestServer: {
...commonConfig.get('kbnTestServer'),
serverArgs: [
...commonConfig.get('kbnTestServer.serverArgs'),
'--telemetry.optIn=false',
'--dashboard.allowByValueEmbeddables=true',
],
},
uiSettings: {
defaults: {
'accessibility:disableAnimations': true,
'dateFormat:tz': 'UTC',
},
},
apps: {
kibana: {
pathname: '/app/kibana',
},
status_page: {
pathname: '/status',
},
discover: {
pathname: '/app/discover',
hash: '/',
},
context: {
pathname: '/app/discover',
hash: '/context',
},
visualize: {
pathname: '/app/visualize',
hash: '/',
},
dashboard: {
pathname: '/app/dashboards',
hash: '/list',
},
management: {
pathname: '/app/management',
},
console: {
pathname: '/app/dev_tools',
hash: '/console',
},
home: {
pathname: '/app/home',
hash: '/',
},
},
junit: {
reportName: 'Chrome UI Functional Tests',
},
browser: {
type: 'chrome',
},
security: {
roles: {
test_logstash_reader: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['logstash*'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
// for sample data - can remove but not add sample data
kibana_sample_admin: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['kibana_sample*'],
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
long_window_logstash: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['long-window-logstash-*'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
animals: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['animals-*'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},
},
defaultRoles: ['kibana_admin'],
},
};
}

View file

@ -1,69 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../functional/ftr_provider_context';
/**
* This tests both that one of each visualization can be added to a dashboard (as opposed to opening an existing
* dashboard with the visualizations already on it), as well as conducts a rough type of snapshot testing by checking
* for various ui components. The downside is these tests are a bit fragile to css changes (though not as fragile as
* actual screenshot snapshot regression testing), and can be difficult to diagnose failures (which visualization
* broke?). The upside is that this offers very good coverage with a minimal time investment.
*/
// eslint-disable-next-line import/no-default-export
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const dashboardExpect = getService('dashboardExpect');
const dashboardVisualizations = getService('dashboardVisualizations');
const PageObjects = getPageObjects([
'common',
'dashboard',
'header',
'visualize',
'discover',
'timePicker',
]);
describe('Dashboard Embedding', function describeIndexTests() {
before(async () => {
await esArchiver.load('test/new_visualize_flow/fixtures/es_archiver/kibana');
await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
});
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.preserveCrossAppState();
await PageObjects.dashboard.clickNewDashboard();
});
it('adding a metric visualization', async function () {
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
expect(originalPanelCount).to.eql(0);
await dashboardVisualizations.createAndEmbedMetric('Embedding Vis Test');
await PageObjects.dashboard.waitForRenderComplete();
await dashboardExpect.metricValuesExist(['0']);
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.eql(1);
});
it('adding a markdown', async function () {
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
expect(originalPanelCount).to.eql(1);
await dashboardVisualizations.createAndEmbedMarkdown({
name: 'Embedding Markdown Test',
markdown: 'Nice to meet you, markdown is my name',
});
await PageObjects.dashboard.waitForRenderComplete();
await dashboardExpect.markdownWithValuesExists(['Nice to meet you, markdown is my name']);
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.eql(2);
});
});
}

File diff suppressed because one or more lines are too long

View file

@ -1,448 +0,0 @@
{
"type": "index",
"value": {
"aliases": {
".kibana": {
}
},
"index": ".kibana_1",
"mappings": {
"_meta": {
"migrationMappingPropertyHashes": {
"application_usage_totals": "c897e4310c5f24b07caaff3db53ae2c1",
"application_usage_transactional": "965839e75f809fefe04f92dc4d99722a",
"config": "ae24d22d5986d04124cc6568f771066f",
"dashboard": "d00f614b29a80360e1190193fd333bab",
"index-pattern": "66eccb05066c5a89924f48a9e9736499",
"kql-telemetry": "d12a98a6f19a2d273696597547e064ee",
"migrationVersion": "4a1746014a75ade3a714e1db5763276f",
"namespace": "2f4316de49999235636386fe51dc06c1",
"namespaces": "2f4316de49999235636386fe51dc06c1",
"query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9",
"references": "7997cf5a56cc02bdc9c93361bde732b0",
"sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4",
"search": "181661168bbadd1eff5902361e2a0d5c",
"telemetry": "36a616f7026dfa617d6655df850fe16d",
"tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215",
"type": "2f4316de49999235636386fe51dc06c1",
"ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3",
"updated_at": "00da57df13e94e9d98437d13ace4bfe0",
"url": "b675c3be8d76ecf029294d51dc7ec65d",
"visualization": "52d7a13ad68a150c4525b292d23e12cc"
}
},
"dynamic": "strict",
"properties": {
"application_usage_totals": {
"properties": {
"appId": {
"type": "keyword"
},
"minutesOnScreen": {
"type": "float"
},
"numberOfClicks": {
"type": "long"
}
}
},
"application_usage_transactional": {
"properties": {
"appId": {
"type": "keyword"
},
"minutesOnScreen": {
"type": "float"
},
"numberOfClicks": {
"type": "long"
},
"timestamp": {
"type": "date"
}
}
},
"config": {
"dynamic": "true",
"properties": {
"accessibility:disableAnimations": {
"type": "boolean"
},
"buildNum": {
"type": "keyword"
},
"dateFormat:tz": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"defaultIndex": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"notifications:lifetime:banner": {
"type": "long"
},
"notifications:lifetime:error": {
"type": "long"
},
"notifications:lifetime:info": {
"type": "long"
},
"notifications:lifetime:warning": {
"type": "long"
},
"xPackMonitoring:showBanner": {
"type": "boolean"
}
}
},
"dashboard": {
"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"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
},
"typeMeta": {
"type": "keyword"
}
}
},
"kql-telemetry": {
"properties": {
"optInCount": {
"type": "long"
},
"optOutCount": {
"type": "long"
}
}
},
"migrationVersion": {
"dynamic": "true",
"properties": {
"dashboard": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"index-pattern": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"search": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"visualization": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"namespace": {
"type": "keyword"
},
"namespaces": {
"type": "keyword"
},
"query": {
"properties": {
"description": {
"type": "text"
},
"filters": {
"enabled": false,
"type": "object"
},
"query": {
"properties": {
"language": {
"type": "keyword"
},
"query": {
"index": false,
"type": "keyword"
}
}
},
"timefilter": {
"enabled": false,
"type": "object"
},
"title": {
"type": "text"
}
}
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"sample-data-telemetry": {
"properties": {
"installCount": {
"type": "long"
},
"unInstallCount": {
"type": "long"
}
}
},
"search": {
"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": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"telemetry": {
"properties": {
"allowChangingOptInStatus": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"lastReported": {
"type": "date"
},
"lastVersionChecked": {
"type": "keyword"
},
"reportFailureCount": {
"type": "integer"
},
"reportFailureVersion": {
"type": "keyword"
},
"sendUsageFrom": {
"type": "keyword"
},
"userHasSeenNotice": {
"type": "boolean"
}
}
},
"tsvb-validation-telemetry": {
"properties": {
"failedRequests": {
"type": "long"
}
}
},
"type": {
"type": "keyword"
},
"ui-metric": {
"properties": {
"count": {
"type": "integer"
}
}
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchRefName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}

View file

@ -1,23 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrProviderContext } from '../functional/ftr_provider_context';
// eslint-disable-next-line import/no-default-export
export default function ({ loadTestFile, getService }: FtrProviderContext) {
describe('New Visualize Flow', function () {
const esArchiver = getService('esArchiver');
before(async () => {
await esArchiver.loadIfNeeded(
'test/new_visualize_flow/fixtures/es_archiver/logstash_functional'
);
});
loadTestFile(require.resolve('./dashboard_embedding'));
});
}