Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export class Flyout extends Component {
const options = this.state.indexPatterns.map(indexPattern => ({
text: indexPattern.get('title'),
value: indexPattern.id,
['data-test-subj']: `indexPatternOption-${indexPattern.get('title')}`,
}));

options.unshift({
Expand All @@ -333,7 +334,7 @@ export class Flyout extends Component {

return (
<EuiSelect
data-test-subj="managementChangeIndexSelection"
data-test-subj={`managementChangeIndexSelection-${id}`}
onChange={e => this.onIndexChanged(id, e)}
options={options}
/>
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/management/_import_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects-conflicts.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.setImportIndexFieldOption(2);
await PageObjects.settings.associateIndexPattern('d1e4c910-a2e6-11e7-bb30-233be9be6a15', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
Expand All @@ -71,7 +71,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_exists.json'), false);

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.setImportIndexFieldOption(2);
await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();

// Override the visualization.
Expand All @@ -89,7 +89,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_exists.json'), false);

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.setImportIndexFieldOption(2);
await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();

// *Don't* override the visualization.
Expand Down
59 changes: 59 additions & 0 deletions test/functional/apps/management/_mgmt_import_saved_objects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* 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';
import path from 'path';

export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'settings', 'header']);

//in 6.4.0 bug the Saved Search conflict would be resolved and get imported but the visualization
//that referenced the saved search was not imported.( https://github.com/elastic/kibana/issues/22238)

describe('mgmt saved objects', function describeIndexTests() {
beforeEach(async function () {
await esArchiver.load('discover');
await PageObjects.settings.navigateTo();
});

afterEach(async function () {
await esArchiver.unload('discover');
});

it('should import saved objects mgmt', async function () {

await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', 'mgmt_import_objects.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.associateIndexPattern('4c3f3c30-ac94-11e8-a651-614b2788174a', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();
await PageObjects.settings.clickImportDone();
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();

//instead of asserting on count- am asserting on the titles- which is more accurate than count.
const objects = await PageObjects.settings.getSavedObjectsInTable();
expect(objects.includes('mysavedsearch')).to.be(true);
expect(objects.includes('mysavedviz')).to.be(true);

});

});

}
37 changes: 37 additions & 0 deletions test/functional/apps/management/exports/mgmt_import_objects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"_id": "6aea5700-ac94-11e8-a651-614b2788174a",
"_type": "search",
"_source": {
"title": "mysavedsearch",
"description": "",
"hits": 0,
"columns": [
"_source"
],
"sort": [
"@timestamp",
"desc"
],
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"4c3f3c30-ac94-11e8-a651-614b2788174a\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
}
}
},
{
"_id": "8411daa0-ac94-11e8-a651-614b2788174a",
"_type": "visualization",
"_source": {
"title": "mysavedviz",
"visState": "{\"title\":\"mysavedviz\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}",
"uiStateJSON": "{}",
"description": "",
"savedSearchId": "6aea5700-ac94-11e8-a651-614b2788174a",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
}
}
}
]
1 change: 1 addition & 0 deletions test/functional/apps/management/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function ({ getService, loadTestFile }) {
loadTestFile(require.resolve('./_index_pattern_filter'));
loadTestFile(require.resolve('./_scripted_fields_filter'));
loadTestFile(require.resolve('./_import_objects'));
loadTestFile(require.resolve('./_mgmt_import_saved_objects'));
loadTestFile(require.resolve('./_test_huge_fields'));
loadTestFile(require.resolve('./_handle_alias'));
});
Expand Down
Binary file not shown.
Loading