diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index f6b8e6844ce04..10e71e7f71d4e 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -340,14 +340,6 @@ Hides the "Time" column in *Discover* and in all saved searches on dashboards. Highlights results in *Discover* and saved searches on dashboards. Highlighting slows requests when working on big documents. -[[doctable-legacy]]`doc_table:legacy`:: -deprecated:[8.15.0] Controls the way the document table looks and works. -To use the new *Document Explorer* instead of the classic view, turn off this option. -The *Document Explorer* offers better data sorting, resizable columns, and a full screen view. - -[[truncate-max-height]]`truncate:maxHeight`:: -The maximum height that a cell in a table can occupy. To disable truncation, set to 0. - [float] [[kibana-ml-settings]] diff --git a/packages/kbn-discover-utils/src/constants.ts b/packages/kbn-discover-utils/src/constants.ts index 1f8e3b9916b91..054a11a00231c 100644 --- a/packages/kbn-discover-utils/src/constants.ts +++ b/packages/kbn-discover-utils/src/constants.ts @@ -12,7 +12,7 @@ export const CONTEXT_STEP_SETTING = 'context:step'; export const CONTEXT_TIE_BREAKER_FIELDS_SETTING = 'context:tieBreakerFields'; export const DEFAULT_COLUMNS_SETTING = 'defaultColumns'; export const DOC_HIDE_TIME_COLUMN_SETTING = 'doc_table:hideTimeColumn'; -export const DOC_TABLE_LEGACY = 'doc_table:legacy'; +export const DOC_TABLE_LEGACY = 'doc_table:legacy'; // TODO: remove export const FIELDS_LIMIT_SETTING = 'fields:popularLimit'; export const HIDE_ANNOUNCEMENTS = 'hideAnnouncements'; export const MAX_DOC_FIELDS_DISPLAYED = 'discover:maxDocFieldsDisplayed'; @@ -26,5 +26,5 @@ export const SEARCH_ON_PAGE_LOAD_SETTING = 'discover:searchOnPageLoad'; export const SHOW_FIELD_STATISTICS = 'discover:showFieldStatistics'; export const SHOW_MULTIFIELDS = 'discover:showMultiFields'; export const SORT_DEFAULT_ORDER_SETTING = 'discover:sort:defaultOrder'; -export const TRUNCATE_MAX_HEIGHT = 'truncate:maxHeight'; +export const TRUNCATE_MAX_HEIGHT = 'truncate:maxHeight'; // TODO: remove export const TRUNCATE_MAX_HEIGHT_DEFAULT_VALUE = 115; diff --git a/packages/kbn-management/settings/setting_ids/index.ts b/packages/kbn-management/settings/setting_ids/index.ts index 9a7c95917878a..151f20e323063 100644 --- a/packages/kbn-management/settings/setting_ids/index.ts +++ b/packages/kbn-management/settings/setting_ids/index.ts @@ -87,7 +87,7 @@ export const DISCOVER_SHOW_MULTI_FIELDS_ID = 'discover:showMultiFields'; export const DISCOVER_SORT_DEFAULT_ORDER_ID = 'discover:sort:defaultOrder'; export const DOC_TABLE_HIDE_TIME_COLUMNS_ID = 'doc_table:hideTimeColumn'; export const DOC_TABLE_HIGHLIGHT_ID = 'doc_table:highlight'; -export const DOC_TABLE_LEGACY_ID = 'doc_table:legacy'; +export const DOC_TABLE_LEGACY_ID = 'doc_table:legacy'; // TODO: clean up export const TRUNCATE_MAX_HEIGHT_ID = 'truncate:maxHeight'; // Machine learning settings diff --git a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.scss b/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.scss deleted file mode 100644 index 2327b7b451f42..0000000000000 --- a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.scss +++ /dev/null @@ -1,7 +0,0 @@ -.dscDocumentExplorerCallout { - .euiCallOutHeader__title { - display: flex; - align-items: center; - width: 100%; - } -} diff --git a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.test.tsx b/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.test.tsx deleted file mode 100644 index 7765aee7d3e62..0000000000000 --- a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.test.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { CALLOUT_STATE_KEY, DocumentExplorerCallout } from './document_explorer_callout'; -import { LocalStorageMock } from '../../../../__mocks__/local_storage_mock'; -import { DiscoverServices } from '../../../../build_services'; - -const defaultServices = { - addBasePath: () => '', - docLinks: { links: { discover: { documentExplorer: '' } } }, - capabilities: { advancedSettings: { save: true } }, - storage: new LocalStorageMock({ [CALLOUT_STATE_KEY]: false }), -} as unknown as DiscoverServices; - -const mount = (services: DiscoverServices) => { - return mountWithIntl( - - - - ); -}; - -describe('Document Explorer callout', () => { - it('should render callout', () => { - const result = mount(defaultServices); - - expect(result.find('.dscDocumentExplorerCallout').exists()).toBeTruthy(); - }); - - it('should not render callout for user without permissions', () => { - const services = { - ...defaultServices, - capabilities: { advancedSettings: { save: false } }, - } as unknown as DiscoverServices; - const result = mount(services); - - expect(result.find('.dscDocumentExplorerCallout').exists()).toBeFalsy(); - }); - - it('should not render callout of it was closed', () => { - const services = { - ...defaultServices, - storage: new LocalStorageMock({ [CALLOUT_STATE_KEY]: true }), - } as unknown as DiscoverServices; - const result = mount(services); - - expect(result.find('.dscDocumentExplorerCallout').exists()).toBeFalsy(); - }); -}); diff --git a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.tsx b/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.tsx deleted file mode 100644 index 20d5702d129a7..0000000000000 --- a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorer_callout.tsx +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useMemo, useState } from 'react'; -import './document_explorer_callout.scss'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiButton, - EuiButtonIcon, - EuiCallOut, - EuiFlexGroup, - EuiFlexItem, - EuiLink, - useEuiTheme, -} from '@elastic/eui'; -import { css } from '@emotion/react'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { DOC_TABLE_LEGACY } from '@kbn/discover-utils'; -import { useDiscoverServices } from '../../../../hooks/use_discover_services'; - -export const CALLOUT_STATE_KEY = 'discover:docExplorerCalloutClosed'; - -const getStoredCalloutState = (storage: Storage): boolean => { - const calloutClosed = storage.get(CALLOUT_STATE_KEY); - return Boolean(calloutClosed); -}; -const updateStoredCalloutState = (newState: boolean, storage: Storage) => { - storage.set(CALLOUT_STATE_KEY, newState); -}; - -/** - * The callout that's displayed when Document explorer is disabled - */ -export const DocumentExplorerCallout = () => { - const { euiTheme } = useEuiTheme(); - const { storage, capabilities, docLinks, addBasePath } = useDiscoverServices(); - const [calloutClosed, setCalloutClosed] = useState(getStoredCalloutState(storage)); - - const onCloseCallout = useCallback(() => { - updateStoredCalloutState(true, storage); - setCalloutClosed(true); - }, [storage]); - - const semiBoldStyle = useMemo( - () => css` - font-weight: ${euiTheme.font.weight.semiBold}; - `, - [euiTheme.font.weight.semiBold] - ); - - if (calloutClosed || !capabilities.advancedSettings.save) { - return null; - } - - return ( - } - iconType="search" - > -

- - - - ), - }} - /> -

- - - - - - - - - - - - -
- ); -}; - -function CalloutTitle({ onCloseCallout }: { onCloseCallout: () => void }) { - return ( - - - - - - - - - ); -} diff --git a/src/plugins/discover/public/application/main/components/document_explorer_callout/index.ts b/src/plugins/discover/public/application/main/components/document_explorer_callout/index.ts deleted file mode 100644 index 1c03e77fde661..0000000000000 --- a/src/plugins/discover/public/application/main/components/document_explorer_callout/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { DocumentExplorerCallout } from './document_explorer_callout'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index 6092a59333290..d8f0883cdf183 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -37,7 +37,6 @@ import { } from '@kbn/unified-data-table'; import { DOC_HIDE_TIME_COLUMN_SETTING, - HIDE_ANNOUNCEMENTS, isLegacyTableEnabled, MAX_DOC_FIELDS_DISPLAYED, ROW_HEIGHT_OPTION, @@ -59,7 +58,6 @@ import { FetchStatus } from '../../../types'; import { DiscoverStateContainer } from '../../state_management/discover_state'; import { useDataState } from '../../hooks/use_data_state'; import { DocTableInfinite } from '../../../../components/doc_table/doc_table_infinite'; -import { DocumentExplorerCallout } from '../document_explorer_callout'; import { getMaxAllowedSampleSize, getAllowedSampleSize, @@ -146,7 +144,6 @@ function DiscoverDocumentsComponent({ const expandedDoc = useInternalStateSelector((state) => state.expandedDoc); const isEsqlMode = useIsEsqlMode(); const useNewFieldsApi = useMemo(() => !uiSettings.get(SEARCH_FIELDS_FROM_SOURCE), [uiSettings]); - const hideAnnouncements = useMemo(() => uiSettings.get(HIDE_ANNOUNCEMENTS), [uiSettings]); const isLegacy = useMemo( () => isLegacyTableEnabled({ uiSettings, isEsqlMode }), [uiSettings, isEsqlMode] @@ -434,7 +431,6 @@ function DiscoverDocumentsComponent({ <> {rows && rows.length > 0 && ( <> - {!hideAnnouncements && } { - before(async () => { - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await kibanaServer.uiSettings.update({ - 'doc_table:legacy': true, - defaultIndex: 'logstash-*', - }); - await common.navigateToApp('discover'); - await header.waitUntilLoadingHasFinished(); - for (const columnName of TEST_COLUMN_NAMES) { - await unifiedFieldList.clickFieldListItemAdd(columnName); - } - - for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { - await unifiedFieldList.clickFieldListItem(columnName); - await unifiedFieldList.clickFieldListPlusFilter(columnName, value); - } - }); - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - - it('should open the context view with the same columns', async () => { - const columnNames = await docTable.getHeaderFields(); - expect(columnNames).to.eql(['@timestamp', ...TEST_COLUMN_NAMES]); - }); - - it('should open the context view with the selected document as anchor and allows selecting next anchor', async () => { - /** - * Helper function to get the first timestamp of the document table - * @param isAnchorRow - determins if just the anchor row of context should be selected - */ - const getTimestamp = async (isAnchorRow: boolean = false) => { - const contextFields = await docTable.getFields({ isAnchorRow }); - return contextFields[0][0]; - }; - // get the timestamp of the first row - - const firstDiscoverTimestamp = await getTimestamp(); - - // check the anchor timestamp in the context view - await retry.waitFor('selected document timestamp matches anchor timestamp ', async () => { - // navigate to the context view - await docTable.clickRowToggle({ rowIndex: 0 }); - const rowActions = await docTable.getRowActions({ rowIndex: 0 }); - await rowActions[0].click(); - await context.waitUntilContextLoadingHasFinished(); - const anchorTimestamp = await getTimestamp(true); - return anchorTimestamp === firstDiscoverTimestamp; - }); - - await retry.waitFor('next anchor timestamp matches previous anchor timestamp', async () => { - // get the timestamp of the first row - const firstContextTimestamp = await getTimestamp(false); - await docTable.clickRowToggle({ rowIndex: 0 }); - const rowActions = await docTable.getRowActions({ rowIndex: 0 }); - await rowActions[0].click(); - await context.waitUntilContextLoadingHasFinished(); - const anchorTimestamp = await getTimestamp(true); - return anchorTimestamp === firstContextTimestamp; - }); - }); - - it('should open the context view with the filters disabled', async () => { - let disabledFilterCounter = 0; - for (const [_, value, columnId] of TEST_FILTER_COLUMN_NAMES) { - if (await filterBar.hasFilter(columnId, value, false)) { - disabledFilterCounter++; - } - } - expect(disabledFilterCounter).to.be(TEST_FILTER_COLUMN_NAMES.length); - }); - - // bugfix: https://github.com/elastic/kibana/issues/92099 - it('should navigate to the first document and then back to discover', async () => { - await context.waitUntilContextLoadingHasFinished(); - - // navigate to the doc view - await docTable.clickRowToggle({ rowIndex: 0 }); - - // click the open action - await retry.try(async () => { - const rowActions = await docTable.getRowActions({ rowIndex: 0 }); - if (!rowActions.length) { - throw new Error('row actions empty, trying again'); - } - await rowActions[1].click(); - }); - - const hasDocHit = await testSubjects.exists('doc-hit'); - expect(hasDocHit).to.be(true); - - await testSubjects.click('~breadcrumb & ~first'); - await discover.waitForDiscoverAppOnScreen(); - await discover.waitForDocTableLoadingComplete(); - }); - - it('navigates to doc view from embeddable', async () => { - await common.navigateToApp('discover'); - await discover.saveSearch('my classic search'); - await header.waitUntilLoadingHasFinished(); - - await dashboard.navigateToApp(); - await dashboard.gotoDashboardLandingPage(); - await dashboard.clickNewDashboard(); - - await dashboardAddPanel.addSavedSearch('my classic search'); - await header.waitUntilLoadingHasFinished(); - - await docTable.clickRowToggle({ rowIndex: 0 }); - const rowActions = await docTable.getRowActions({ rowIndex: 0 }); - await rowActions[1].click(); - await common.sleep(250); - - // close popup - const alert = await browser.getAlert(); - await alert?.accept(); - if (await testSubjects.exists('confirmModalConfirmButton')) { - await testSubjects.click('confirmModalConfirmButton'); - } - - await retry.waitFor('navigate to doc view', async () => { - const currentUrl = await browser.getCurrentUrl(); - return currentUrl.includes('#/doc'); - }); - await retry.waitFor('doc view being rendered', async () => { - return await discover.isShowingDocViewer(); - }); - }); - }); -} diff --git a/test/functional/apps/context/classic/_filters.ts b/test/functional/apps/context/classic/_filters.ts deleted file mode 100644 index fd2ce16982f31..0000000000000 --- a/test/functional/apps/context/classic/_filters.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrProviderContext } from '../../../ftr_provider_context'; - -const TEST_INDEX_PATTERN = 'logstash-*'; -const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI'; -const TEST_ANCHOR_FILTER_FIELD = 'geo.src'; -const TEST_ANCHOR_FILTER_VALUE = 'IN'; -const TEST_COLUMN_NAMES = ['extension', 'geo.src']; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const docTable = getService('docTable'); - const filterBar = getService('filterBar'); - const retry = getService('retry'); - const kibanaServer = getService('kibanaServer'); - - const PageObjects = getPageObjects(['common', 'context']); - - describe('context filters', function contextSize() { - before(async function () { - await kibanaServer.uiSettings.update({ 'doc_table:legacy': true }); - }); - - after(async function () { - await kibanaServer.uiSettings.replace({}); - }); - - beforeEach(async function () { - await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, { - columns: TEST_COLUMN_NAMES, - }); - }); - - it('inclusive filter should be addable via expanded doc table rows', async function () { - await retry.waitFor(`filter ${TEST_ANCHOR_FILTER_FIELD} in filterbar`, async () => { - await docTable.toggleRowExpanded({ isAnchorRow: true }); - const anchorDetailsRow = await docTable.getAnchorDetailsRow(); - await docTable.addInclusiveFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD); - await PageObjects.context.waitUntilContextLoadingHasFinished(); - - return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true); - }); - await retry.waitFor(`filter matching docs in docTable`, async () => { - const fields = await docTable.getFields(); - return fields - .map((row) => row[2]) - .every((fieldContent) => fieldContent === TEST_ANCHOR_FILTER_VALUE); - }); - }); - - it('filter for presence should be addable via expanded doc table rows', async function () { - await docTable.toggleRowExpanded({ isAnchorRow: true }); - - await retry.waitFor('an exists filter in the filterbar', async () => { - const anchorDetailsRow = await docTable.getAnchorDetailsRow(); - await docTable.addExistsFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD); - await PageObjects.context.waitUntilContextLoadingHasFinished(); - return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true); - }); - }); - }); -} diff --git a/test/functional/apps/context/index.ts b/test/functional/apps/context/index.ts index 2cfc8cf855a2d..5cccbf163a8fb 100644 --- a/test/functional/apps/context/index.ts +++ b/test/functional/apps/context/index.ts @@ -33,9 +33,7 @@ export default function ({ getService, getPageObjects, loadTestFile }: FtrProvid loadTestFile(require.resolve('./_context_accessibility')); loadTestFile(require.resolve('./_context_navigation')); loadTestFile(require.resolve('./_discover_navigation')); - loadTestFile(require.resolve('./classic/_discover_navigation')); loadTestFile(require.resolve('./_filters')); - loadTestFile(require.resolve('./classic/_filters')); loadTestFile(require.resolve('./_size')); loadTestFile(require.resolve('./_date_nanos')); loadTestFile(require.resolve('./_date_nanos_custom_timestamp')); diff --git a/test/functional/apps/dashboard/group1/embeddable_data_grid.ts b/test/functional/apps/dashboard/group1/embeddable_data_grid.ts index 781f9cda2d685..44e6cdbed6048 100644 --- a/test/functional/apps/dashboard/group1/embeddable_data_grid.ts +++ b/test/functional/apps/dashboard/group1/embeddable_data_grid.ts @@ -36,7 +36,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', - 'doc_table:legacy': false, }); await dashboard.navigateToApp(); await filterBar.ensureFieldEditorModalIsClosed(); diff --git a/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts b/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts deleted file mode 100644 index c56ecc020f2bf..0000000000000 --- a/test/functional/apps/discover/classic/_classic_table_doc_navigation.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 docTable = getService('docTable'); - const filterBar = getService('filterBar'); - const testSubjects = getService('testSubjects'); - const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']); - const esArchiver = getService('esArchiver'); - const retry = getService('retry'); - const kibanaServer = getService('kibanaServer'); - - describe('classic table doc link', function contextSize() { - before(async () => { - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await kibanaServer.uiSettings.update({ - defaultIndex: 'logstash-*', - 'doc_table:legacy': true, - 'discover:searchFieldsFromSource': true, - }); - }); - after(async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - await kibanaServer.uiSettings.replace({}); - }); - - beforeEach(async function () { - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await common.navigateToApp('discover'); - await discover.waitForDocTableLoadingComplete(); - }); - - it('should open the doc view of the selected document', async function () { - // navigate to the doc view - await docTable.clickRowToggle({ rowIndex: 0 }); - - // click the open action - await retry.try(async () => { - const rowActions = await docTable.getRowActions({ rowIndex: 0 }); - if (!rowActions.length) { - throw new Error('row actions empty, trying again'); - } - await rowActions[1].click(); - }); - - await retry.waitFor('hit loaded', async () => { - const hasDocHit = await testSubjects.exists('doc-hit'); - return !!hasDocHit; - }); - }); - - it('should create an exists filter from the doc view of the selected document', async function () { - await discover.waitUntilSearchingHasFinished(); - - await docTable.toggleRowExpanded(); - const detailsRow = await docTable.getDetailsRow(); - await docTable.addExistsFilter(detailsRow, '@timestamp'); - - const hasExistsFilter = await filterBar.hasFilter('@timestamp', 'exists', true, false, false); - expect(hasExistsFilter).to.be(true); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_discover_fields_api.ts b/test/functional/apps/discover/classic/_discover_fields_api.ts deleted file mode 100644 index e0fe867a25c8b..0000000000000 --- a/test/functional/apps/discover/classic/_discover_fields_api.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const { common, discover, timePicker, settings, unifiedFieldList } = getPageObjects([ - 'common', - 'discover', - 'timePicker', - 'settings', - 'unifiedFieldList', - ]); - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:searchFieldsFromSource': false, - 'doc_table:legacy': true, - }; - describe('discover uses fields API test', function describeIndexTests() { - before(async function () { - log.debug('load kibana index with default index pattern'); - await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace(defaultSettings); - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - }); - - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - - it('should correctly display documents', async function () { - log.debug('check if Document title exists in the grid'); - expect(await discover.getDocHeader()).to.have.string('Document'); - const rowData = await discover.getDocTableIndex(1); - log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)'); - expect(rowData.startsWith('Sep 22, 2015 @ 23:50:13.253')).to.be.ok(); - const expectedHitCount = '14,004'; - await retry.try(async function () { - expect(await discover.getHitCount()).to.be(expectedHitCount); - }); - }); - - it('adding a column removes a default column', async function () { - await unifiedFieldList.clickFieldListItemAdd('_score'); - expect(await discover.getDocHeader()).to.have.string('_score'); - expect(await discover.getDocHeader()).not.to.have.string('Document'); - }); - - it('removing a column adds a default column', async function () { - await unifiedFieldList.clickFieldListItemRemove('_score'); - expect(await discover.getDocHeader()).not.to.have.string('_score'); - expect(await discover.getDocHeader()).to.have.string('Document'); - }); - - it('displays _source viewer in doc viewer', async function () { - await discover.clickDocTableRowToggle(0); - await discover.isShowingDocViewer(); - await discover.clickDocViewerTab('doc_view_source'); - await discover.expectSourceViewerToExist(); - }); - - it('switches to _source column when fields API is no longer used', async function () { - await settings.navigateTo(); - await settings.clickKibanaSettings(); - await settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource'); - - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - - expect(await discover.getDocHeader()).to.have.string('_source'); - }); - - it('switches to Document column when fields API is used', async function () { - await settings.navigateTo(); - await settings.clickKibanaSettings(); - await settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource'); - - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - - expect(await discover.getDocHeader()).to.have.string('Document'); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_doc_table.ts b/test/functional/apps/discover/classic/_doc_table.ts deleted file mode 100644 index 5c765a6b2ef21..0000000000000 --- a/test/functional/apps/discover/classic/_doc_table.ts +++ /dev/null @@ -1,309 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 browser = getService('browser'); - const log = getService('log'); - const retry = getService('retry'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const docTable = getService('docTable'); - const queryBar = getService('queryBar'); - const find = getService('find'); - const { common, discover, header, timePicker, unifiedFieldList } = getPageObjects([ - 'common', - 'discover', - 'header', - 'timePicker', - 'unifiedFieldList', - ]); - const defaultSettings = { - defaultIndex: 'logstash-*', - hideAnnouncements: true, - 'doc_table:legacy': true, - }; - const testSubjects = getService('testSubjects'); - - describe('discover doc table', function describeIndexTests() { - const rowsHardLimit = 500; - - before(async function () { - log.debug('load kibana index with default index pattern'); - await kibanaServer.savedObjects.cleanStandardList(); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - - // and load a set of makelogs data - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace(defaultSettings); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - log.debug('discover doc table'); - await common.navigateToApp('discover'); - }); - - after(async function () { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); - await kibanaServer.savedObjects.cleanStandardList(); - await kibanaServer.uiSettings.replace({}); - }); - - it('should show records by default', async function () { - // with the default range the number of hits is ~14000 - const rows = await discover.getDocTableRows(); - expect(rows.length).to.be.greaterThan(0); - }); - - it('should refresh the table content when changing time window', async function () { - const initialRows = await discover.getDocTableRows(); - - const fromTime = 'Sep 20, 2015 @ 23:00:00.000'; - const toTime = 'Sep 20, 2015 @ 23:14:00.000'; - - await timePicker.setAbsoluteRange(fromTime, toTime); - await discover.waitUntilSearchingHasFinished(); - - const finalRows = await discover.getDocTableRows(); - expect(finalRows.length).to.be.below(initialRows.length); - await timePicker.setDefaultAbsoluteRange(); - }); - - describe('classic table in window 900x700', function () { - before(async () => { - await browser.setWindowSize(900, 700); - await common.navigateToApp('discover'); - await discover.waitUntilSearchingHasFinished(); - }); - - it('should load more rows when scrolling down the document table', async function () { - const initialRows = await testSubjects.findAll('docTableRow'); - await testSubjects.scrollIntoView('discoverBackToTop'); - // now count the rows - await retry.waitFor('next batch of documents to be displayed', async () => { - const actual = await testSubjects.findAll('docTableRow'); - log.debug(`initial doc nr: ${initialRows.length}, actual doc nr: ${actual.length}`); - return actual.length > initialRows.length; - }); - }); - }); - - describe('classic table in window 600x700', function () { - before(async () => { - await browser.setWindowSize(600, 700); - await common.navigateToApp('discover'); - await discover.waitUntilSearchingHasFinished(); - }); - - it('should load more rows when scrolling down the document table', async function () { - const initialRows = await testSubjects.findAll('docTableRow'); - await testSubjects.scrollIntoView('discoverBackToTop'); - // now count the rows - await retry.waitFor('next batch of documents to be displayed', async () => { - const actual = await testSubjects.findAll('docTableRow'); - log.debug(`initial doc nr: ${initialRows.length}, actual doc nr: ${actual.length}`); - return actual.length > initialRows.length; - }); - }); - }); - - describe('legacy', function () { - before(async () => { - await common.navigateToApp('discover'); - await discover.waitUntilSearchingHasFinished(); - }); - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - it(`should load up to ${rowsHardLimit} rows when scrolling at the end of the table`, async function () { - const initialRows = await testSubjects.findAll('docTableRow'); - // click the Skip to the end of the table - await discover.skipToEndOfDocTable(); - // now count the rows - const finalRows = await testSubjects.findAll('docTableRow'); - expect(finalRows.length).to.be.above(initialRows.length); - expect(finalRows.length).to.be(rowsHardLimit); - await discover.backToTop(); - }); - - it('should go the end and back to top of the classic table when using the accessible buttons', async function () { - // click the Skip to the end of the table - await discover.skipToEndOfDocTable(); - // now check the footer text content - const footer = await discover.getDocTableFooter(); - expect(await footer.getVisibleText()).to.have.string(rowsHardLimit); - await discover.backToTop(); - // check that the skip to end of the table button now has focus - const skipButton = await testSubjects.find('discoverSkipTableButton'); - const activeElement = await find.activeElement(); - const activeElementText = await activeElement.getVisibleText(); - const skipButtonText = await skipButton.getVisibleText(); - expect(skipButtonText === activeElementText).to.be(true); - }); - - describe('expand a document row', function () { - const rowToInspect = 1; - beforeEach(async function () { - // close the toggle if open - const details = await docTable.getDetailsRows(); - if (details.length) { - await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); - } - }); - - it('should expand the detail row when the toggle arrow is clicked', async function () { - await retry.try(async function () { - await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); - const detailsEl = await docTable.getDetailsRows(); - const defaultMessageEl = await detailsEl[0].findByTestSubject( - 'docViewerRowDetailsTitle' - ); - expect(defaultMessageEl).to.be.ok(); - }); - }); - - it('should show the detail panel actions', async function () { - await retry.try(async function () { - await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); - // const detailsEl = await discover.getDocTableRowDetails(rowToInspect); - const [surroundingActionEl, singleActionEl] = await docTable.getRowActions({ - isAnchorRow: false, - rowIndex: rowToInspect - 1, - }); - expect(surroundingActionEl).to.be.ok(); - expect(singleActionEl).to.be.ok(); - // TODO: test something more meaninful here? - }); - }); - - it('should not close the detail panel actions when data is re-requested', async function () { - await retry.try(async function () { - const nrOfFetches = await discover.getNrOfFetches(); - await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); - const detailsEl = await docTable.getDetailsRows(); - const defaultMessageEl = await detailsEl[0].findByTestSubject( - 'docViewerRowDetailsTitle' - ); - expect(defaultMessageEl).to.be.ok(); - await queryBar.submitQuery(); - const nrOfFetchesResubmit = await discover.getNrOfFetches(); - expect(nrOfFetchesResubmit).to.be.above(nrOfFetches); - const defaultMessageElResubmit = await detailsEl[0].findByTestSubject( - 'docViewerRowDetailsTitle' - ); - - expect(defaultMessageElResubmit).to.be.ok(); - }); - }); - - it('should show allow toggling columns from the expanded document', async function () { - await discover.clickNewSearchButton(); - await retry.try(async function () { - await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); - - // add columns - const fields = ['_id', '_index', 'agent']; - for (const field of fields) { - await testSubjects.click(`toggleColumnButton-${field}`); - await testSubjects.click(`tableDocViewRow-${field}`); // to suppress the appeared tooltip - } - - const headerWithFields = await docTable.getHeaderFields(); - expect(headerWithFields.join(' ')).to.contain(fields.join(' ')); - - // remove columns - for (const field of fields) { - await testSubjects.click(`toggleColumnButton-${field}`); - await testSubjects.click(`tableDocViewRow-${field}`); - } - - const headerWithoutFields = await docTable.getHeaderFields(); - expect(headerWithoutFields.join(' ')).not.to.contain(fields.join(' ')); - }); - }); - }); - - describe('add and remove columns', function () { - const extraColumns = ['phpmemory', 'ip']; - const expectedFieldLength: Record = { - phpmemory: 1, - ip: 4, - }; - afterEach(async function () { - for (const column of extraColumns) { - await unifiedFieldList.clickFieldListItemRemove(column); - await header.waitUntilLoadingHasFinished(); - } - }); - - it('should add more columns to the table', async function () { - for (const column of extraColumns) { - await unifiedFieldList.clearFieldSearchInput(); - await unifiedFieldList.findFieldByName(column); - await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]); - await retry.waitFor('field to appear', async function () { - return await testSubjects.exists(`field-${column}`); - }); - await unifiedFieldList.clickFieldListItemAdd(column); - await header.waitUntilLoadingHasFinished(); - // test the header now - const docHeader = await find.byCssSelector('thead > tr:nth-child(1)'); - const docHeaderText = await docHeader.getVisibleText(); - expect(docHeaderText).to.have.string(column); - } - }); - - it('should remove columns from the table', async function () { - for (const column of extraColumns) { - await unifiedFieldList.clearFieldSearchInput(); - await unifiedFieldList.findFieldByName(column); - await unifiedFieldList.waitUntilFieldlistHasCountOfFields(expectedFieldLength[column]); - await unifiedFieldList.clickFieldListItemAdd(column); - await header.waitUntilLoadingHasFinished(); - } - // remove the second column - await unifiedFieldList.clickFieldListItemRemove(extraColumns[1]); - await header.waitUntilLoadingHasFinished(); - // test that the second column is no longer there - const docHeader = await find.byCssSelector('thead > tr:nth-child(1)'); - expect(await docHeader.getVisibleText()).to.not.have.string(extraColumns[1]); - }); - }); - - it('should make the document table scrollable', async function () { - await unifiedFieldList.clearFieldSearchInput(); - const dscTableWrapper = await find.byCssSelector('.kbnDocTableWrapper'); - const fieldNames = await unifiedFieldList.getAllFieldNames(); - const clientHeight = await dscTableWrapper.getAttribute('clientHeight'); - let fieldCounter = 0; - const checkScrollable = async () => { - const scrollWidth = await dscTableWrapper.getAttribute('scrollWidth'); - const clientWidth = await dscTableWrapper.getAttribute('clientWidth'); - log.debug(`scrollWidth: ${scrollWidth}, clientWidth: ${clientWidth}`); - return Number(scrollWidth) > Number(clientWidth); - }; - const addColumn = async () => { - await unifiedFieldList.clickFieldListItemAdd(fieldNames[fieldCounter++]); - }; - - await addColumn(); - const isScrollable = await checkScrollable(); - expect(isScrollable).to.be(false); - - await retry.waitForWithTimeout('container to be scrollable', 60 * 1000, async () => { - await addColumn(); - return await checkScrollable(); - }); - // so now we need to check if the horizontal scrollbar is displayed - const newClientHeight = await dscTableWrapper.getAttribute('clientHeight'); - expect(Number(clientHeight)).to.be.above(Number(newClientHeight)); - }); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_doc_table_newline.ts b/test/functional/apps/discover/classic/_doc_table_newline.ts deleted file mode 100644 index 3c2b426a2dbe4..0000000000000 --- a/test/functional/apps/discover/classic/_doc_table_newline.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrProviderContext } from '../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const { common, unifiedFieldList } = getPageObjects(['common', 'unifiedFieldList']); - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const security = getService('security'); - - describe('discover doc table newline handling', function describeIndexTests() { - before(async function () { - await security.testUser.setRoles(['kibana_admin', 'kibana_message_with_newline']); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/message_with_newline'); - await kibanaServer.importExport.load( - 'test/functional/fixtures/kbn_archiver/message_with_newline.json' - ); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'newline-test', - 'doc_table:legacy': true, - }); - await common.navigateToApp('discover'); - }); - - after(async () => { - await security.testUser.restoreDefaults(); - await esArchiver.unload('test/functional/fixtures/es_archiver/message_with_newline'); - await kibanaServer.savedObjects.cleanStandardList(); - await kibanaServer.uiSettings.replace({}); - }); - - it('should break text on newlines', async function () { - await unifiedFieldList.clickFieldListItemToggle('message'); - const dscTableRows = await find.allByCssSelector('.kbnDocTable__row'); - - await retry.waitFor('height of multi-line content > single-line content', async () => { - const heightWithoutNewline = await dscTableRows[0].getAttribute('clientHeight'); - const heightWithNewline = await dscTableRows[1].getAttribute('clientHeight'); - log.debug(`Without newlines: ${heightWithoutNewline}, With newlines: ${heightWithNewline}`); - - await common.sleep(10000); - return Number(heightWithNewline) > Number(heightWithoutNewline); - }); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_esql_grid.ts b/test/functional/apps/discover/classic/_esql_grid.ts deleted file mode 100644 index 94dcabdba4efc..0000000000000 --- a/test/functional/apps/discover/classic/_esql_grid.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrProviderContext } from '../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const security = getService('security'); - const dataGrid = getService('dataGrid'); - const dashboardAddPanel = getService('dashboardAddPanel'); - const dashboardPanelActions = getService('dashboardPanelActions'); - const { common, discover, dashboard, header, timePicker } = getPageObjects([ - 'common', - 'discover', - 'dashboard', - 'header', - 'timePicker', - ]); - - const defaultSettings = { - defaultIndex: 'logstash-*', - 'doc_table:legacy': true, - }; - - describe('discover esql grid with legacy setting', function () { - before(async () => { - await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace(defaultSettings); - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - }); - - after(async () => { - await kibanaServer.savedObjects.cleanStandardList(); - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({}); - }); - - it('should render esql view correctly', async function () { - const savedSearchESQL = 'testESQLWithLegacySetting'; - await header.waitUntilLoadingHasFinished(); - await discover.waitUntilSearchingHasFinished(); - - await testSubjects.existOrFail('docTableHeader'); - await testSubjects.missingOrFail('euiDataGridBody'); - - await discover.selectTextBaseLang(); - - await header.waitUntilLoadingHasFinished(); - await discover.waitUntilSearchingHasFinished(); - - await testSubjects.missingOrFail('docTableHeader'); - await testSubjects.existOrFail('euiDataGridBody'); - - await dataGrid.clickRowToggle({ rowIndex: 0 }); - - await testSubjects.existOrFail('docViewerFlyout'); - - await discover.saveSearch(savedSearchESQL); - - await common.navigateToApp('dashboard'); - await dashboard.clickNewDashboard(); - await timePicker.setDefaultAbsoluteRange(); - await dashboardAddPanel.clickOpenAddPanel(); - await dashboardAddPanel.addSavedSearch(savedSearchESQL); - await header.waitUntilLoadingHasFinished(); - - await testSubjects.missingOrFail('docTableHeader'); - await testSubjects.existOrFail('euiDataGridBody'); - - await dataGrid.clickRowToggle({ rowIndex: 0 }); - - await testSubjects.existOrFail('docViewerFlyout'); - - await dashboardPanelActions.removePanelByTitle(savedSearchESQL); - - await dashboardAddPanel.addSavedSearch('A Saved Search'); - - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('docTableHeader'); - await testSubjects.missingOrFail('euiDataGridBody'); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_field_data.ts b/test/functional/apps/discover/classic/_field_data.ts deleted file mode 100644 index 2ebd49bb24ae2..0000000000000 --- a/test/functional/apps/discover/classic/_field_data.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 retry = getService('retry'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const { common, timePicker } = getPageObjects(['common', 'timePicker']); - const find = getService('find'); - const testSubjects = getService('testSubjects'); - - describe('discover tab', function describeIndexTests() { - this.tags('includeFirefox'); - before(async function () { - await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:searchFieldsFromSource': true, - 'doc_table:legacy': true, - }); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await common.navigateToApp('discover'); - }); - - after(async function () { - await kibanaServer.uiSettings.replace({}); - }); - - it('doc view should show @timestamp and _source columns', async function () { - const expectedHeader = '@timestamp\n_source'; - const docHeader = await find.byCssSelector('thead > tr:nth-child(1)'); - const docHeaderText = await docHeader.getVisibleText(); - expect(docHeaderText).to.be(expectedHeader); - }); - - it('doc view should sort ascending', async function () { - const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000'; - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - - // we don't technically need this sleep here because the tryForTime will retry and the - // results will match on the 2nd or 3rd attempt, but that debug output is huge in this - // case and it can be avoided with just a few seconds sleep. - await common.sleep(2000); - await retry.try(async function tryingForTime() { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`); - const rowData = await row.getVisibleText(); - expect(rowData.startsWith(expectedTimeStamp)).to.be.ok(); - }); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_field_data_with_fields_api.ts b/test/functional/apps/discover/classic/_field_data_with_fields_api.ts deleted file mode 100644 index 4932ba3e24348..0000000000000 --- a/test/functional/apps/discover/classic/_field_data_with_fields_api.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 retry = getService('retry'); - const kibanaServer = getService('kibanaServer'); - const { common, timePicker } = getPageObjects(['common', 'timePicker']); - const find = getService('find'); - const esArchiver = getService('esArchiver'); - const testSubjects = getService('testSubjects'); - - describe('discover tab with new fields API', function describeIndexTests() { - before(async function () { - await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:searchFieldsFromSource': false, - 'doc_table:legacy': true, - }); - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await common.navigateToApp('discover'); - }); - - after(async function () { - await kibanaServer.uiSettings.replace({}); - }); - - it('doc view should sort ascending', async function () { - const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000'; - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - - // we don't technically need this sleep here because the tryForTime will retry and the - // results will match on the 2nd or 3rd attempt, but that debug output is huge in this - // case and it can be avoided with just a few seconds sleep. - await common.sleep(2000); - await retry.try(async function tryingForTime() { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`); - const rowData = await row.getVisibleText(); - - expect(rowData.startsWith(expectedTimeStamp)).to.be.ok(); - }); - }); - }); -} diff --git a/test/functional/apps/discover/classic/_hide_announcements.ts b/test/functional/apps/discover/classic/_hide_announcements.ts deleted file mode 100644 index df7fcbb628136..0000000000000 --- a/test/functional/apps/discover/classic/_hide_announcements.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 esArchiver = getService('esArchiver'); - const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']); - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const browser = getService('browser'); - - describe('test hide announcements', function () { - before(async function () { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'doc_table:legacy': true, - }); - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - }); - - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - - it('should display try document explorer button', async function () { - await discover.selectIndexPattern('logstash-*'); - const tourButtonExists = await testSubjects.exists('tryDocumentExplorerButton'); - expect(tourButtonExists).to.be(true); - }); - - it('should not display try document explorer button', async function () { - await kibanaServer.uiSettings.update({ hideAnnouncements: true }); - await browser.refresh(); - const tourButtonExists = await testSubjects.exists('tryDocumentExplorerButton'); - expect(tourButtonExists).to.be(false); - }); - }); -} diff --git a/test/functional/apps/discover/classic/config.ts b/test/functional/apps/discover/classic/config.ts deleted file mode 100644 index 941eec8ca621c..0000000000000 --- a/test/functional/apps/discover/classic/config.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); - - return { - ...functionalConfig.getAll(), - testFiles: [require.resolve('.')], - }; -} diff --git a/test/functional/apps/discover/classic/index.ts b/test/functional/apps/discover/classic/index.ts deleted file mode 100644 index fce8963d19082..0000000000000 --- a/test/functional/apps/discover/classic/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrProviderContext } from '../ftr_provider_context'; - -export default function ({ getService, loadTestFile }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); - const browser = getService('browser'); - - describe('discover/classic', function () { - before(async function () { - await browser.setWindowSize(1300, 800); - }); - - after(async function unloadMakelogs() { - await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); - }); - - loadTestFile(require.resolve('./_discover_fields_api')); - loadTestFile(require.resolve('./_doc_table')); - loadTestFile(require.resolve('./_doc_table_newline')); - loadTestFile(require.resolve('./_field_data')); - loadTestFile(require.resolve('./_field_data_with_fields_api')); - loadTestFile(require.resolve('./_classic_table_doc_navigation')); - loadTestFile(require.resolve('./_hide_announcements')); - loadTestFile(require.resolve('./_esql_grid')); - }); -} diff --git a/test/functional/apps/discover/group6/_time_field_column.ts b/test/functional/apps/discover/group6/_time_field_column.ts index 5965b7765e182..9e5ce3f94a459 100644 --- a/test/functional/apps/discover/group6/_time_field_column.ts +++ b/test/functional/apps/discover/group6/_time_field_column.ts @@ -34,7 +34,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dataViews = getService('dataViews'); const testSubjects = getService('testSubjects'); const security = getService('security'); - const docTable = getService('docTable'); const defaultSettings = { defaultIndex: 'logstash-*', hideAnnouncements: true, @@ -228,7 +227,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ ...defaultSettings, - 'doc_table:legacy': false, 'doc_table:hideTimeColumn': hideTimeFieldColumnSetting, }); await common.navigateToApp('discover'); @@ -319,103 +317,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); - - // These tests are skipped as they take a lot of time to run. Temporary unskip them to validate current functionality if necessary. - describe.skip('legacy table', () => { - beforeEach(async () => { - await kibanaServer.uiSettings.update({ - ...defaultSettings, - 'doc_table:hideTimeColumn': hideTimeFieldColumnSetting, - 'doc_table:legacy': true, - }); - await common.navigateToApp('discover'); - await discover.waitUntilSearchingHasFinished(); - }); - - it('should render initial columns correctly', async () => { - // no columns - await discover.loadSavedSearch(`${SEARCH_NO_COLUMNS}${savedSearchSuffix}`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting ? ['Summary'] : ['@timestamp', 'Summary'] - ); - - await discover.loadSavedSearch(`${SEARCH_NO_COLUMNS}${savedSearchSuffix}-`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql(['Summary']); - - await discover.loadSavedSearch(`${SEARCH_NO_COLUMNS}${savedSearchSuffix}ESQL`); - await discover.waitUntilSearchingHasFinished(); - expect(await dataGrid.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting ? ['Summary'] : ['@timestamp', 'Summary'] - ); - - await discover.loadSavedSearch(`${SEARCH_NO_COLUMNS}${savedSearchSuffix}ESQLdrop`); - await discover.waitUntilSearchingHasFinished(); - expect(await dataGrid.getHeaderFields()).to.eql(['Summary']); - - // only @timestamp is selected - await discover.loadSavedSearch(`${SEARCH_WITH_ONLY_TIMESTAMP}${savedSearchSuffix}`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting ? ['@timestamp'] : ['@timestamp', '@timestamp'] - ); - - await discover.loadSavedSearch(`${SEARCH_WITH_ONLY_TIMESTAMP}${savedSearchSuffix}-`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql(['@timestamp']); - - await discover.loadSavedSearch(`${SEARCH_WITH_ONLY_TIMESTAMP}${savedSearchSuffix}ESQL`); - await discover.waitUntilSearchingHasFinished(); - expect(await dataGrid.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting ? ['@timestamp'] : ['@timestamp', 'Summary'] - ); - }); - - it('should render selected columns correctly', async () => { - // with selected columns - await discover.loadSavedSearch(`${SEARCH_WITH_SELECTED_COLUMNS}${savedSearchSuffix}`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting - ? ['bytes', 'extension'] - : ['@timestamp', 'bytes', 'extension'] - ); - - await discover.loadSavedSearch(`${SEARCH_WITH_SELECTED_COLUMNS}${savedSearchSuffix}-`); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql(['bytes', 'extension']); - - await discover.loadSavedSearch( - `${SEARCH_WITH_SELECTED_COLUMNS}${savedSearchSuffix}ESQL` - ); - await discover.waitUntilSearchingHasFinished(); - expect(await dataGrid.getHeaderFields()).to.eql(['bytes', 'extension']); - - // with selected columns and @timestamp - await discover.loadSavedSearch( - `${SEARCH_WITH_SELECTED_COLUMNS_AND_TIMESTAMP}${savedSearchSuffix}` - ); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql( - hideTimeFieldColumnSetting - ? ['bytes', 'extension', '@timestamp'] - : ['@timestamp', 'bytes', 'extension', '@timestamp'] - ); - - await discover.loadSavedSearch( - `${SEARCH_WITH_SELECTED_COLUMNS_AND_TIMESTAMP}${savedSearchSuffix}-` - ); - await discover.waitUntilSearchingHasFinished(); - expect(await docTable.getHeaderFields()).to.eql(['bytes', 'extension', '@timestamp']); - - await discover.loadSavedSearch( - `${SEARCH_WITH_SELECTED_COLUMNS_AND_TIMESTAMP}${savedSearchSuffix}ESQL` - ); - await discover.waitUntilSearchingHasFinished(); - expect(await dataGrid.getHeaderFields()).to.eql(['bytes', 'extension', '@timestamp']); - }); - }); }); }); }); diff --git a/test/functional/apps/discover/group6/_view_mode_toggle.ts b/test/functional/apps/discover/group6/_view_mode_toggle.ts index 2591716c87d00..4ff5339b80847 100644 --- a/test/functional/apps/discover/group6/_view_mode_toggle.ts +++ b/test/functional/apps/discover/group6/_view_mode_toggle.ts @@ -33,102 +33,75 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + await timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update(defaultSettings); + await common.navigateToApp('discover'); + await discover.waitUntilSearchingHasFinished(); }); after(async () => { await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.uiSettings.replace({}); }); - [true, false].forEach((useLegacyTable) => { - describe(`isLegacy: ${useLegacyTable}`, function () { - before(async function () { - await timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await kibanaServer.uiSettings.update({ - ...defaultSettings, - 'doc_table:legacy': useLegacyTable, - }); - await common.navigateToApp('discover'); - await discover.waitUntilSearchingHasFinished(); - }); - - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - - it('should show Documents tab', async () => { - await testSubjects.existOrFail('dscViewModeToggle'); - - if (!useLegacyTable) { - await testSubjects.existOrFail('unifiedDataTableToolbar'); - } - - const documentsTab = await testSubjects.find('dscViewModeDocumentButton'); - expect(await documentsTab.getAttribute('aria-selected')).to.be('true'); - }); - - it('should show legacy Document Explorer info callout', async () => { - if (useLegacyTable) { - await testSubjects.existOrFail('dscDocumentExplorerLegacyCallout'); - } else { - await testSubjects.missingOrFail('dscDocumentExplorerLegacyCallout'); - } - }); - - it('should show an error callout', async () => { - await queryBar.setQuery('@message::'); // invalid - await queryBar.submitQuery(); - await header.waitUntilLoadingHasFinished(); - - await discover.showsErrorCallout(); - - await queryBar.clearQuery(); - await queryBar.submitQuery(); - await header.waitUntilLoadingHasFinished(); - - await testSubjects.missingOrFail('discoverErrorCalloutTitle'); - }); - - describe('Patterns tab (basic license)', function () { - this.tags('skipFIPS'); - - it('should not show', async function () { - await testSubjects.missingOrFail('dscViewModePatternAnalysisButton'); - }); - }); - - it('should not show Field Statistics tab', async () => { - await testSubjects.existOrFail('dscViewModeToggle'); - }); - - it('should not show view mode toggle for ES|QL searches', async () => { - await testSubjects.click('dscViewModeDocumentButton'); - - await retry.try(async () => { - const documentsTab = await testSubjects.find('dscViewModeDocumentButton'); - expect(await documentsTab.getAttribute('aria-selected')).to.be('true'); - }); - - await testSubjects.existOrFail('dscViewModeToggle'); - - await discover.selectTextBaseLang(); - - await testSubjects.missingOrFail('dscViewModeToggle'); - await testSubjects.existOrFail('discoverQueryTotalHits'); - - if (!useLegacyTable) { - await testSubjects.existOrFail('unifiedDataTableToolbar'); - } - }); - - it('should show ES|QL columns callout', async () => { - await testSubjects.missingOrFail('dscSelectedColumnsCallout'); - await unifiedFieldList.clickFieldListItemAdd('extension'); - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('dscSelectedColumnsCallout'); - }); + it('should show Documents tab', async () => { + await testSubjects.existOrFail('dscViewModeToggle'); + await testSubjects.existOrFail('unifiedDataTableToolbar'); + + const documentsTab = await testSubjects.find('dscViewModeDocumentButton'); + expect(await documentsTab.getAttribute('aria-selected')).to.be('true'); + }); + + it('should show an error callout', async () => { + await queryBar.setQuery('@message::'); // invalid + await queryBar.submitQuery(); + await header.waitUntilLoadingHasFinished(); + + await discover.showsErrorCallout(); + + await queryBar.clearQuery(); + await queryBar.submitQuery(); + await header.waitUntilLoadingHasFinished(); + + await testSubjects.missingOrFail('discoverErrorCalloutTitle'); + }); + + describe('Patterns tab (basic license)', function () { + this.tags('skipFIPS'); + + it('should not show', async function () { + await testSubjects.missingOrFail('dscViewModePatternAnalysisButton'); + }); + }); + + it('should not show Field Statistics tab', async () => { + await testSubjects.existOrFail('dscViewModeToggle'); + }); + + it('should not show view mode toggle for ES|QL searches', async () => { + await testSubjects.click('dscViewModeDocumentButton'); + + await retry.try(async () => { + const documentsTab = await testSubjects.find('dscViewModeDocumentButton'); + expect(await documentsTab.getAttribute('aria-selected')).to.be('true'); }); + + await testSubjects.existOrFail('dscViewModeToggle'); + + await discover.selectTextBaseLang(); + + await testSubjects.missingOrFail('dscViewModeToggle'); + await testSubjects.existOrFail('discoverQueryTotalHits'); + await testSubjects.existOrFail('unifiedDataTableToolbar'); + }); + + it('should show ES|QL columns callout', async () => { + await testSubjects.missingOrFail('dscSelectedColumnsCallout'); + await unifiedFieldList.clickFieldListItemAdd('extension'); + await header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('dscSelectedColumnsCallout'); }); }); } diff --git a/test/functional/apps/discover/group8/_hide_announcements.ts b/test/functional/apps/discover/group8/_hide_announcements.ts deleted file mode 100644 index 9dc11f9eefcac..0000000000000 --- a/test/functional/apps/discover/group8/_hide_announcements.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", 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 esArchiver = getService('esArchiver'); - const { common, discover, timePicker } = getPageObjects(['common', 'discover', 'timePicker']); - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const browser = getService('browser'); - const security = getService('security'); - - describe('test hide announcements', function () { - before(async function () { - await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'doc_table:legacy': true, - }); - await common.navigateToApp('discover'); - await timePicker.setDefaultAbsoluteRange(); - }); - - after(async () => { - await kibanaServer.uiSettings.replace({}); - }); - - it('should display callout', async function () { - await discover.selectIndexPattern('logstash-*'); - const calloutExists = await testSubjects.exists('dscDocumentExplorerLegacyCallout'); - expect(calloutExists).to.be(true); - }); - - it('should not display callout', async function () { - await kibanaServer.uiSettings.update({ hideAnnouncements: true }); - await browser.refresh(); - const calloutExists = await testSubjects.exists('dscDocumentExplorerLegacyCallout'); - expect(calloutExists).to.be(false); - }); - }); -} diff --git a/test/functional/apps/discover/group8/index.ts b/test/functional/apps/discover/group8/index.ts index 14b544e2c2015..46d5040fee298 100644 --- a/test/functional/apps/discover/group8/index.ts +++ b/test/functional/apps/discover/group8/index.ts @@ -23,7 +23,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { }); loadTestFile(require.resolve('./_default_route')); - loadTestFile(require.resolve('./_hide_announcements')); loadTestFile(require.resolve('./_flyouts')); }); } diff --git a/test/functional/apps/management/data_views/_scripted_fields_classic_table.ts b/test/functional/apps/management/data_views/_scripted_fields_classic_table.ts deleted file mode 100644 index 4f3d30222e496..0000000000000 --- a/test/functional/apps/management/data_views/_scripted_fields_classic_table.ts +++ /dev/null @@ -1,463 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -// Tests for 4 scripted fields; -// 1. Painless (number type) -// 2. Painless (string type) -// 3. Painless (boolean type) -// 4. Painless (date type) -// -// Each of these scripted fields has 4 tests (12 tests total); -// 1. Create scripted field -// 2. See the expected value of the scripted field in Discover doc view -// 3. Filter in Discover by the scripted field -// 4. Visualize with aggregation on the scripted field by clicking unifiedFieldList.clickFieldListItemVisualize - -import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const log = getService('log'); - const browser = getService('browser'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const filterBar = getService('filterBar'); - const docTable = getService('docTable'); - const PageObjects = getPageObjects([ - 'common', - 'header', - 'settings', - 'visualize', - 'discover', - 'timePicker', - 'unifiedFieldList', - ]); - - describe('scripted fields', function () { - this.tags(['skipFirefox']); - - before(async function () { - await browser.setWindowSize(1200, 800); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - await kibanaServer.uiSettings.replace({}); - await kibanaServer.uiSettings.update({ - 'doc_table:legacy': true, - }); - }); - - after(async function afterAll() { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - await kibanaServer.uiSettings.replace({}); - }); - - it('should not allow saving of invalid scripts', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - await PageObjects.settings.clickScriptedFieldsTab(); - await PageObjects.settings.clickAddScriptedField(); - await PageObjects.settings.setScriptedFieldName('doomedScriptedField'); - await PageObjects.settings.setScriptedFieldScript(`i n v a l i d s c r i p t`); - await PageObjects.settings.clickSaveScriptedField(); - await retry.try(async () => { - const invalidScriptErrorExists = await testSubjects.exists('invalidScriptError'); - expect(invalidScriptErrorExists).to.be(true); - }); - }); - - describe('testing regression for issue #33251', function describeIndexTests() { - const scriptedPainlessFieldName = 'ram_Pain_reg'; - - it('should create and edit scripted field', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10); - await PageObjects.settings.clickScriptedFieldsTab(); - await log.debug('add scripted field'); - const script = `1`; - await PageObjects.settings.addScriptedField( - scriptedPainlessFieldName, - 'painless', - 'number', - null, - '1', - script - ); - await retry.try(async function () { - expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be( - startingCount + 1 - ); - }); - - for (let i = 0; i < 3; i++) { - await PageObjects.settings.editScriptedField(scriptedPainlessFieldName); - const fieldSaveButton = await testSubjects.exists('fieldSaveButton'); - expect(fieldSaveButton).to.be(true); - await PageObjects.settings.clickSaveScriptedField(); - } - }); - }); - - describe('creating and using Painless numeric scripted fields', function describeIndexTests() { - const scriptedPainlessFieldName = 'ram_Pain1'; - - it('should create scripted field', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10); - await PageObjects.settings.clickScriptedFieldsTab(); - await log.debug('add scripted field'); - const script = `if (doc['machine.ram'].size() == 0) return -1; - else return doc['machine.ram'].value / (1024 * 1024 * 1024); - `; - await PageObjects.settings.addScriptedField( - scriptedPainlessFieldName, - 'painless', - 'number', - null, - '100', - script - ); - await retry.try(async function () { - expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be( - startingCount + 1 - ); - }); - }); - - it('should see scripted field value in Discover', async function () { - const fromTime = 'Sep 17, 2015 @ 06:31:44.000'; - const toTime = 'Sep 18, 2015 @ 18:31:44.000'; - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - - await retry.try(async function () { - await PageObjects.unifiedFieldList.clickFieldListItemAdd(scriptedPainlessFieldName); - }); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\n18'); - }); - }); - - // add a test to sort numeric scripted field - it('should sort scripted field value in Discover', async function () { - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`); - // after the first click on the scripted field, it becomes secondary sort after time. - // click on the timestamp twice to make it be the secondary sort key. - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 17, 2015 @ 10:53:14.181\n-1'); - }); - - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\n20'); - }); - }); - - it('should filter by scripted field value in Discover', async function () { - await PageObjects.unifiedFieldList.clickFieldListItem(scriptedPainlessFieldName); - await log.debug('filter by the first value (14) in the expanded scripted field list'); - await PageObjects.unifiedFieldList.clickFieldListPlusFilter( - scriptedPainlessFieldName, - '14' - ); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('31'); - }); - }); - - it('should visualize scripted field in vertical bar chart', async function () { - await filterBar.removeAllFilters(); - await PageObjects.unifiedFieldList.clickFieldListItemVisualize(scriptedPainlessFieldName); - await PageObjects.header.waitUntilLoadingHasFinished(); - // verify Lens opens a visualization - expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( - '@timestamp', - 'Median of ram_Pain1' - ); - }); - }); - - describe('creating and using Painless string scripted fields', function describeIndexTests() { - const scriptedPainlessFieldName2 = 'painString'; - - it('should create scripted field', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10); - await PageObjects.settings.clickScriptedFieldsTab(); - await log.debug('add scripted field'); - await PageObjects.settings.addScriptedField( - scriptedPainlessFieldName2, - 'painless', - 'string', - null, - '1', - "if (doc['response.raw'].value == '200') { return 'good'} else { return 'bad'}" - ); - await retry.try(async function () { - expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be( - startingCount + 1 - ); - }); - }); - - it('should see scripted field value in Discover', async function () { - const fromTime = 'Sep 17, 2015 @ 06:31:44.000'; - const toTime = 'Sep 18, 2015 @ 18:31:44.000'; - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - - await retry.try(async function () { - await PageObjects.unifiedFieldList.clickFieldListItemAdd(scriptedPainlessFieldName2); - }); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ngood'); - }); - }); - - // add a test to sort string scripted field - it('should sort scripted field value in Discover', async function () { - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - // after the first click on the scripted field, it becomes secondary sort after time. - // click on the timestamp twice to make it be the secondary sort key. - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 17, 2015 @ 09:48:40.594\nbad'); - }); - - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\ngood'); - }); - }); - - it('should filter by scripted field value in Discover', async function () { - await PageObjects.unifiedFieldList.clickFieldListItem(scriptedPainlessFieldName2); - await log.debug('filter by "bad" in the expanded scripted field list'); - await PageObjects.unifiedFieldList.clickFieldListPlusFilter( - scriptedPainlessFieldName2, - 'bad' - ); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('27'); - }); - await filterBar.removeAllFilters(); - }); - - it('should visualize scripted field in vertical bar chart', async function () { - await PageObjects.unifiedFieldList.clickFieldListItemVisualize(scriptedPainlessFieldName2); - await PageObjects.header.waitUntilLoadingHasFinished(); - // verify Lens opens a visualization - expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( - 'Top 5 values of painString' - ); - }); - }); - - describe('creating and using Painless boolean scripted fields', function describeIndexTests() { - const scriptedPainlessFieldName2 = 'painBool'; - - it('should create scripted field', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10); - await PageObjects.settings.clickScriptedFieldsTab(); - await log.debug('add scripted field'); - await PageObjects.settings.addScriptedField( - scriptedPainlessFieldName2, - 'painless', - 'boolean', - null, - '1', - "doc['response.raw'].value == '200'" - ); - await retry.try(async function () { - expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be( - startingCount + 1 - ); - }); - }); - - it('should see scripted field value in Discover', async function () { - const fromTime = 'Sep 17, 2015 @ 06:31:44.000'; - const toTime = 'Sep 18, 2015 @ 18:31:44.000'; - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - - await retry.try(async function () { - await PageObjects.unifiedFieldList.clickFieldListItemAdd(scriptedPainlessFieldName2); - }); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ntrue'); - }); - }); - - it('should filter by scripted field value in Discover', async function () { - await PageObjects.unifiedFieldList.clickFieldListItem(scriptedPainlessFieldName2); - await log.debug('filter by "true" in the expanded scripted field list'); - await PageObjects.unifiedFieldList.clickFieldListPlusFilter( - scriptedPainlessFieldName2, - 'true' - ); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('359'); - }); - await filterBar.removeAllFilters(); - }); - - // add a test to sort boolean - // existing bug: https://github.com/elastic/kibana/issues/75519 hence the issue is skipped. - it.skip('should sort scripted field value in Discover', async function () { - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - // after the first click on the scripted field, it becomes secondary sort after time. - // click on the timestamp twice to make it be the secondary sort key. - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('updateExpectedResultHere\ntrue'); - }); - - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('updateExpectedResultHere\nfalse'); - }); - }); - - it('should visualize scripted field in vertical bar chart', async function () { - await PageObjects.unifiedFieldList.clickFieldListItemVisualize(scriptedPainlessFieldName2); - await PageObjects.header.waitUntilLoadingHasFinished(); - // verify Lens opens a visualization - expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( - 'Top 5 values of painBool' - ); - }); - }); - - describe('creating and using Painless date scripted fields', function describeIndexTests() { - const scriptedPainlessFieldName2 = 'painDate'; - - it('should create scripted field', async function () { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.clickIndexPatternLogstash(); - const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10); - await PageObjects.settings.clickScriptedFieldsTab(); - await log.debug('add scripted field'); - await PageObjects.settings.addScriptedField( - scriptedPainlessFieldName2, - 'painless', - 'date', - { format: 'date', datePattern: 'YYYY-MM-DD HH:00' }, - '1', - "doc['utc_time'].value.toEpochMilli() + (1000) * 60 * 60" - ); - await retry.try(async function () { - expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be( - startingCount + 1 - ); - }); - }); - - it('should see scripted field value in Discover', async function () { - const fromTime = 'Sep 17, 2015 @ 19:22:00.000'; - const toTime = 'Sep 18, 2015 @ 07:00:00.000'; - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - - await retry.try(async function () { - await PageObjects.unifiedFieldList.clickFieldListItemAdd(scriptedPainlessFieldName2); - }); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('Sep 18, 2015 @ 06:52:55.953\n2015-09-18 07:00'); - }); - }); - - // add a test to sort date scripted field - // https://github.com/elastic/kibana/issues/75711 - it.skip('should sort scripted field value in Discover', async function () { - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - // after the first click on the scripted field, it becomes secondary sort after time. - // click on the timestamp twice to make it be the secondary sort key. - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await testSubjects.click('docTableHeaderFieldSort_@timestamp'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('updateExpectedResultHere\n2015-09-18 07:00'); - }); - - await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async function () { - const rowData = await PageObjects.discover.getDocTableIndexLegacy(1); - expect(rowData).to.be('updateExpectedResultHere\n2015-09-18 07:00'); - }); - }); - - it('should filter by scripted field value in Discover', async function () { - await PageObjects.header.waitUntilLoadingHasFinished(); - await docTable.toggleRowExpanded(); - const firstRow = await docTable.getDetailsRow(); - await docTable.addInclusiveFilter(firstRow, scriptedPainlessFieldName2); - await PageObjects.header.waitUntilLoadingHasFinished(); - - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('1'); - }); - await filterBar.removeAllFilters(); - }); - - it('should visualize scripted field in vertical bar chart', async function () { - await PageObjects.unifiedFieldList.clickFieldListItemVisualize(scriptedPainlessFieldName2); - await PageObjects.header.waitUntilLoadingHasFinished(); - // verify Lens opens a visualization - expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain('painDate'); - }); - }); - }); -} diff --git a/test/functional/apps/management/index.ts b/test/functional/apps/management/index.ts index 2300543f06d51..962aa41bd8ba3 100644 --- a/test/functional/apps/management/index.ts +++ b/test/functional/apps/management/index.ts @@ -31,7 +31,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./_mgmt_import_saved_objects')); loadTestFile(require.resolve('./data_views/_index_patterns_empty')); loadTestFile(require.resolve('./data_views/_scripted_fields')); - loadTestFile(require.resolve('./data_views/_scripted_fields_classic_table')); loadTestFile(require.resolve('./data_views/_runtime_fields')); loadTestFile(require.resolve('./data_views/_runtime_fields_composite')); loadTestFile(require.resolve('./data_views/_field_formatter')); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index e8a0de7fbc340..08bfdd8d9e43d 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -22,7 +22,6 @@ export class DiscoverPageObject extends FtrService { private readonly browser = this.ctx.getService('browser'); private readonly globalNav = this.ctx.getService('globalNav'); private readonly elasticChart = this.ctx.getService('elasticChart'); - private readonly docTable = this.ctx.getService('docTable'); private readonly config = this.ctx.getService('config'); private readonly dataGrid = this.ctx.getService('dataGrid'); private readonly kibanaServer = this.ctx.getService('kibanaServer'); @@ -43,12 +42,7 @@ export class DiscoverPageObject extends FtrService { } public async getDocTable() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - return this.docTable; - } else { - return this.dataGrid; - } + return this.dataGrid; } public async saveSearch( @@ -117,10 +111,6 @@ export class DiscoverPageObject extends FtrService { } public async getColumnHeaders() { - const isLegacy = await this.useLegacyTable(); - if (isLegacy) { - return await this.docTable.getHeaderFields('embeddedSavedSearchDocTable'); - } const table = await this.getDocTable(); return await table.getHeaderFields(); } @@ -366,17 +356,12 @@ export class DiscoverPageObject extends FtrService { return await table.getBodyRows(); } + // TODO: remove public async useLegacyTable() { return (await this.kibanaServer.uiSettings.get('doc_table:legacy')) === true; } public async getDocTableIndex(index: number, visibleText = false) { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - const row = await this.find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); - return await row.getVisibleText(); - } - const row = await this.dataGrid.getRow({ rowIndex: index - 1 }); const result = await Promise.all( row.map(async (cell) => { @@ -472,7 +457,7 @@ export class DiscoverPageObject extends FtrService { } public async getMarks() { - const table = await this.docTable.getTable(); + const table = await this.dataGrid.getTable(); const marks = await table.findAllByTagName('mark'); return await Promise.all(marks.map((mark) => mark.getVisibleText())); } diff --git a/test/functional/services/doc_table.ts b/test/functional/services/doc_table.ts deleted file mode 100644 index 0ca243b7b412b..0000000000000 --- a/test/functional/services/doc_table.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; -import { FtrService } from '../ftr_provider_context'; - -interface SelectOptions { - isAnchorRow?: boolean; - rowIndex?: number; -} - -export class DocTableService extends FtrService { - private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly retry = this.ctx.getService('retry'); - private readonly header = this.ctx.getPageObject('header'); - - public async getTable(selector?: string) { - return await this.testSubjects.find(selector ? selector : 'docTable'); - } - - public async getRowsText() { - const table = await this.getTable(); - const $ = await table.parseDomContent(); - return $.findTestSubjects('~docTableRow') - .toArray() - .map((row: any) => $(row).text().trim()); - } - - public async getBodyRows(): Promise { - const table = await this.getTable(); - return await table.findAllByTestSubject('~docTableRow'); - } - - public async getAnchorRow(): Promise { - const table = await this.getTable(); - return await table.findByTestSubject('~docTableAnchorRow'); - } - - public async getRow({ - isAnchorRow = false, - rowIndex = 0, - }: SelectOptions = {}): Promise { - return isAnchorRow ? await this.getAnchorRow() : (await this.getBodyRows())[rowIndex]; - } - - public async getDetailsRow(): Promise { - const table = await this.getTable(); - return await table.findByCssSelector('[data-test-subj~="docTableDetailsRow"]'); - } - - public async getAnchorDetailsRow(): Promise { - const table = await this.getTable(); - return await table.findByCssSelector( - '[data-test-subj~="docTableAnchorRow"] + [data-test-subj~="docTableDetailsRow"]' - ); - } - - public async clickRowToggle( - options: SelectOptions = { isAnchorRow: false, rowIndex: 0 } - ): Promise { - const row = await this.getRow(options); - const toggle = await row.findByTestSubject('~docTableExpandToggleColumn'); - await toggle.click(); - } - - public async getDetailsRows(): Promise { - const table = await this.getTable(); - return await table.findAllByCssSelector( - '[data-test-subj~="docTableRow"] + [data-test-subj~="docTableDetailsRow"]' - ); - } - - public async getRowActions({ isAnchorRow = false, rowIndex = 0 }: SelectOptions = {}): Promise< - WebElementWrapper[] - > { - const detailsRow = isAnchorRow - ? await this.getAnchorDetailsRow() - : (await this.getDetailsRows())[rowIndex]; - return await detailsRow.findAllByTestSubject('~docTableRowAction'); - } - - public async getFields(options: { isAnchorRow: boolean } = { isAnchorRow: false }) { - const table = await this.getTable(); - const $ = await table.parseDomContent(); - const rowLocator = options.isAnchorRow ? '~docTableAnchorRow' : '~docTableRow'; - const rows = $.findTestSubjects(rowLocator).toArray(); - return rows.map((row: any) => - $(row) - .find('[data-test-subj~="docTableField"]') - .toArray() - .map((field: any) => $(field).text()) - ); - } - - public async getHeaderFields(selector?: string): Promise { - const table = await this.getTable(selector); - const $ = await table.parseDomContent(); - return $.findTestSubjects('~docTableHeaderField') - .toArray() - .map((field: any) => $(field).text().trim()); - } - - public async getHeaders(selector?: string): Promise { - return this.getHeaderFields(selector); - } - - public async getTableDocViewRow( - detailsRow: WebElementWrapper, - fieldName: string - ): Promise { - return await detailsRow.findByTestSubject(`~tableDocViewRow-${fieldName}`); - } - - public async getAddInclusiveFilterButton( - tableDocViewRow: WebElementWrapper - ): Promise { - return await tableDocViewRow.findByTestSubject(`~addInclusiveFilterButton`); - } - - public async addInclusiveFilter(detailsRow: WebElementWrapper, fieldName: string): Promise { - const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); - const addInclusiveFilterButton = await this.getAddInclusiveFilterButton(tableDocViewRow); - await addInclusiveFilterButton.click(); - await this.header.awaitGlobalLoadingIndicatorHidden(); - } - - public async getRemoveInclusiveFilterButton( - tableDocViewRow: WebElementWrapper - ): Promise { - return await tableDocViewRow.findByTestSubject(`~removeInclusiveFilterButton`); - } - - public async removeInclusiveFilter( - detailsRow: WebElementWrapper, - fieldName: string - ): Promise { - const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); - const addInclusiveFilterButton = await this.getRemoveInclusiveFilterButton(tableDocViewRow); - await addInclusiveFilterButton.click(); - await this.header.awaitGlobalLoadingIndicatorHidden(); - } - - public async getAddExistsFilterButton( - tableDocViewRow: WebElementWrapper - ): Promise { - return await tableDocViewRow.findByTestSubject(`~addExistsFilterButton`); - } - - public async addExistsFilter(detailsRow: WebElementWrapper, fieldName: string): Promise { - const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); - const addInclusiveFilterButton = await this.getAddExistsFilterButton(tableDocViewRow); - await addInclusiveFilterButton.click(); - await this.header.awaitGlobalLoadingIndicatorHidden(); - } - - public async toggleRowExpanded({ - isAnchorRow = false, - rowIndex = 0, - }: SelectOptions = {}): Promise { - await this.clickRowToggle({ isAnchorRow, rowIndex }); - await this.header.awaitGlobalLoadingIndicatorHidden(); - return await this.retry.try(async () => { - const row = isAnchorRow ? await this.getAnchorRow() : (await this.getBodyRows())[rowIndex]; - const detailsRow = await row.findByXpath( - './following-sibling::*[@data-test-subj="docTableDetailsRow"]' - ); - return detailsRow.findByTestSubject('~docViewer'); - }); - } -} diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 77df85ef3e565..ccdc8cfec3957 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -30,7 +30,6 @@ import { DashboardDrilldownPanelActionsProvider, DashboardDrilldownsManageProvider, } from './dashboard'; -import { DocTableService } from './doc_table'; import { EmbeddingService } from './embedding'; import { FilterBarService } from './filter_bar'; import { FlyoutService } from './flyout'; @@ -62,7 +61,6 @@ export const services = { ...commonFunctionalUIServices, filterBar: FilterBarService, queryBar: QueryBarService, - docTable: DocTableService, png: PngService, screenshots: ScreenshotsService, snapshots: SnapshotsService, diff --git a/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts b/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts index 60a7f754933de..42c933f8792a8 100644 --- a/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts +++ b/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts @@ -221,7 +221,6 @@ export default function ({ }); it('downloads a PDF file with saved search given EuiDataGrid enabled', async function () { - await kibanaServer.uiSettings.update({ 'doc_table:legacy': false }); this.timeout(300000); await dashboard.navigateToApp(); await dashboard.loadSavedDashboard('Ecom Dashboard'); diff --git a/x-pack/test/functional/apps/discover/saved_searches.ts b/x-pack/test/functional/apps/discover/saved_searches.ts index 3b039c8da9eee..ee733b4c4c46d 100644 --- a/x-pack/test/functional/apps/discover/saved_searches.ts +++ b/x-pack/test/functional/apps/discover/saved_searches.ts @@ -28,7 +28,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json'; const defaultSettings = { defaultIndex: 'logstash-*', - 'doc_table:legacy': false, }; const from = 'Apr 27, 2019 @ 23:56:51.374'; @@ -47,7 +46,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.importExport.unload(ecommerceSOPath); - await kibanaServer.uiSettings.unset('doc_table:legacy'); await common.unsetTime(); }); diff --git a/x-pack/test/functional/apps/discover/value_suggestions.ts b/x-pack/test/functional/apps/discover/value_suggestions.ts index f949a890d90c2..21a577ece13bf 100644 --- a/x-pack/test/functional/apps/discover/value_suggestions.ts +++ b/x-pack/test/functional/apps/discover/value_suggestions.ts @@ -35,14 +35,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.importExport.load( 'x-pack/test/functional/fixtures/kbn_archiver/dashboard_drilldowns/drilldowns' ); - await kibanaServer.uiSettings.update({ - 'doc_table:legacy': false, - }); await timePicker.setDefaultAbsoluteRangeViaUiSettings(); }); after(async () => { - await kibanaServer.uiSettings.unset('doc_table:legacy'); await common.unsetTime(); await kibanaServer.savedObjects.cleanStandardList(); }); diff --git a/x-pack/test/functional/apps/discover/value_suggestions_non_timebased.ts b/x-pack/test/functional/apps/discover/value_suggestions_non_timebased.ts index b40c74bf06e41..47cc04b5b60fd 100644 --- a/x-pack/test/functional/apps/discover/value_suggestions_non_timebased.ts +++ b/x-pack/test/functional/apps/discover/value_suggestions_non_timebased.ts @@ -23,9 +23,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'test/functional/fixtures/kbn_archiver/index_pattern_without_timefield' ); await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' }); - await kibanaServer.uiSettings.update({ - 'doc_table:legacy': false, - }); }); after(async () => { @@ -34,7 +31,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); await kibanaServer.uiSettings.unset('defaultIndex'); - await kibanaServer.uiSettings.unset('doc_table:legacy'); }); it('shows all autosuggest options for a filter in discover context app', async () => {