kibana/test/functional/apps/home/_add_data.js
Nathan Reese 59b63c6a63
[home] Include ability to publish kibana saved objects from add data tutorial (#19559)
* add savedObjects to tutorial schema, add savedObjects to APM, add bulk create endpoint

* SavedObjectInstaller component

* bulkCreate fixes

* fix tutorial jest test

* update from sqren review

* updated copy

* move saved object json into seperate json files

* minor commit clean up

* ensure isMounted before setting state after async call, allow manifest to customize saved object install message

* remove duplicated logic for getting config xpack.apm.indexPattern

* refactor get index pattern title

* add functional test that loads APM saved objects

* remove extra await

* display overwrite message

* use angular free savedObjectClient

* functional test cleanup

* handle bulkRequest exception and add jest tests for SavedObjectsInstaller

* use Promise.reject instead of throw

* update copy
2018-07-18 10:57:25 -06:00

59 lines
2.1 KiB
JavaScript

/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import expect from 'expect.js';
export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'header', 'home', 'dashboard']);
describe('add data tutorials', function describeIndexTests() {
it('directory should display registered tutorials', async ()=> {
await PageObjects.common.navigateToUrl('home', 'tutorial_directory');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
const tutorialExists = await PageObjects.home.doesSynopsisExist('netflow');
expect(tutorialExists).to.be(true);
});
});
describe('apm', function describeIndexTests() {
it('should install saved objects', async ()=> {
await PageObjects.common.navigateToUrl('home', 'tutorial_directory');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
await PageObjects.home.clickSynopsis('apm');
});
await PageObjects.home.loadSavedObjects();
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.searchForDashboardWithName('APM');
const countOfDashboards = await PageObjects.dashboard.getCountOfDashboardsInListingTable();
expect(countOfDashboards).to.equal(5);
});
});
});
}