kibana/test/functional/apps/visualize/_shared_item.ts
Tre 6f95145d28
[QA] Switch tests to use importExport - visualize (#98063)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-13 14:32:58 -06:00

41 lines
1.7 KiB
TypeScript

/*
* 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 log = getService('log');
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'visualize']);
describe('data-shared-item', function indexPatternCreation() {
before(async function () {
await PageObjects.visualize.initTests();
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToApp('visualize');
});
it('should have the correct data-shared-item title and description, and sharedItemContainer should exist', async function () {
const expected = {
title: 'Shared-Item Visualization AreaChart',
description: 'AreaChart',
};
await PageObjects.visualize.openSavedVisualization('Shared-Item Visualization AreaChart');
await retry.try(async function () {
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
const sharedItemContainers = await PageObjects.common.getSharedItemContainers();
expect(sharedItemContainers.length).to.be(1);
});
});
});
}