From 7a9d4170a514472a9905a39e71781aa1f63dd1a0 Mon Sep 17 00:00:00 2001 From: Yaroslav Kuznietsov Date: Fri, 7 Oct 2022 17:38:16 +0300 Subject: [PATCH] Added functional tests. --- .../group3/open_in_lens/agg_based/gauge.ts | 41 +++++++++++++++++++ .../group3/open_in_lens/agg_based/index.ts | 1 + 2 files changed, 42 insertions(+) create mode 100644 x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/gauge.ts diff --git a/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/gauge.ts b/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/gauge.ts new file mode 100644 index 0000000000000..a5d348b4ed6f5 --- /dev/null +++ b/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/gauge.ts @@ -0,0 +1,41 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../../ftr_provider_context'; + +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const { visualize, lens, timePicker } = getPageObjects(['visualize', 'lens', 'timePicker']); + + const testSubjects = getService('testSubjects'); + + describe('Gauge', function describeIndexTests() { + const isNewChartsLibraryEnabled = true; + + before(async () => { + await visualize.initTests(isNewChartsLibraryEnabled); + }); + + beforeEach(async () => { + await visualize.navigateToNewAggBasedVisualization(); + await visualize.clickGauge(); + await visualize.clickNewSearch(); + await timePicker.setDefaultAbsoluteRange(); + }); + + it('should show the "Edit Visualization in Lens" menu item', async () => { + const button = await testSubjects.exists('visualizeEditInLensButton'); + expect(button).to.eql(true); + }); + + it('should convert to Lens', async () => { + const button = await testSubjects.find('visualizeEditInLensButton'); + await button.click(); + await lens.waitForVisualization('gaugeChart'); + }); + }); +} diff --git a/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/index.ts b/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/index.ts index 66de13c67d94c..53e1302816466 100644 --- a/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/index.ts +++ b/x-pack/test/functional/apps/lens/group3/open_in_lens/agg_based/index.ts @@ -11,5 +11,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { describe('Agg based Vis to Lens', function () { loadTestFile(require.resolve('./pie')); loadTestFile(require.resolve('./metric')); + loadTestFile(require.resolve('./gauge')); }); }