Skip to content

Commit

Permalink
Added functional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed Oct 7, 2022
1 parent bd5fca5 commit 7a9d417
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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');
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
}

0 comments on commit 7a9d417

Please sign in to comment.