diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 0a3a3b04f9ff8..6cf9b9ca9d794 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -101,7 +101,11 @@ enabled: - test/functional/apps/bundles/config.ts - test/functional/apps/console/config.ts - test/functional/apps/context/config.ts - - test/functional/apps/dashboard_elements/config.ts + - test/functional/apps/dashboard_elements/controls/common/config.ts + - test/functional/apps/dashboard_elements/controls/options_list/config.ts + - test/functional/apps/dashboard_elements/image_embeddable/config.ts + - test/functional/apps/dashboard_elements/input_control_vis/config.ts + - test/functional/apps/dashboard_elements/markdown/config.ts - test/functional/apps/dashboard/group1/config.ts - test/functional/apps/dashboard/group2/config.ts - test/functional/apps/dashboard/group3/config.ts diff --git a/test/functional/apps/dashboard_elements/config.ts b/test/functional/apps/dashboard_elements/controls/common/config.ts similarity index 85% rename from test/functional/apps/dashboard_elements/config.ts rename to test/functional/apps/dashboard_elements/controls/common/config.ts index e487d31dcb657..60497ce2dae41 100644 --- a/test/functional/apps/dashboard_elements/config.ts +++ b/test/functional/apps/dashboard_elements/controls/common/config.ts @@ -9,10 +9,13 @@ import { FtrConfigProviderContext } from '@kbn/test'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../config.base.js')); + const functionalConfig = await readConfigFile(require.resolve('../../../../config.base.js')); return { ...functionalConfig.getAll(), testFiles: [require.resolve('.')], + junit: { + reportName: 'Dashboard Elements - Controls tests', + }, }; } diff --git a/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts similarity index 99% rename from test/functional/apps/dashboard_elements/controls/control_group_chaining.ts rename to test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts index 3f0efe4670891..55d4e160a2e9c 100644 --- a/test/functional/apps/dashboard_elements/controls/control_group_chaining.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_chaining.ts @@ -11,8 +11,8 @@ import { pick } from 'lodash'; import expect from '@kbn/expect'; import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common'; -import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../page_objects/dashboard_page_controls'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../../page_objects/dashboard_page_controls'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard_elements/controls/control_group_settings.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts similarity index 98% rename from test/functional/apps/dashboard_elements/controls/control_group_settings.ts rename to test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts index dfb2d6c3ff677..e07d335236f79 100644 --- a/test/functional/apps/dashboard_elements/controls/control_group_settings.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_settings.ts @@ -9,7 +9,7 @@ import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); diff --git a/test/functional/apps/dashboard_elements/controls/index.ts b/test/functional/apps/dashboard_elements/controls/common/index.ts similarity index 94% rename from test/functional/apps/dashboard_elements/controls/index.ts rename to test/functional/apps/dashboard_elements/controls/common/index.ts index d3626934a6f37..99bd616de4607 100644 --- a/test/functional/apps/dashboard_elements/controls/index.ts +++ b/test/functional/apps/dashboard_elements/controls/common/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); @@ -47,7 +47,6 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid before(setup); after(teardown); loadTestFile(require.resolve('./control_group_settings')); - loadTestFile(require.resolve('./options_list')); loadTestFile(require.resolve('./range_slider')); loadTestFile(require.resolve('./time_slider')); loadTestFile(require.resolve('./control_group_chaining')); diff --git a/test/functional/apps/dashboard_elements/controls/range_slider.ts b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts similarity index 99% rename from test/functional/apps/dashboard_elements/controls/range_slider.ts rename to test/functional/apps/dashboard_elements/controls/common/range_slider.ts index 39eeca43b09bb..d6cd7388987fe 100644 --- a/test/functional/apps/dashboard_elements/controls/range_slider.ts +++ b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts @@ -9,7 +9,7 @@ import { RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard_elements/controls/replace_controls.ts b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts similarity index 98% rename from test/functional/apps/dashboard_elements/controls/replace_controls.ts rename to test/functional/apps/dashboard_elements/controls/common/replace_controls.ts index 7b17c143c515a..dbc8682caf63e 100644 --- a/test/functional/apps/dashboard_elements/controls/replace_controls.ts +++ b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); diff --git a/test/functional/apps/dashboard_elements/controls/time_slider.ts b/test/functional/apps/dashboard_elements/controls/common/time_slider.ts similarity index 98% rename from test/functional/apps/dashboard_elements/controls/time_slider.ts rename to test/functional/apps/dashboard_elements/controls/common/time_slider.ts index 06d2a9b10024c..7e266376f8e74 100644 --- a/test/functional/apps/dashboard_elements/controls/time_slider.ts +++ b/test/functional/apps/dashboard_elements/controls/common/time_slider.ts @@ -9,7 +9,7 @@ import { RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/dashboard_elements/controls/options_list/config.ts b/test/functional/apps/dashboard_elements/controls/options_list/config.ts new file mode 100644 index 0000000000000..c55987afa5570 --- /dev/null +++ b/test/functional/apps/dashboard_elements/controls/options_list/config.ts @@ -0,0 +1,21 @@ +/* + * 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 functionalConfig = await readConfigFile(require.resolve('../../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + junit: { + reportName: 'Dashboard Elements - Controls Options List tests', + }, + }; +} diff --git a/test/functional/apps/dashboard_elements/controls/options_list/index.ts b/test/functional/apps/dashboard_elements/controls/options_list/index.ts index d2c80da466c53..2e1d803349936 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/index.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/index.ts @@ -12,12 +12,22 @@ export const OPTIONS_LIST_DASHBOARD_NAME = 'Test Options List Control'; export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) { const elasticChart = getService('elasticChart'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const security = getService('security'); const { timePicker, dashboard, common } = getPageObjects(['timePicker', 'dashboard', 'common']); const setup = async () => { + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data'); + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.importExport.load( + 'test/functional/fixtures/kbn_archiver/dashboard/current/kibana' + ); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); + await kibanaServer.uiSettings.replace({ + defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', + }); await common.navigateToApp('dashboard'); await dashboard.gotoDashboardLandingPage(); @@ -31,7 +41,9 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid }; const teardown = async () => { + await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data'); await security.testUser.restoreDefaults(); + await kibanaServer.savedObjects.cleanStandardList(); }; describe('Options list control', async () => { diff --git a/test/functional/apps/dashboard_elements/image_embeddable/config.ts b/test/functional/apps/dashboard_elements/image_embeddable/config.ts new file mode 100644 index 0000000000000..3cf32dac41f09 --- /dev/null +++ b/test/functional/apps/dashboard_elements/image_embeddable/config.ts @@ -0,0 +1,21 @@ +/* + * 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 functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + junit: { + reportName: 'Dashboard Elements - Image Embeddable tests', + }, + }; +} diff --git a/test/functional/apps/dashboard_elements/index.ts b/test/functional/apps/dashboard_elements/index.ts deleted file mode 100644 index f6332057b89b7..0000000000000 --- a/test/functional/apps/dashboard_elements/index.ts +++ /dev/null @@ -1,40 +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 '../../ftr_provider_context'; - -export default function ({ getService, loadTestFile }: FtrProviderContext) { - const browser = getService('browser'); - const log = getService('log'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - - describe('dashboard elements', () => { - before(async () => { - log.debug('Starting before method'); - await browser.setWindowSize(1280, 800); - await kibanaServer.savedObjects.cleanStandardList(); - - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); - }); - - after(async () => { - await kibanaServer.savedObjects.cleanStandardList(); - await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash'); - }); - - describe('dashboard elements', function () { - loadTestFile(require.resolve('./input_control_vis')); - loadTestFile(require.resolve('./controls')); - loadTestFile(require.resolve('./_markdown_vis')); - loadTestFile(require.resolve('./image_embeddable')); - }); - }); -} diff --git a/test/functional/apps/dashboard_elements/input_control_vis/config.ts b/test/functional/apps/dashboard_elements/input_control_vis/config.ts new file mode 100644 index 0000000000000..e856a48074b79 --- /dev/null +++ b/test/functional/apps/dashboard_elements/input_control_vis/config.ts @@ -0,0 +1,21 @@ +/* + * 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 functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + junit: { + reportName: 'Dashboard Elements - Input Controls tests', + }, + }; +} diff --git a/test/functional/apps/dashboard_elements/input_control_vis/index.ts b/test/functional/apps/dashboard_elements/input_control_vis/index.ts index 852d1422619cd..ac57e1169d744 100644 --- a/test/functional/apps/dashboard_elements/input_control_vis/index.ts +++ b/test/functional/apps/dashboard_elements/input_control_vis/index.ts @@ -8,8 +8,26 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; -export default function ({ loadTestFile }: FtrProviderContext) { +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const browser = getService('browser'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + describe('input controls', function () { + before(async () => { + await browser.setWindowSize(1280, 800); + await kibanaServer.savedObjects.cleanStandardList(); + + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash'); + }); + loadTestFile(require.resolve('./input_control_options')); loadTestFile(require.resolve('./dynamic_options')); loadTestFile(require.resolve('./chained_controls')); diff --git a/test/functional/apps/dashboard_elements/_markdown_vis.ts b/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts similarity index 97% rename from test/functional/apps/dashboard_elements/_markdown_vis.ts rename to test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts index 16cdda9b610ca..81ef54cad1831 100644 --- a/test/functional/apps/dashboard_elements/_markdown_vis.ts +++ b/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'header']); diff --git a/test/functional/apps/dashboard_elements/markdown/config.ts b/test/functional/apps/dashboard_elements/markdown/config.ts new file mode 100644 index 0000000000000..5d8c52111aa01 --- /dev/null +++ b/test/functional/apps/dashboard_elements/markdown/config.ts @@ -0,0 +1,21 @@ +/* + * 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 functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('./_markdown_vis')], + junit: { + reportName: 'Dashboard Elements - Markdown tests', + }, + }; +} diff --git a/test/functional/firefox/dashboard.config.ts b/test/functional/firefox/dashboard.config.ts index ab9ef0861c87b..649b8d6ab8c31 100644 --- a/test/functional/firefox/dashboard.config.ts +++ b/test/functional/firefox/dashboard.config.ts @@ -18,7 +18,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('../apps/dashboard/group4/dashboard_save'), - require.resolve('../apps/dashboard_elements'), + require.resolve('../apps/dashboard_elements/controls/common'), + require.resolve('../apps/dashboard_elements/controls/options_list'), + require.resolve('../apps/dashboard_elements/image_embeddable'), + require.resolve('../apps/dashboard_elements/input_control_vis'), + require.resolve('../apps/dashboard_elements/markdown/_markdown_vis.ts'), ], junit: {