From 05ae34588c57bbcf2baae384052ea69d042e9f83 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Wed, 26 Oct 2022 03:26:19 +0000 Subject: [PATCH] Rename wizard in functional tests Signed-off-by: abbyhu2000 --- src/plugins/vis_builder/server/plugin.ts | 2 +- .../apps/{wizard => vis_builder}/_base.ts | 26 +++++++++---------- .../_experimental_vis.ts | 20 +++++++------- .../apps/{wizard => vis_builder}/index.ts | 6 ++--- test/functional/config.js | 6 ++--- test/functional/page_objects/index.ts | 4 +-- .../{wizard_page.ts => vis_builder_page.ts} | 10 +++---- 7 files changed, 37 insertions(+), 37 deletions(-) rename test/functional/apps/{wizard => vis_builder}/_base.ts (59%) rename test/functional/apps/{wizard => vis_builder}/_experimental_vis.ts (71%) rename test/functional/apps/{wizard => vis_builder}/index.ts (88%) rename test/functional/page_objects/{wizard_page.ts => vis_builder_page.ts} (94%) diff --git a/src/plugins/vis_builder/server/plugin.ts b/src/plugins/vis_builder/server/plugin.ts index b23ee1ef6e53..8cc5f02c8d3f 100644 --- a/src/plugins/vis_builder/server/plugin.ts +++ b/src/plugins/vis_builder/server/plugin.ts @@ -39,5 +39,5 @@ export class VisBuilderPlugin implements Plugin { - log.debug('navigateToApp wizard'); - await PageObjects.wizard.navigateToCreateWizard(); + log.debug('navigateToApp visBuilder'); + await PageObjects.visBuilder.navigateToCreateVisBuilder(); }); it('should be able to switch data sources', async () => { - const dataSourceValue = await PageObjects.wizard.selectDataSource( - PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED + const dataSourceValue = await PageObjects.visBuilder.selectDataSource( + PageObjects.visBuilder.index.LOGSTASH_NON_TIME_BASED ); - expect(dataSourceValue).to.equal(PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED); + expect(dataSourceValue).to.equal(PageObjects.visBuilder.index.LOGSTASH_NON_TIME_BASED); // TODO: Switch with a datasource with unique fields to test if it exists }); it('should show visualization when a field is added', async () => { const expectedData = [2904, 2858, 2814, 2784, 1322]; - await PageObjects.wizard.addField('metric', 'Count'); - await PageObjects.wizard.addField('segment', 'Terms', 'machine.os.raw'); + await PageObjects.visBuilder.addField('metric', 'Count'); + await PageObjects.visBuilder.addField('segment', 'Terms', 'machine.os.raw'); const data = await PageObjects.visChart.getBarChartData(); expect(data).to.eql(expectedData); }); it('should clear visualization when field is deleted', async () => { - await PageObjects.wizard.removeField('metric', 0); + await PageObjects.visBuilder.removeField('metric', 0); - const isEmptyWorkspace = await PageObjects.wizard.isEmptyWorkspace(); + const isEmptyWorkspace = await PageObjects.visBuilder.isEmptyWorkspace(); expect(isEmptyWorkspace).to.be(true); }); it('should show warning before changing visualization type', async () => { - await PageObjects.wizard.selectVisType('metric', false); + await PageObjects.visBuilder.selectVisType('metric', false); const confirmModalExists = await testSubjects.exists('confirmVisChangeModal'); expect(confirmModalExists).to.be(true); @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should change visualization type', async () => { - const pickerValue = await PageObjects.wizard.selectVisType('metric'); + const pickerValue = await PageObjects.visBuilder.selectVisType('metric'); expect(pickerValue).to.eql('Metric'); }); diff --git a/test/functional/apps/wizard/_experimental_vis.ts b/test/functional/apps/vis_builder/_experimental_vis.ts similarity index 71% rename from test/functional/apps/wizard/_experimental_vis.ts rename to test/functional/apps/vis_builder/_experimental_vis.ts index e36c0254e22a..f9cbf393cb47 100644 --- a/test/functional/apps/wizard/_experimental_vis.ts +++ b/test/functional/apps/vis_builder/_experimental_vis.ts @@ -8,25 +8,25 @@ import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../../src/plugins/visualiza import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects(['visualize', 'wizard']); + const PageObjects = getPageObjects(['visualize', 'visBuilder']); const log = getService('log'); const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - describe('experimental settings for wizard app ', function () { - it('should show an notification when creating wizard visualization', async () => { + describe('experimental settings for visBuilder app ', function () { + it('should show an notification when creating visBuilder visualization', async () => { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.waitForVisualizationSelectPage(); - // Try to find the wizard Vis type. - const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); + // Try to find the visBuilder Vis type. + const wizardVisTypeExists = await PageObjects.visualize.hasVisType('visBuilder'); expect(wizardVisTypeExists).to.be(true); // Create a new visualization - await PageObjects.visualize.clickVisType('wizard'); + await PageObjects.visualize.clickVisType('visBuilder'); // Check that the experimental banner is there and state that this is experimental - const info = await PageObjects.wizard.getExperimentalInfo(); + const info = await PageObjects.visBuilder.getExperimentalInfo(); expect(await info.getVisibleText()).to.contain('experimental'); }); @@ -38,9 +38,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.waitForVisualizationSelectPage(); - // Try to find the wizard Vis type. - const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); - expect(wizardVisTypeExists).to.be(false); + // Try to find the visBuilder Vis type. + const visBuilderVisTypeExists = await PageObjects.visualize.hasVisType('visBuilder'); + expect(visBuilderVisTypeExists).to.be(false); }); after(async () => { diff --git a/test/functional/apps/wizard/index.ts b/test/functional/apps/vis_builder/index.ts similarity index 88% rename from test/functional/apps/wizard/index.ts rename to test/functional/apps/vis_builder/index.ts index 24c4eb50c263..c0e7b9c35c77 100644 --- a/test/functional/apps/wizard/index.ts +++ b/test/functional/apps/vis_builder/index.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { FtrProviderContext } from '../../ftr_provider_context.d'; +import { FtrProviderContext } from '../../ftr_provider_context'; import { UI_SETTINGS } from '../../../../src/plugins/data/common'; export default function ({ getService, loadTestFile }: FtrProviderContext) { @@ -12,11 +12,11 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { const opensearchArchiver = getService('opensearchArchiver'); const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - describe('wizard app', function () { + describe('visBuilder app', function () { this.tags('ciGroup13'); before(async function () { - log.debug('Starting wizard before method'); + log.debug('Starting visBuilder before method'); await browser.setWindowSize(1280, 800); await opensearchArchiver.loadIfNeeded('logstash_functional'); await opensearchArchiver.loadIfNeeded('long_window_logstash'); diff --git a/test/functional/config.js b/test/functional/config.js index bb6be73ebd82..4ec03dfee8b7 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -48,7 +48,7 @@ export default async function ({ readConfigFile }) { require.resolve('./apps/status_page'), require.resolve('./apps/timeline'), require.resolve('./apps/visualize'), - require.resolve('./apps/wizard'), + require.resolve('./apps/vis_builder'), ], pageObjects, services, @@ -92,8 +92,8 @@ export default async function ({ readConfigFile }) { pathname: '/app/visualize', hash: '/', }, - wizard: { - pathname: '/app/wizard', + visBuilder: { + pathname: '/app/vis_builder', hash: '/', }, dashboard: { diff --git a/test/functional/page_objects/index.ts b/test/functional/page_objects/index.ts index d09445d47026..63cd990c445b 100644 --- a/test/functional/page_objects/index.ts +++ b/test/functional/page_objects/index.ts @@ -44,7 +44,7 @@ import { TimePickerProvider } from './time_picker'; import { TimelinePageProvider } from './timeline_page'; import { VisualBuilderPageProvider } from './visual_builder_page'; import { VisualizePageProvider } from './visualize_page'; -import { WizardPageProvider } from './wizard_page'; +import { VisBuilderPageProvider } from './vis_builder_page'; import { VisualizeEditorPageProvider } from './visualize_editor_page'; import { VisualizeChartPageProvider } from './visualize_chart_page'; import { TileMapPageProvider } from './tile_map_page'; @@ -69,7 +69,7 @@ export const pageObjects = { timePicker: TimePickerProvider, visualBuilder: VisualBuilderPageProvider, visualize: VisualizePageProvider, - wizard: WizardPageProvider, + visBuilder: VisBuilderPageProvider, visEditor: VisualizeEditorPageProvider, visChart: VisualizeChartPageProvider, tileMap: TileMapPageProvider, diff --git a/test/functional/page_objects/wizard_page.ts b/test/functional/page_objects/vis_builder_page.ts similarity index 94% rename from test/functional/page_objects/wizard_page.ts rename to test/functional/page_objects/vis_builder_page.ts index bd206f71fa2f..e2c3c85ec319 100644 --- a/test/functional/page_objects/wizard_page.ts +++ b/test/functional/page_objects/vis_builder_page.ts @@ -5,7 +5,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; -export function WizardPageProvider({ getService, getPageObjects }: FtrProviderContext) { +export function VisBuilderPageProvider({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const find = getService('find'); const browser = getService('browser'); @@ -16,14 +16,14 @@ export function WizardPageProvider({ getService, getPageObjects }: FtrProviderCo * This page object contains the visualization type selection, the landing page, * and the open/save dialog functions */ - class WizardPage { + class VisBuilderPage { index = { LOGSTASH_TIME_BASED: 'logstash-*', LOGSTASH_NON_TIME_BASED: 'logstash*', }; - public async navigateToCreateWizard() { - await common.navigateToApp('wizard'); + public async navigateToCreateVisBuilder() { + await common.navigateToApp('visBuilder'); await header.waitUntilLoadingHasFinished(); } @@ -124,5 +124,5 @@ export function WizardPageProvider({ getService, getPageObjects }: FtrProviderCo } } - return new WizardPage(); + return new VisBuilderPage(); }