mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Discover] Switch documents correctly in Document Explorer
(#134163)
* [Discover] switch documents correctly * [Discover] add functional test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
6347737a93
commit
bd485d5d23
8 changed files with 113 additions and 7 deletions
61
test/functional/apps/discover/_data_grid_row_navigation.ts
Normal file
61
test/functional/apps/discover/_data_grid_row_navigation.ts
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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 dataGrid = getService('dataGrid');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings']);
|
||||
const es = getService('es');
|
||||
const security = getService('security');
|
||||
|
||||
const createIndex = (indexName: string) => {
|
||||
return es.transport.request({
|
||||
path: `/${indexName}/_doc/1`,
|
||||
method: 'PUT',
|
||||
body: {
|
||||
username: 'Dmitry',
|
||||
'@timestamp': '2015-09-21T09:30:23',
|
||||
message: 'hello',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe('discover data grid row navigation', function () {
|
||||
before(async () => {
|
||||
await security.testUser.setRoles(['kibana_admin', 'similar-index']);
|
||||
await security.testUser.setRoles(['kibana_admin', 'similar-index-two']);
|
||||
await PageObjects.common.navigateToApp('settings');
|
||||
|
||||
await createIndex('similar-index');
|
||||
await createIndex('similar-index-two');
|
||||
|
||||
await PageObjects.settings.createIndexPattern('similar-index*', '@timestamp', true);
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
});
|
||||
|
||||
it('should navigate through rows with the same id but different indices correctly', async () => {
|
||||
await PageObjects.discover.selectIndexPattern('similar-index*');
|
||||
|
||||
await dataGrid.clickRowToggle();
|
||||
const indexBeforePaginating = await testSubjects.getVisibleText(
|
||||
'tableDocViewRow-_index-value'
|
||||
);
|
||||
expect(indexBeforePaginating).to.be('similar-index');
|
||||
|
||||
await testSubjects.click('pagination-button-next');
|
||||
const indexAfterPaginating = await testSubjects.getVisibleText(
|
||||
'tableDocViewRow-_index-value'
|
||||
);
|
||||
expect(indexAfterPaginating).to.be('similar-index-two');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -49,6 +49,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./_data_grid_context'));
|
||||
loadTestFile(require.resolve('./_data_grid_field_data'));
|
||||
loadTestFile(require.resolve('./_data_grid_doc_navigation'));
|
||||
loadTestFile(require.resolve('./_data_grid_row_navigation'));
|
||||
loadTestFile(require.resolve('./_data_grid_doc_table'));
|
||||
loadTestFile(require.resolve('./_data_grid_copy_to_clipboard'));
|
||||
loadTestFile(require.resolve('./_indexpattern_with_unmapped_fields'));
|
||||
|
|
|
@ -216,6 +216,36 @@ export default async function ({ readConfigFile }) {
|
|||
kibana: [],
|
||||
},
|
||||
|
||||
similar_index: {
|
||||
elasticsearch: {
|
||||
cluster: [],
|
||||
indices: [
|
||||
{
|
||||
names: ['similar-index'],
|
||||
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
|
||||
field_security: { grant: ['*'], except: [] },
|
||||
},
|
||||
],
|
||||
run_as: [],
|
||||
},
|
||||
kibana: [],
|
||||
},
|
||||
|
||||
similar_index_two: {
|
||||
elasticsearch: {
|
||||
cluster: [],
|
||||
indices: [
|
||||
{
|
||||
names: ['similar-index-two'],
|
||||
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
|
||||
field_security: { grant: ['*'], except: [] },
|
||||
},
|
||||
],
|
||||
run_as: [],
|
||||
},
|
||||
kibana: [],
|
||||
},
|
||||
|
||||
kibana_sample_read: {
|
||||
elasticsearch: {
|
||||
cluster: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue