mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Rebalance dashboard group 1 (#132193)
Split a group of the files to group 6. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9814c8515d
commit
42eec11a8d
14 changed files with 300 additions and 13 deletions
|
@ -37,18 +37,5 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./dashboard_unsaved_state'));
|
||||
loadTestFile(require.resolve('./dashboard_unsaved_listing'));
|
||||
loadTestFile(require.resolve('./edit_visualizations'));
|
||||
loadTestFile(require.resolve('./dashboard_options'));
|
||||
loadTestFile(require.resolve('./data_shared_attributes'));
|
||||
loadTestFile(require.resolve('./share'));
|
||||
loadTestFile(require.resolve('./embed_mode'));
|
||||
loadTestFile(require.resolve('./dashboard_back_button'));
|
||||
loadTestFile(require.resolve('./dashboard_error_handling'));
|
||||
loadTestFile(require.resolve('./legacy_urls'));
|
||||
loadTestFile(require.resolve('./saved_search_embeddable'));
|
||||
|
||||
// Note: This one must be last because it unloads some data for one of its tests!
|
||||
// No, this isn't ideal, but loading/unloading takes so much time and these are all bunched
|
||||
// to improve efficiency...
|
||||
loadTestFile(require.resolve('./dashboard_query_bar'));
|
||||
});
|
||||
}
|
||||
|
|
18
test/functional/apps/dashboard/group6/config.ts
Normal file
18
test/functional/apps/dashboard/group6/config.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* 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('.')],
|
||||
};
|
||||
}
|
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* 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 { VisualizeConstants } from '@kbn/visualizations-plugin/common/constants';
|
||||
import { VISUALIZE_ENABLE_LABS_SETTING } from '@kbn/visualizations-plugin/common/constants';
|
||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
|
||||
const browser = getService('browser');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
|
||||
describe('create and add embeddables', () => {
|
||||
before(async () => {
|
||||
await kibanaServer.savedObjects.cleanStandardList();
|
||||
await kibanaServer.importExport.load(
|
||||
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
});
|
||||
|
||||
it('ensure toolbar popover closes on add', async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.switchToEditMode();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickAddNewEmbeddableLink('LOG_STREAM_EMBEDDABLE');
|
||||
await dashboardAddPanel.expectEditorMenuClosed();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await kibanaServer.savedObjects.cleanStandardList();
|
||||
});
|
||||
|
||||
describe('add new visualization link', () => {
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
await PageObjects.dashboard.loadSavedDashboard('few panels');
|
||||
});
|
||||
|
||||
it('adds new visualization via the top nav link', async () => {
|
||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
||||
await PageObjects.dashboard.switchToEditMode();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||
await PageObjects.visualize.clickAreaChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
||||
'visualization from top nav add new panel',
|
||||
{ redirectToOrigin: true }
|
||||
);
|
||||
await retry.try(async () => {
|
||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||
});
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
});
|
||||
|
||||
it('adds a new visualization', async () => {
|
||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||
await PageObjects.visualize.clickAreaChart();
|
||||
await PageObjects.visualize.clickNewSearch();
|
||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
||||
'visualization from add new link',
|
||||
{ redirectToOrigin: true }
|
||||
);
|
||||
|
||||
await retry.try(async () => {
|
||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||
});
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
});
|
||||
|
||||
it('adds a new timelion visualization', async () => {
|
||||
// adding this case, as the timelion agg-based viz doesn't need the `clickNewSearch()` step
|
||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickAggBasedVisualizations();
|
||||
await PageObjects.visualize.clickTimelion();
|
||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
||||
'timelion visualization from add new link',
|
||||
{ redirectToOrigin: true }
|
||||
);
|
||||
|
||||
await retry.try(async () => {
|
||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||
});
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
});
|
||||
|
||||
it('adds a markdown visualization via the quick button', async () => {
|
||||
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
|
||||
await dashboardAddPanel.clickMarkdownQuickButton();
|
||||
await PageObjects.visualize.saveVisualizationExpectSuccess(
|
||||
'visualization from markdown quick button',
|
||||
{ redirectToOrigin: true }
|
||||
);
|
||||
|
||||
await retry.try(async () => {
|
||||
const panelCount = await PageObjects.dashboard.getPanelCount();
|
||||
expect(panelCount).to.eql(originalPanelCount + 1);
|
||||
});
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
});
|
||||
|
||||
it('saves the listing page instead of the visualization to the app link', async () => {
|
||||
await PageObjects.header.clickVisualize(true);
|
||||
const currentUrl = await browser.getCurrentUrl();
|
||||
expect(currentUrl).not.to.contain(VisualizeConstants.EDIT_PATH);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.header.clickDashboard();
|
||||
});
|
||||
});
|
||||
|
||||
describe('visualize:enableLabs advanced setting', () => {
|
||||
const LAB_VIS_NAME = 'Rendering Test: input control';
|
||||
|
||||
it('should display lab visualizations in add panel', async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
const exists = await dashboardAddPanel.panelAddLinkExists(LAB_VIS_NAME);
|
||||
await dashboardAddPanel.closeAddPanel();
|
||||
expect(exists).to.be(true);
|
||||
});
|
||||
|
||||
describe('is false', () => {
|
||||
before(async () => {
|
||||
await PageObjects.header.clickStackManagement();
|
||||
await PageObjects.settings.clickKibanaSettings();
|
||||
await PageObjects.settings.toggleAdvancedSettingCheckbox(VISUALIZE_ENABLE_LABS_SETTING);
|
||||
});
|
||||
|
||||
it('should not display lab visualizations in add panel', async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
|
||||
const exists = await dashboardAddPanel.panelAddLinkExists(LAB_VIS_NAME);
|
||||
await dashboardAddPanel.closeAddPanel();
|
||||
expect(exists).to.be(false);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.header.clickStackManagement();
|
||||
await PageObjects.settings.clickKibanaSettings();
|
||||
await PageObjects.settings.clearAdvancedSettings(VISUALIZE_ENABLE_LABS_SETTING);
|
||||
await PageObjects.header.clickDashboard();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
67
test/functional/apps/dashboard/group6/empty_dashboard.ts
Normal file
67
test/functional/apps/dashboard/group6/empty_dashboard.ts
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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 '../../../ftr_provider_context';
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const testSubjects = getService('testSubjects');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
const dashboardVisualizations = getService('dashboardVisualizations');
|
||||
const dashboardExpect = getService('dashboardExpect');
|
||||
const PageObjects = getPageObjects(['common', 'dashboard']);
|
||||
|
||||
describe('empty dashboard', () => {
|
||||
before(async () => {
|
||||
await kibanaServer.savedObjects.cleanStandardList();
|
||||
await kibanaServer.importExport.load(
|
||||
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await dashboardAddPanel.closeAddPanel();
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await kibanaServer.savedObjects.cleanStandardList();
|
||||
});
|
||||
|
||||
it('should display empty widget', async () => {
|
||||
const emptyWidgetExists = await testSubjects.exists('emptyDashboardWidget');
|
||||
expect(emptyWidgetExists).to.be(true);
|
||||
});
|
||||
|
||||
it('should open add panel when add button is clicked', async () => {
|
||||
await dashboardAddPanel.clickOpenAddPanel();
|
||||
const isAddPanelOpen = await dashboardAddPanel.isAddPanelOpen();
|
||||
expect(isAddPanelOpen).to.be(true);
|
||||
await testSubjects.click('euiFlyoutCloseButton');
|
||||
});
|
||||
|
||||
it('should add new visualization from dashboard', async () => {
|
||||
await dashboardVisualizations.createAndAddMarkdown({
|
||||
name: 'Dashboard Test Markdown',
|
||||
markdown: 'Markdown text',
|
||||
});
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
await dashboardExpect.markdownWithValuesExists(['Markdown text']);
|
||||
});
|
||||
|
||||
it('should open editor menu when editor button is clicked', async () => {
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await testSubjects.existOrFail('dashboardEditorContextMenu');
|
||||
});
|
||||
});
|
||||
}
|
46
test/functional/apps/dashboard/group6/index.ts
Normal file
46
test/functional/apps/dashboard/group6/index.ts
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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 esArchiver = getService('esArchiver');
|
||||
|
||||
async function loadCurrentData() {
|
||||
await browser.setWindowSize(1300, 900);
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
}
|
||||
|
||||
async function unloadCurrentData() {
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
}
|
||||
|
||||
describe('dashboard app - group 1', function () {
|
||||
before(loadCurrentData);
|
||||
after(unloadCurrentData);
|
||||
|
||||
// This has to be first since the other tests create some embeddables as side affects and our counting assumes
|
||||
// a fresh index.
|
||||
loadTestFile(require.resolve('./empty_dashboard'));
|
||||
loadTestFile(require.resolve('./dashboard_options'));
|
||||
loadTestFile(require.resolve('./data_shared_attributes'));
|
||||
loadTestFile(require.resolve('./share'));
|
||||
loadTestFile(require.resolve('./embed_mode'));
|
||||
loadTestFile(require.resolve('./dashboard_back_button'));
|
||||
loadTestFile(require.resolve('./dashboard_error_handling'));
|
||||
loadTestFile(require.resolve('./legacy_urls'));
|
||||
loadTestFile(require.resolve('./saved_search_embeddable'));
|
||||
|
||||
// Note: This one must be last because it unloads some data for one of its tests!
|
||||
// No, this isn't ideal, but loading/unloading takes so much time and these are all bunched
|
||||
// to improve efficiency...
|
||||
loadTestFile(require.resolve('./dashboard_query_bar'));
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue