From f14c199195a0755d7b400cf2a5804139484565c0 Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Fri, 22 Sep 2023 14:45:41 -0700 Subject: [PATCH] [Data Explorer] Delete legacy discover selenium tests (#5088) * delete legacy discover functional tests Signed-off-by: abbyhu2000 * remove discover folder in config file Signed-off-by: abbyhu2000 --------- Signed-off-by: abbyhu2000 --- test/functional/apps/context/_date_nanos.js | 1 - .../context/_date_nanos_custom_timestamp.js | 1 - test/functional/apps/context/_filters.js | 4 - test/functional/apps/context/index.js | 1 - .../apps/dashboard/dashboard_state.js | 5 - .../apps/dashboard/panel_context_menu.ts | 4 - test/functional/apps/discover/_date_nanos.js | 69 ---- .../apps/discover/_date_nanos_mixed.js | 72 ---- test/functional/apps/discover/_discover.js | 376 ------------------ .../apps/discover/_discover_histogram.ts | 92 ----- .../apps/discover/_doc_navigation.js | 104 ----- test/functional/apps/discover/_doc_table.ts | 173 -------- test/functional/apps/discover/_errors.ts | 63 --- test/functional/apps/discover/_field_data.js | 115 ------ .../apps/discover/_field_visualize.ts | 182 --------- .../apps/discover/_filter_editor.js | 81 ---- .../discover/_indexpattern_with_encoded_id.ts | 65 --- .../_indexpattern_without_timefield.ts | 71 ---- test/functional/apps/discover/_inspector.js | 82 ---- .../functional/apps/discover/_large_string.js | 103 ----- .../apps/discover/_saved_queries.js | 186 --------- .../functional/apps/discover/_shared_links.js | 194 --------- test/functional/apps/discover/_sidebar.js | 91 ----- .../apps/discover/_source_filters.js | 72 ---- test/functional/apps/discover/index.js | 65 --- test/functional/apps/home/_navigation.ts | 3 - .../apps/management/_handle_alias.js | 4 - .../apps/management/_scripted_fields.js | 3 - test/functional/apps/visualize/_lab_mode.js | 6 - test/functional/apps/visualize/index.ts | 1 - test/functional/config.js | 3 +- test/functional/page_objects/discover_page.ts | 4 + .../services/dashboard/visualizations.ts | 6 - 33 files changed, 5 insertions(+), 2297 deletions(-) delete mode 100644 test/functional/apps/discover/_date_nanos.js delete mode 100644 test/functional/apps/discover/_date_nanos_mixed.js delete mode 100644 test/functional/apps/discover/_discover.js delete mode 100644 test/functional/apps/discover/_discover_histogram.ts delete mode 100644 test/functional/apps/discover/_doc_navigation.js delete mode 100644 test/functional/apps/discover/_doc_table.ts delete mode 100644 test/functional/apps/discover/_errors.ts delete mode 100644 test/functional/apps/discover/_field_data.js delete mode 100644 test/functional/apps/discover/_field_visualize.ts delete mode 100644 test/functional/apps/discover/_filter_editor.js delete mode 100644 test/functional/apps/discover/_indexpattern_with_encoded_id.ts delete mode 100644 test/functional/apps/discover/_indexpattern_without_timefield.ts delete mode 100644 test/functional/apps/discover/_inspector.js delete mode 100644 test/functional/apps/discover/_large_string.js delete mode 100644 test/functional/apps/discover/_saved_queries.js delete mode 100644 test/functional/apps/discover/_shared_links.js delete mode 100644 test/functional/apps/discover/_sidebar.js delete mode 100644 test/functional/apps/discover/_source_filters.js delete mode 100644 test/functional/apps/discover/index.js diff --git a/test/functional/apps/context/_date_nanos.js b/test/functional/apps/context/_date_nanos.js index 23350c81b18..e612c8d3c41 100644 --- a/test/functional/apps/context/_date_nanos.js +++ b/test/functional/apps/context/_date_nanos.js @@ -52,7 +52,6 @@ export default function ({ getService, getPageObjects }) { await opensearchDashboardsServer.uiSettings.update({ 'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`, 'context:step': `${TEST_STEP_SIZE}`, - 'discover:v2': false, }); }); diff --git a/test/functional/apps/context/_date_nanos_custom_timestamp.js b/test/functional/apps/context/_date_nanos_custom_timestamp.js index 52864a0d7ea..2c6bef3a366 100644 --- a/test/functional/apps/context/_date_nanos_custom_timestamp.js +++ b/test/functional/apps/context/_date_nanos_custom_timestamp.js @@ -52,7 +52,6 @@ export default function ({ getService, getPageObjects }) { await opensearchDashboardsServer.uiSettings.update({ 'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`, 'context:step': `${TEST_STEP_SIZE}`, - 'discover:v2': false, }); }); diff --git a/test/functional/apps/context/_filters.js b/test/functional/apps/context/_filters.js index 17219a83623..48661baae55 100644 --- a/test/functional/apps/context/_filters.js +++ b/test/functional/apps/context/_filters.js @@ -38,16 +38,12 @@ export default function ({ getService, getPageObjects }) { const docTable = getService('docTable'); const filterBar = getService('filterBar'); const retry = getService('retry'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); const browser = getService('browser'); const PageObjects = getPageObjects(['common', 'context']); describe('context filters', function contextSize() { beforeEach(async function () { - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); await browser.refresh(); await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, { columns: TEST_COLUMN_NAMES, diff --git a/test/functional/apps/context/index.js b/test/functional/apps/context/index.js index 07fbfe00ac2..7c59b18668b 100644 --- a/test/functional/apps/context/index.js +++ b/test/functional/apps/context/index.js @@ -43,7 +43,6 @@ export default function ({ getService, getPageObjects, loadTestFile }) { await opensearchArchiver.load('visualize'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: 'logstash-*', - 'discover:v2': false, }); await PageObjects.common.navigateToApp('discover'); }); diff --git a/test/functional/apps/dashboard/dashboard_state.js b/test/functional/apps/dashboard/dashboard_state.js index e23a2caba0c..ed39d5e4268 100644 --- a/test/functional/apps/dashboard/dashboard_state.js +++ b/test/functional/apps/dashboard/dashboard_state.js @@ -53,16 +53,11 @@ export default function ({ getService, getPageObjects }) { const retry = getService('retry'); const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardAddPanel = getService('dashboardAddPanel'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); describe('dashboard state', function describeIndexTests() { before(async function () { await PageObjects.dashboard.initTests(); await PageObjects.dashboard.preserveCrossAppState(); - - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); await browser.refresh(); }); diff --git a/test/functional/apps/dashboard/panel_context_menu.ts b/test/functional/apps/dashboard/panel_context_menu.ts index 07af447d4e1..ddef33b265b 100644 --- a/test/functional/apps/dashboard/panel_context_menu.ts +++ b/test/functional/apps/dashboard/panel_context_menu.ts @@ -38,7 +38,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardVisualizations = getService('dashboardVisualizations'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); const listingTable = getService('listingTable'); const PageObjects = getPageObjects([ 'dashboard', @@ -126,9 +125,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const searchName = 'my search'; before(async () => { - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); await browser.refresh(); await PageObjects.header.clickDiscover(); await PageObjects.discover.clickNewSearchButton(); diff --git a/test/functional/apps/discover/_date_nanos.js b/test/functional/apps/discover/_date_nanos.js deleted file mode 100644 index e96d507087f..00000000000 --- a/test/functional/apps/discover/_date_nanos.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const opensearchArchiver = getService('opensearchArchiver'); - const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const security = getService('security'); - const fromTime = 'Sep 22, 2019 @ 20:31:44.000'; - const toTime = 'Sep 23, 2019 @ 03:31:44.000'; - - describe('date_nanos', function () { - before(async function () { - await opensearchArchiver.loadIfNeeded('date_nanos'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'date-nanos', - 'discover:v2': false, - }); - await security.testUser.setRoles([ - 'opensearch_dashboards_admin', - 'opensearch_dashboards_date_nanos', - ]); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - }); - - after(async function unloadMakelogs() { - await security.testUser.restoreDefaults(); - await opensearchArchiver.unload('date_nanos'); - }); - - it('should show a timestamp with nanoseconds in the first result row', async function () { - const time = await PageObjects.timePicker.getTimeConfig(); - expect(time.start).to.be(fromTime); - expect(time.end).to.be(toTime); - const rowData = await PageObjects.discover.getDocTableIndex(1); - expect(rowData.startsWith('Sep 22, 2019 @ 23:50:13.253123345')).to.be.ok(); - }); - }); -} diff --git a/test/functional/apps/discover/_date_nanos_mixed.js b/test/functional/apps/discover/_date_nanos_mixed.js deleted file mode 100644 index 05b94d3d1d6..00000000000 --- a/test/functional/apps/discover/_date_nanos_mixed.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const opensearchArchiver = getService('opensearchArchiver'); - const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const security = getService('security'); - const fromTime = 'Jan 1, 2019 @ 00:00:00.000'; - const toTime = 'Jan 1, 2019 @ 23:59:59.999'; - - describe('date_nanos_mixed', function () { - before(async function () { - await opensearchArchiver.loadIfNeeded('date_nanos_mixed'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'timestamp-*', - 'discover:v2': false, - }); - await security.testUser.setRoles([ - 'opensearch_dashboards_admin', - 'opensearch_dashboards_date_nanos_mixed', - ]); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - }); - - after(async () => { - await security.testUser.restoreDefaults(); - opensearchArchiver.unload('date_nanos_mixed'); - }); - - it('shows a list of records of indices with date & date_nanos fields in the right order', async function () { - const rowData1 = await PageObjects.discover.getDocTableIndex(1); - expect(rowData1.startsWith('Jan 1, 2019 @ 12:10:30.124000000')).to.be.ok(); - const rowData2 = await PageObjects.discover.getDocTableIndex(3); - expect(rowData2.startsWith('Jan 1, 2019 @ 12:10:30.123498765')).to.be.ok(); - const rowData3 = await PageObjects.discover.getDocTableIndex(5); - expect(rowData3.startsWith('Jan 1, 2019 @ 12:10:30.123456789')).to.be.ok(); - const rowData4 = await PageObjects.discover.getDocTableIndex(7); - expect(rowData4.startsWith('Jan 1, 2019 @ 12:10:30.123000000')).to.be.ok(); - }); - }); -} diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js deleted file mode 100644 index d132454a090..00000000000 --- a/test/functional/apps/discover/_discover.js +++ /dev/null @@ -1,376 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const browser = getService('browser'); - const log = getService('log'); - const retry = getService('retry'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const queryBar = getService('queryBar'); - const inspector = getService('inspector'); - const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:v2': false, - }; - - describe('discover app', function describeIndexTests() { - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - - // delete .kibana index and update configDoc - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - log.debug('discover'); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - describe('query', function () { - const queryName1 = 'Query # 1'; - - it('should show correct time range string by timepicker', async function () { - const time = await PageObjects.timePicker.getTimeConfig(); - expect(time.start).to.be(PageObjects.timePicker.defaultStartTime); - expect(time.end).to.be(PageObjects.timePicker.defaultEndTime); - }); - - it('save query should show toast message and display query name', async function () { - await PageObjects.discover.saveSearch(queryName1); - const actualQueryNameString = await PageObjects.discover.getCurrentQueryName(); - expect(actualQueryNameString).to.be(queryName1); - }); - - it('load query should show query name', async function () { - await PageObjects.discover.loadSavedSearch(queryName1); - - await retry.try(async function () { - expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName1); - }); - }); - - it('renaming a saved query should modify name in breadcrumb', async function () { - const queryName2 = 'Modified Query # 1'; - await PageObjects.discover.loadSavedSearch(queryName1); - await PageObjects.discover.saveSearch(queryName2); - - await retry.try(async function () { - expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName2); - }); - }); - - it('should show the correct hit count', async function () { - const expectedHitCount = '14,004'; - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount); - }); - }); - - it('should show correct time range string in chart', async function () { - const actualTimeString = await PageObjects.discover.getChartTimespan(); - const expectedTimeString = `${PageObjects.timePicker.defaultStartTime} - ${PageObjects.timePicker.defaultEndTime}`; - expect(actualTimeString).to.be(expectedTimeString); - }); - - it('should modify the time range when a bar is clicked', async function () { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.discover.clickHistogramBar(); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const time = await PageObjects.timePicker.getTimeConfig(); - expect(time.start).to.be('Sep 21, 2015 @ 09:00:00.000'); - expect(time.end).to.be('Sep 21, 2015 @ 12:00:00.000'); - await retry.waitFor('doc table to contain the right search result', async () => { - const rowData = await PageObjects.discover.getDocTableField(1); - log.debug(`The first timestamp value in doc table: ${rowData}`); - return rowData.includes('Sep 21, 2015 @ 11:59:22.316'); - }); - }); - - it('should modify the time range when the histogram is brushed', async function () { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.discover.brushHistogram(); - await PageObjects.discover.waitUntilSearchingHasFinished(); - - const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours(); - expect(Math.round(newDurationHours)).to.be(24); - - await retry.waitFor('doc table to contain the right search result', async () => { - const rowData = await PageObjects.discover.getDocTableField(1); - log.debug(`The first timestamp value in doc table: ${rowData}`); - const dateParsed = Date.parse(rowData); - //compare against the parsed date of Sep 20, 2015 @ 17:30:00.000 and Sep 20, 2015 @ 23:30:00.000 - return dateParsed >= 1442770200000 && dateParsed <= 1442791800000; - }); - }); - - it('should show correct initial chart interval of Auto', async function () { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const actualInterval = await PageObjects.discover.getChartInterval(); - - const expectedInterval = 'Auto'; - expect(actualInterval).to.be(expectedInterval); - }); - - it('should show Auto chart interval', async function () { - const expectedChartInterval = 'Auto'; - - const actualInterval = await PageObjects.discover.getChartInterval(); - expect(actualInterval).to.be(expectedChartInterval); - }); - - it('should not show "no results"', async () => { - const isVisible = await PageObjects.discover.hasNoResults(); - expect(isVisible).to.be(false); - }); - - it('should reload the saved search with persisted query to show the initial hit count', async function () { - // apply query some changes - await queryBar.setQuery('test'); - await queryBar.submitQuery(); - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('22'); - }); - - // reset to persisted state - await PageObjects.discover.clickResetSavedSearchButton(); - const expectedHitCount = '14,004'; - await retry.try(async function () { - expect(await queryBar.getQueryString()).to.be(''); - expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount); - }); - }); - }); - - describe('query #2, which has an empty time range', () => { - const fromTime = 'Jun 11, 1999 @ 09:22:11.000'; - const toTime = 'Jun 12, 1999 @ 11:21:04.000'; - - before(async () => { - log.debug('setAbsoluteRangeForAnotherQuery'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.waitUntilSearchingHasFinished(); - }); - - it('should show "no results"', async () => { - const isVisible = await PageObjects.discover.hasNoResults(); - expect(isVisible).to.be(true); - }); - - it('should suggest a new time range is picked', async () => { - const isVisible = await PageObjects.discover.hasNoResultsTimepicker(); - expect(isVisible).to.be(true); - }); - }); - - describe('nested query', () => { - before(async () => { - log.debug('setAbsoluteRangeForAnotherQuery'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.discover.waitUntilSearchingHasFinished(); - }); - - it('should support querying on nested fields', async function () { - await queryBar.setQuery('nestedField:{ child: nestedValue }'); - await queryBar.submitQuery(); - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('1'); - }); - }); - }); - - describe('data-shared-item', function () { - it('should have correct data-shared-item title and description', async () => { - const expected = { - title: 'A Saved Search', - description: 'A Saved Search Description', - }; - - await retry.try(async () => { - await PageObjects.discover.loadSavedSearch(expected.title); - const { - title, - description, - } = await PageObjects.common.getSharedItemTitleAndDescription(); - expect(title).to.eql(expected.title); - expect(description).to.eql(expected.description); - }); - }); - }); - - describe('time zone switch', () => { - // skipping this until we get an elastic-chart alternative to check the ticks value - it.skip('should show ticks in the correct time zone after switching', async function () { - await opensearchDashboardsServer.uiSettings.replace({ 'dateFormat:tz': 'America/Phoenix' }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - - const maxTicks = [ - '2015-09-20 00:00', - '2015-09-20 12:00', - '2015-09-21 00:00', - '2015-09-21 12:00', - '2015-09-22 00:00', - '2015-09-22 12:00', - '2015-09-23 00:00', - '2015-09-23 12:00', - ]; - - await retry.try(async function () { - for (const tick of await PageObjects.discover.getBarChartXTicks()) { - if (!maxTicks.includes(tick)) { - throw new Error(`unexpected x-axis tick "${tick}"`); - } - } - }); - }); - it('should show bars in the correct time zone after switching', async function () { - await opensearchDashboardsServer.uiSettings.replace({ - 'dateFormat:tz': 'America/Phoenix', - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - await queryBar.clearQuery(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - - log.debug( - 'check that the newest doc timestamp is now -7 hours from the UTC time in the first test' - ); - const rowData = await PageObjects.discover.getDocTableIndex(1); - expect(rowData.startsWith('Sep 22, 2015 @ 16:50:13.253')).to.be.ok(); - }); - }); - describe('usage of discover:searchOnPageLoad', () => { - it('should fetch data from OpenSearch initially when discover:searchOnPageLoad is false', async function () { - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:searchOnPageLoad': false, - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - - expect(await PageObjects.discover.getNrOfFetches()).to.be(0); - }); - - it('should not fetch data from OpenSearch initially when discover:searchOnPageLoad is true', async function () { - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:searchOnPageLoad': true, - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - - expect(await PageObjects.discover.getNrOfFetches()).to.be(1); - }); - }); - - describe('invalid time range in URL', function () { - it('should get the default timerange', async function () { - const prevTime = await PageObjects.timePicker.getTimeConfig(); - await PageObjects.common.navigateToUrl('discover', '#/?_g=(time:(from:now-15m,to:null))', { - useActualUrl: true, - }); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - const time = await PageObjects.timePicker.getTimeConfig(); - expect(time.start).to.be(prevTime.start); - expect(time.end).to.be(prevTime.end); - }); - }); - - describe('empty query', function () { - it('should update the histogram timerange when the query is resubmitted', async function () { - await opensearchDashboardsServer.uiSettings.update({ - 'timepicker:timeDefaults': '{ "from": "2015-09-18T19:37:13.000Z", "to": "now"}', - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitOpenSearchDashboardsChrome(); - const initialTimeString = await PageObjects.discover.getChartTimespan(); - await queryBar.submitQuery(); - const refreshedTimeString = await PageObjects.discover.getChartTimespan(); - expect(refreshedTimeString).not.to.be(initialTimeString); - }); - }); - - describe('managing fields', function () { - it('should add a field, sort by it, remove it and also sorting by it', async function () { - await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.discover.clickFieldListItemAdd('_score'); - await PageObjects.discover.clickFieldSort('_score'); - const currentUrlWithScore = await browser.getCurrentUrl(); - expect(currentUrlWithScore).to.contain('_score'); - await PageObjects.discover.clickFieldListItemAdd('_score'); - const currentUrlWithoutScore = await browser.getCurrentUrl(); - expect(currentUrlWithoutScore).not.to.contain('_score'); - }); - }); - - describe('refresh interval', function () { - it('should refetch when autofresh is enabled', async () => { - const intervalS = 5; - await PageObjects.timePicker.startAutoRefresh(intervalS); - - // check inspector panel request stats for timestamp - await inspector.open(); - - const getRequestTimestamp = async () => { - const requestStats = await inspector.getTableData(); - const requestTimestamp = requestStats.filter((r) => - r[0].includes('Request timestamp') - )[0][1]; - return requestTimestamp; - }; - - const requestTimestampBefore = await getRequestTimestamp(); - await retry.waitFor('refetch because of refresh interval', async () => { - const requestTimestampAfter = await getRequestTimestamp(); - log.debug( - `Timestamp before: ${requestTimestampBefore}, Timestamp after: ${requestTimestampAfter}` - ); - return requestTimestampBefore !== requestTimestampAfter; - }); - }); - - after(async () => { - await inspector.close(); - await PageObjects.timePicker.pauseAutoRefresh(); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_discover_histogram.ts b/test/functional/apps/discover/_discover_histogram.ts deleted file mode 100644 index f32a85add6f..00000000000 --- a/test/functional/apps/discover/_discover_histogram.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchChart = getService('opensearchChart'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const security = getService('security'); - const PageObjects = getPageObjects(['settings', 'common', 'discover', 'header', 'timePicker']); - const defaultSettings = { - defaultIndex: 'long-window-logstash-*', - 'dateFormat:tz': 'Europe/Berlin', - 'discover:v2': false, - }; - - describe('discover histogram', function describeIndexTests() { - before(async () => { - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchArchiver.load('long_window_logstash'); - await opensearchArchiver.load('long_window_logstash_index_pattern'); - await security.testUser.setRoles(['opensearch_dashboards_admin', 'long_window_logstash']); - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - await PageObjects.common.navigateToApp('discover'); - }); - after(async () => { - await opensearchArchiver.unload('long_window_logstash'); - await opensearchArchiver.unload('long_window_logstash_index_pattern'); - await security.testUser.restoreDefaults(); - }); - - async function prepareTest(fromTime: string, toTime: string, interval: string) { - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.waitUntilSearchingHasFinished(); - await PageObjects.discover.setChartInterval(interval); - await PageObjects.header.waitUntilLoadingHasFinished(); - } - - it('should visualize monthly data with different day intervals', async () => { - const fromTime = 'Nov 01, 2017 @ 00:00:00.000'; - const toTime = 'Mar 21, 2018 @ 00:00:00.000'; - await prepareTest(fromTime, toTime, 'Month'); - const chartCanvasExist = await opensearchChart.canvasExists(); - expect(chartCanvasExist).to.be(true); - }); - it('should visualize weekly data with within DST changes', async () => { - const fromTime = 'Mar 01, 2018 @ 00:00:00.000'; - const toTime = 'May 01, 2018 @ 00:00:00.000'; - await prepareTest(fromTime, toTime, 'Week'); - const chartCanvasExist = await opensearchChart.canvasExists(); - expect(chartCanvasExist).to.be(true); - }); - it('should visualize monthly data with different years scaled to 30 days', async () => { - const fromTime = 'Jan 01, 2010 @ 00:00:00.000'; - const toTime = 'Mar 21, 2019 @ 00:00:00.000'; - await prepareTest(fromTime, toTime, 'Day'); - const chartCanvasExist = await opensearchChart.canvasExists(); - expect(chartCanvasExist).to.be(true); - const chartIntervalIconTip = await PageObjects.discover.getChartIntervalWarningIcon(); - expect(chartIntervalIconTip).to.be(true); - }); - }); -} diff --git a/test/functional/apps/discover/_doc_navigation.js b/test/functional/apps/discover/_doc_navigation.js deleted file mode 100644 index 6978c363689..00000000000 --- a/test/functional/apps/discover/_doc_navigation.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const log = getService('log'); - const docTable = getService('docTable'); - const filterBar = getService('filterBar'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'context']); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const retry = getService('retry'); - - describe('doc link in discover', function contextSize() { - beforeEach(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.loadIfNeeded('discover'); - - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.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(); - }); - - const hasDocHit = await testSubjects.exists('doc-hit'); - expect(hasDocHit).to.be(true); - }); - - it('add filter should create an exists filter if value is null (#7189)', async function () { - await PageObjects.discover.waitUntilSearchingHasFinished(); - // Filter special document - await filterBar.addFilter('agent', 'is', 'Missing/Fields'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - - await retry.try(async () => { - // navigate to the doc view - await docTable.clickRowToggle({ rowIndex: 0 }); - - const details = await docTable.getDetailsRow(); - await docTable.addInclusiveFilter(details, 'referer'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - - const hasInclusiveFilter = await filterBar.hasFilter( - 'referer', - 'exists', - true, - false, - true - ); - expect(hasInclusiveFilter).to.be(true); - - await docTable.removeInclusiveFilter(details, 'referer'); - await PageObjects.discover.waitUntilSearchingHasFinished(); - const hasExcludeFilter = await filterBar.hasFilter('referer', 'exists', true, false, false); - expect(hasExcludeFilter).to.be(true); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_doc_table.ts b/test/functional/apps/discover/_doc_table.ts deleted file mode 100644 index 166aa954c36..00000000000 --- a/test/functional/apps/discover/_doc_table.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const docTable = getService('docTable'); - const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:v2': false, - }; - - describe('discover doc table', function describeIndexTests() { - const defaultRowsLimit = 50; - const rowsHardLimit = 500; - - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - log.debug('discover doc table'); - await PageObjects.common.navigateToApp('discover'); - }); - - beforeEach(async function () { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - it('should show the first 50 rows by default', async function () { - // with the default range the number of hits is ~14000 - const rows = await PageObjects.discover.getDocTableRows(); - expect(rows.length).to.be(defaultRowsLimit); - }); - - it('should refresh the table content when changing time window', async function () { - const initialRows = await PageObjects.discover.getDocTableRows(); - - const fromTime = 'Sep 20, 2015 @ 23:00:00.000'; - const toTime = 'Sep 20, 2015 @ 23:14:00.000'; - - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.waitUntilSearchingHasFinished(); - - const finalRows = await PageObjects.discover.getDocTableRows(); - expect(finalRows.length).to.be.below(initialRows.length); - }); - - it(`should load up to ${rowsHardLimit} rows when scrolling at the end of the table`, async function () { - const initialRows = await PageObjects.discover.getDocTableRows(); - // click the Skip to the end of the table - await PageObjects.discover.skipToEndOfDocTable(); - // now count the rows - const finalRows = await PageObjects.discover.getDocTableRows(); - expect(finalRows.length).to.be.above(initialRows.length); - expect(finalRows.length).to.be(rowsHardLimit); - }); - - it('should go the end of the table when using the accessible Skip button', async function () { - // click the Skip to the end of the table - await PageObjects.discover.skipToEndOfDocTable(); - // now check the footer text content - const footer = await PageObjects.discover.getDocTableFooter(); - log.debug(await footer.getVisibleText()); - expect(await footer.getVisibleText()).to.have.string(rowsHardLimit); - }); - - 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('docTableRowDetailsTitle'); - 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 PageObjects.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? - }); - }); - }); - - describe('add and remove columns', function () { - const extraColumns = ['phpmemory', 'ip']; - - afterEach(async function () { - for (const column of extraColumns) { - await PageObjects.discover.clickFieldListItemRemove(column); - await PageObjects.header.waitUntilLoadingHasFinished(); - } - }); - - it('should add more columns to the table', async function () { - const [column] = extraColumns; - await PageObjects.discover.findFieldByName(column); - log.debug(`add a ${column} column`); - await PageObjects.discover.clickFieldListItemAdd(column); - await PageObjects.header.waitUntilLoadingHasFinished(); - // test the header now - expect(await PageObjects.discover.getDocHeader()).to.have.string(column); - }); - - it('should remove columns from the table', async function () { - for (const column of extraColumns) { - await PageObjects.discover.clearFieldSearchInput(); - await PageObjects.discover.findFieldByName(column); - log.debug(`add a ${column} column`); - await PageObjects.discover.clickFieldListItemAdd(column); - await PageObjects.header.waitUntilLoadingHasFinished(); - } - // remove the second column - await PageObjects.discover.clickFieldListItemAdd(extraColumns[1]); - await PageObjects.header.waitUntilLoadingHasFinished(); - // test that the second column is no longer there - expect(await PageObjects.discover.getDocHeader()).to.not.have.string(extraColumns[1]); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_errors.ts b/test/functional/apps/discover/_errors.ts deleted file mode 100644 index 3251b9215e1..00000000000 --- a/test/functional/apps/discover/_errors.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const toasts = getService('toasts'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); - - describe('errors', function describeIndexTests() { - before(async function () { - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchArchiver.load('invalid_scripted_field'); - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); - await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await PageObjects.common.navigateToApp('discover'); - }); - - after(async function () { - await opensearchArchiver.unload('invalid_scripted_field'); - }); - - describe('invalid scripted field error', () => { - it('is rendered', async () => { - const toast = await toasts.getToastElement(1); - const painlessStackTrace = await toast.findByTestSubject('painlessStackTrace'); - expect(painlessStackTrace).not.to.be(undefined); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js deleted file mode 100644 index 90de964dc4e..00000000000 --- a/test/functional/apps/discover/_field_data.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const retry = getService('retry'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const toasts = getService('toasts'); - const queryBar = getService('queryBar'); - const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']); - - // FLAKY: https://github.com/elastic/kibana/issues/78689 - describe.skip('discover tab', function describeIndexTests() { - this.tags('includeFirefox'); - before(async function () { - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchArchiver.load('discover'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:v2': false, - }); - await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); - await PageObjects.common.navigateToApp('discover'); - }); - describe('field data', function () { - it('search php should show the correct hit count', async function () { - const expectedHitCount = '445'; - await retry.try(async function () { - await queryBar.setQuery('php'); - await queryBar.submitQuery(); - const hitCount = await PageObjects.discover.getHitCount(); - expect(hitCount).to.be(expectedHitCount); - }); - }); - - it('the search term should be highlighted in the field data', async function () { - // marks is the style that highlights the text in yellow - const marks = await PageObjects.discover.getMarks(); - expect(marks.length).to.be(50); - expect(marks.indexOf('php')).to.be(0); - }); - - it('search type:apache should show the correct hit count', async function () { - const expectedHitCount = '11,156'; - await queryBar.setQuery('type:apache'); - await queryBar.submitQuery(); - await retry.try(async function tryingForTime() { - const hitCount = await PageObjects.discover.getHitCount(); - expect(hitCount).to.be(expectedHitCount); - }); - }); - - it('doc view should show Time and _source columns', async function () { - const expectedHeader = 'Time _source'; - const Docheader = await PageObjects.discover.getDocHeader(); - expect(Docheader).to.be(expectedHeader); - }); - - it('doc view should sort ascending', async function () { - const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000'; - await PageObjects.discover.clickDocSortDown(); - - // 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 PageObjects.common.sleep(2000); - await retry.try(async function tryingForTime() { - const rowData = await PageObjects.discover.getDocTableIndex(1); - - expect(rowData.startsWith(expectedTimeStamp)).to.be.ok(); - }); - }); - - it('a bad syntax query should show an error message', async function () { - const expectedError = - 'Expected ":", "<", "<=", ">", ">=", AND, OR, end of input, ' + - 'whitespace but "(" found.'; - await queryBar.setQuery('xxx(yyy))'); - await queryBar.submitQuery(); - const { message } = await toasts.getErrorToast(); - expect(message).to.contain(expectedError); - await toasts.dismissToast(); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts deleted file mode 100644 index 50ecb54d27f..00000000000 --- a/test/functional/apps/discover/_field_visualize.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const opensearchArchiver = getService('opensearchArchiver'); - const filterBar = getService('filterBar'); - const inspector = getService('inspector'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const log = getService('log'); - const queryBar = getService('queryBar'); - const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'visualize']); - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:v2': false, - }; - - describe('discover field visualize button', function () { - // unskipped on cloud as these tests test the navigation - // from Discover to Visualize which happens only on OSS - this.tags(['skipCloud']); - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - }); - - beforeEach(async () => { - log.debug('go to discover'); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - it('should be able to visualize a field and save the visualization', async () => { - await PageObjects.discover.findFieldByName('type'); - log.debug('visualize a type field'); - await PageObjects.discover.clickFieldListItemVisualize('type'); - await PageObjects.visualize.saveVisualizationExpectSuccess('Top 5 server types'); - }); - - it('should visualize a field in area chart', async () => { - await PageObjects.discover.findFieldByName('phpmemory'); - log.debug('visualize a phpmemory field'); - await PageObjects.discover.clickFieldListItemVisualize('phpmemory'); - await PageObjects.header.waitUntilLoadingHasFinished(); - const expectedTableData = [ - ['0', '10'], - ['58,320', '2'], - ['171,080', '2'], - ['3,240', '1'], - ['3,520', '1'], - ['3,880', '1'], - ['4,120', '1'], - ['4,640', '1'], - ['4,760', '1'], - ['5,680', '1'], - ['7,160', '1'], - ['7,400', '1'], - ['8,400', '1'], - ['8,800', '1'], - ['8,960', '1'], - ['9,400', '1'], - ['10,280', '1'], - ['10,840', '1'], - ['13,080', '1'], - ['13,360', '1'], - ]; - await inspector.open(); - await inspector.expectTableData(expectedTableData); - await inspector.close(); - }); - - it('should not show the "Visualize" button for geo field', async () => { - await PageObjects.discover.findFieldByName('geo.coordinates'); - log.debug('visualize a geo field'); - await PageObjects.discover.expectMissingFieldListItemVisualize('geo.coordinates'); - }); - - it('should preserve app filters in visualize', async () => { - await filterBar.addFilter('bytes', 'is between', '3500', '4000'); - await PageObjects.discover.findFieldByName('geo.src'); - log.debug('visualize a geo.src field with filter applied'); - await PageObjects.discover.clickFieldListItemVisualize('geo.src'); - await PageObjects.header.waitUntilLoadingHasFinished(); - - expect(await filterBar.hasFilter('bytes', '3,500 to 4,000')).to.be(true); - const expectedTableData = [ - ['CN', '133'], - ['IN', '120'], - ['US', '58'], - ['ID', '28'], - ['BD', '25'], - ['BR', '22'], - ['EG', '14'], - ['NG', '14'], - ['PK', '13'], - ['IR', '12'], - ['PH', '12'], - ['JP', '11'], - ['RU', '11'], - ['DE', '8'], - ['FR', '8'], - ['MX', '8'], - ['TH', '8'], - ['TR', '8'], - ['CA', '6'], - ['SA', '6'], - ]; - await inspector.open(); - await inspector.expectTableData(expectedTableData); - await inspector.close(); - }); - - it('should preserve query in visualize', async () => { - await queryBar.setQuery('machine.os : ios'); - await queryBar.submitQuery(); - await PageObjects.discover.findFieldByName('geo.dest'); - log.debug('visualize a geo.dest field with query applied'); - await PageObjects.discover.clickFieldListItemVisualize('geo.dest'); - await PageObjects.header.waitUntilLoadingHasFinished(); - - expect(await queryBar.getQueryString()).to.equal('machine.os : ios'); - const expectedTableData = [ - ['CN', '519'], - ['IN', '495'], - ['US', '275'], - ['ID', '82'], - ['PK', '75'], - ['BR', '71'], - ['NG', '54'], - ['BD', '51'], - ['JP', '47'], - ['MX', '47'], - ['IR', '44'], - ['PH', '44'], - ['RU', '42'], - ['ET', '33'], - ['TH', '33'], - ['EG', '32'], - ['VN', '32'], - ['DE', '31'], - ['FR', '30'], - ['GB', '30'], - ]; - await inspector.open(); - await inspector.expectTableData(expectedTableData); - await inspector.close(); - }); - }); -} diff --git a/test/functional/apps/discover/_filter_editor.js b/test/functional/apps/discover/_filter_editor.js deleted file mode 100644 index 7692d7e6148..00000000000 --- a/test/functional/apps/discover/_filter_editor.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const log = getService('log'); - const retry = getService('retry'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const filterBar = getService('filterBar'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:v2': false, - }; - - describe('discover filter editor', function describeIndexTests() { - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.loadIfNeeded('discover'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - log.debug('discover filter editor'); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - describe('filter editor', function () { - it('should add a phrases filter', async function () { - await filterBar.addFilter('extension.raw', 'is one of', 'jpg'); - expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); - }); - - it('should show the phrases if you re-open a phrases filter', async function () { - await filterBar.clickEditFilter('extension.raw', 'jpg'); - const phrases = await filterBar.getFilterEditorSelectedPhrases(); - expect(phrases.length).to.be(1); - expect(phrases[0]).to.be('jpg'); - await filterBar.ensureFieldEditorModalIsClosed(); - }); - - it('should support filtering on nested fields', async () => { - await filterBar.addFilter('nestedField.child', 'is', 'nestedValue'); - expect(await filterBar.hasFilter('nestedField.child', 'nestedValue')).to.be(true); - await retry.try(async function () { - expect(await PageObjects.discover.getHitCount()).to.be('1'); - }); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_indexpattern_with_encoded_id.ts b/test/functional/apps/discover/_indexpattern_with_encoded_id.ts deleted file mode 100644 index f2cb85fb928..00000000000 --- a/test/functional/apps/discover/_indexpattern_with_encoded_id.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import expect from '@osd/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const retry = getService('retry'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const docTable = getService('docTable'); - const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); - - describe('indexpattern with encoded id', () => { - before(async () => { - await opensearchArchiver.loadIfNeeded('index_pattern_with_encoded_id'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'with-encoded-id', - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - }); - - beforeEach(async function () { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - after(async () => { - await opensearchArchiver.unload('index_pattern_with_encoded_id'); - }); - - describe('expand a document row', function () { - const rowToInspect = 1; - beforeEach(async function () { - 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('docTableRowDetailsTitle'); - 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 [surroundingActionEl, singleActionEl] = await docTable.getRowActions({ - isAnchorRow: false, - rowIndex: rowToInspect - 1, - }); - expect(surroundingActionEl).to.be.ok(); - expect(singleActionEl).to.be.ok(); - }); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_indexpattern_without_timefield.ts b/test/functional/apps/discover/_indexpattern_without_timefield.ts deleted file mode 100644 index 1f89753c033..00000000000 --- a/test/functional/apps/discover/_indexpattern_without_timefield.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const security = getService('security'); - const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); - - describe('indexpattern without timefield', () => { - before(async () => { - await security.testUser.setRoles([ - 'opensearch_dashboards_admin', - 'opensearch_dashboards_timefield', - ]); - await opensearchArchiver.loadIfNeeded('index_pattern_without_timefield'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'without-timefield', - 'discover:v2': false, - }); - await PageObjects.common.navigateToApp('discover'); - }); - - after(async () => { - await security.testUser.restoreDefaults(); - await opensearchArchiver.unload('index_pattern_without_timefield'); - }); - - it('should not display a timepicker', async () => { - if (await PageObjects.timePicker.timePickerExists()) { - throw new Error('Expected timepicker not to exist'); - } - }); - - it('should display a timepicker after switching to an index pattern with timefield', async () => { - await PageObjects.discover.selectIndexPattern('with-timefield'); - if (!(await PageObjects.timePicker.timePickerExists())) { - throw new Error('Expected timepicker to exist'); - } - }); - }); -} diff --git a/test/functional/apps/discover/_inspector.js b/test/functional/apps/discover/_inspector.js deleted file mode 100644 index 5f4c2438fce..00000000000 --- a/test/functional/apps/discover/_inspector.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const PageObjects = getPageObjects(['common', 'visualize', 'timePicker']); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const inspector = getService('inspector'); - - const STATS_ROW_NAME_INDEX = 0; - const STATS_ROW_VALUE_INDEX = 1; - function getHitCount(requestStats) { - const hitsCountStatsRow = requestStats.find((statsRow) => { - return statsRow[STATS_ROW_NAME_INDEX] === 'Hits (total)'; - }); - return hitsCountStatsRow[STATS_ROW_VALUE_INDEX]; - } - - // FLAKY: https://github.com/elastic/kibana/issues/39842 - describe.skip('inspect', () => { - before(async () => { - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchArchiver.load('discover'); - // delete .kibana index and update configDoc - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:v2': false, - }); - - await PageObjects.common.navigateToApp('discover'); - }); - - afterEach(async () => { - await inspector.close(); - }); - - it('should display request stats with no results', async () => { - await inspector.open(); - const requestStats = await inspector.getTableData(); - - expect(getHitCount(requestStats)).to.be('0'); - }); - - it('should display request stats with results', async () => { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - - await inspector.open(); - const requestStats = await inspector.getTableData(); - - expect(getHitCount(requestStats)).to.be('14004'); - }); - }); -} diff --git a/test/functional/apps/discover/_large_string.js b/test/functional/apps/discover/_large_string.js deleted file mode 100644 index 2cad2b0daf9..00000000000 --- a/test/functional/apps/discover/_large_string.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const opensearchArchiver = getService('opensearchArchiver'); - const log = getService('log'); - const retry = getService('retry'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const queryBar = getService('queryBar'); - const security = getService('security'); - const PageObjects = getPageObjects(['common', 'home', 'settings', 'discover']); - - describe('test large strings', function () { - before(async function () { - await security.testUser.setRoles([ - 'opensearch_dashboards_admin', - 'opensearch_dashboards_large_strings', - ]); - await opensearchArchiver.load('empty_opensearch_dashboards'); - await opensearchArchiver.loadIfNeeded('hamlet'); - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'testlargestring', - 'discover:v2': false, - }); - }); - - it('verify the large string book present', async function () { - const ExpectedDoc = - 'mybook:Project Gutenberg EBook of Hamlet, by William Shakespeare' + - ' This eBook is for the use of anyone anywhere in the United States' + - ' and most other parts of the world at no cost and with almost no restrictions whatsoever.' + - ' You may copy it, give it away or re-use it under the terms of the' + - ' Project Gutenberg License included with this eBook or online at www.gutenberg.org.' + - ' If you are not located in the United States,' + - ' you’ll have to check the laws of the country where you are' + - ' located before using this ebook.' + - ' Title: Hamlet Author: William Shakespeare Release Date: November 1998 [EBook #1524]' + - ' Last Updated: December 30, 2017 Language: English Character set encoding:'; - - let rowData; - await PageObjects.common.navigateToApp('discover'); - await retry.try(async function tryingForTime() { - rowData = await PageObjects.discover.getDocTableIndex(1); - log.debug('rowData.length=' + rowData.length); - expect(rowData.substring(0, 200)).to.be(ExpectedDoc.substring(0, 200)); - }); - }); - - describe('test large data', function () { - it('search Newsletter should show the correct hit count', async function () { - const expectedHitCount = '1'; - await queryBar.setQuery('Newsletter'); - await queryBar.submitQuery(); - await retry.try(async function tryingForTime() { - const hitCount = await PageObjects.discover.getHitCount(); - expect(hitCount).to.be(expectedHitCount); - log.debug('test Newsletter keyword is searched'); - }); - }); - - it('the search term Newsletter should be highlighted in the field data', async function () { - // marks is the style that highlights the text in yellow - const marks = await PageObjects.discover.getMarks(); - expect(marks.length).to.be(1); - log.debug('Newsletter appears only once'); - }); - }); - - after(async () => { - await security.testUser.restoreDefaults(); - await opensearchArchiver.unload('hamlet'); - }); - }); -} diff --git a/test/functional/apps/discover/_saved_queries.js b/test/functional/apps/discover/_saved_queries.js deleted file mode 100644 index c51850eac00..00000000000 --- a/test/functional/apps/discover/_saved_queries.js +++ /dev/null @@ -1,186 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const retry = getService('retry'); - const log = getService('log'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings']); - const browser = getService('browser'); - - const defaultSettings = { - defaultIndex: 'logstash-*', - 'discover:v2': false, - }; - const filterBar = getService('filterBar'); - const queryBar = getService('queryBar'); - const savedQueryManagementComponent = getService('savedQueryManagementComponent'); - const testSubjects = getService('testSubjects'); - - describe('saved queries saved objects', function describeIndexTests() { - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - await opensearchDashboardsServer.uiSettings.replace(defaultSettings); - - log.debug('discover'); - await PageObjects.common.navigateToApp('discover'); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - describe('saved query management component functionality', function () { - before(async function () { - // set up a query with filters and a time filter - log.debug('set up a query with filters to save'); - await queryBar.setQuery('response:200'); - await filterBar.addFilter('extension.raw', 'is one of', 'jpg'); - const fromTime = 'Sep 20, 2015 @ 08:00:00.000'; - const toTime = 'Sep 21, 2015 @ 08:00:00.000'; - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - }); - - it('should show the saved query management component when there are no saved queries', async () => { - await savedQueryManagementComponent.openSavedQueryManagementComponent(); - const descriptionText = await testSubjects.getVisibleText('saved-query-management-popover'); - expect(descriptionText).to.eql( - 'SAVED QUERIES\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query' - ); - }); - - it('should allow a query to be saved via the saved objects management component', async () => { - await savedQueryManagementComponent.saveNewQuery( - 'OkResponse', - '200 responses for .jpg over 24 hours', - true, - true - ); - await savedQueryManagementComponent.savedQueryExistOrFail('OkResponse'); - await savedQueryManagementComponent.savedQueryTextExist('response:200'); - }); - - it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => { - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes(); - expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); - expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime); - expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime); - }); - - it('preserves the currently loaded query when the page is reloaded', async () => { - await browser.refresh(); - const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes(); - expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); - expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime); - expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime); - await retry.waitFor( - 'the right hit count', - async () => (await PageObjects.discover.getHitCount()) === '2,792' - ); - expect(await savedQueryManagementComponent.getCurrentlyLoadedQueryID()).to.be('OkResponse'); - }); - - it('allows saving changes to a currently loaded query via the saved query management component', async () => { - await queryBar.setQuery('response:404'); - await savedQueryManagementComponent.updateCurrentlyLoadedQuery( - 'OkResponse', - '404 responses', - false, - false - ); - await savedQueryManagementComponent.savedQueryExistOrFail('OkResponse'); - await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); - expect(await queryBar.getQueryString()).to.eql(''); - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - expect(await queryBar.getQueryString()).to.eql('response:404'); - }); - - it('allows saving the currently loaded query as a new query', async () => { - await savedQueryManagementComponent.saveCurrentlyLoadedAsNewQuery( - 'OkResponseCopy', - '200 responses', - false, - false - ); - await savedQueryManagementComponent.savedQueryExistOrFail('OkResponseCopy'); - }); - - it('allows deleting the currently loaded saved query in the saved query management component and clears the query', async () => { - await savedQueryManagementComponent.deleteSavedQuery('OkResponseCopy'); - await savedQueryManagementComponent.savedQueryMissingOrFail('OkResponseCopy'); - expect(await queryBar.getQueryString()).to.eql(''); - }); - - it('does not allow saving a query with a non-unique name', async () => { - await savedQueryManagementComponent.saveNewQueryWithNameError('OkResponse'); - }); - - it('does not allow saving a query with leading or trailing whitespace in the name', async () => { - await savedQueryManagementComponent.saveNewQueryWithNameError('OkResponse '); - }); - - it('resets any changes to a loaded query on reloading the same saved query', async () => { - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - await queryBar.setQuery('response:503'); - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - expect(await queryBar.getQueryString()).to.eql('response:404'); - }); - - it('allows clearing the currently loaded saved query', async () => { - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); - expect(await queryBar.getQueryString()).to.eql(''); - }); - - it('allows clearing if non default language was remembered in localstorage', async () => { - await queryBar.switchQueryLanguage('lucene'); - await PageObjects.common.navigateToApp('discover'); // makes sure discovered is reloaded without any state in url - await queryBar.expectQueryLanguageOrFail('lucene'); // make sure lucene is remembered after refresh (comes from localstorage) - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - await queryBar.expectQueryLanguageOrFail('dql'); - await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); - await queryBar.expectQueryLanguageOrFail('lucene'); - }); - - it('changing language removes saved query', async () => { - await savedQueryManagementComponent.loadSavedQuery('OkResponse'); - await queryBar.switchQueryLanguage('lucene'); - expect(await queryBar.getQueryString()).to.eql(''); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js deleted file mode 100644 index 0583ff39828..00000000000 --- a/test/functional/apps/discover/_shared_links.js +++ /dev/null @@ -1,194 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const retry = getService('retry'); - const log = getService('log'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const PageObjects = getPageObjects(['common', 'discover', 'share', 'timePicker']); - const browser = getService('browser'); - const toasts = getService('toasts'); - const deployment = getService('deployment'); - - describe('shared links', function describeIndexTests() { - let baseUrl; - - async function setup({ storeStateInSessionStorage }) { - baseUrl = deployment.getHostPort(); - log.debug('baseUrl = ' + baseUrl); - // browsers don't show the ':port' if it's 80 or 443 so we have to - // remove that part so we can get a match in the tests. - baseUrl = baseUrl.replace(':80', '').replace(':443', ''); - log.debug('New baseUrl = ' + baseUrl); - - // delete .kibana index and update configDoc - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - }); - - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - await opensearchArchiver.loadIfNeeded('logstash_functional'); - - await opensearchDashboardsServer.uiSettings.replace({ - 'state:storeInSessionStorage': storeStateInSessionStorage, - 'discover:v2': false, - }); - - log.debug('discover'); - await PageObjects.common.navigateToApp('discover'); - - await PageObjects.timePicker.setDefaultAbsoluteRange(); - - //After hiding the time picker, we need to wait for - //the refresh button to hide before clicking the share button - await PageObjects.common.sleep(1000); - - await PageObjects.share.clickShareTopNavButton(); - - return async () => { - await opensearchDashboardsServer.uiSettings.replace({ - 'state:storeInSessionStorage': undefined, - }); - }; - } - - describe('shared links with state in query', async () => { - let teardown; - before(async function () { - teardown = await setup({ storeStateInSessionStorage: false }); - }); - - after(async function () { - await teardown(); - }); - - describe('permalink', function () { - it('should allow for copying the snapshot URL', async function () { - const expectedUrl = - baseUrl + - '/app/discoverLegacy?_t=1453775307251#' + - '/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time' + - ":(from:'2015-09-19T06:31:44.000Z',to:'2015-09" + - "-23T18:31:44.000Z'))&_a=(columns:!(_source),filters:!(),index:'logstash-" + - "*',interval:auto,query:(language:kuery,query:'')" + - ',sort:!())'; - const actualUrl = await PageObjects.share.getSharedUrl(); - // strip the timestamp out of each URL - expect(actualUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')).to.be( - expectedUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP') - ); - }); - - it('should allow for copying the snapshot URL as a short URL', async function () { - const re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); - await PageObjects.share.checkShortenUrl(); - await retry.try(async () => { - const actualUrl = await PageObjects.share.getSharedUrl(); - expect(actualUrl).to.match(re); - }); - }); - - it('should allow for copying the saved object URL', async function () { - const expectedUrl = - baseUrl + - '/app/discoverLegacy#' + - '/view/ab12e3c0-f231-11e6-9486-733b1ac9221a' + - '?_g=%28filters%3A%21%28%29%2CrefreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%' + - '2Ctime%3A%28from%3A%272015-09-19T06%3A31%3A44.000Z%27%2C' + - 'to%3A%272015-09-23T18%3A31%3A44.000Z%27%29%29'; - await PageObjects.discover.loadSavedSearch('A Saved Search'); - await PageObjects.share.clickShareTopNavButton(); - await PageObjects.share.exportAsSavedObject(); - const actualUrl = await PageObjects.share.getSharedUrl(); - expect(actualUrl).to.be(expectedUrl); - }); - }); - }); - - describe('shared links with state in sessionStorage', async () => { - let teardown; - before(async function () { - teardown = await setup({ storeStateInSessionStorage: true }); - }); - - after(async function () { - await teardown(); - }); - - it('should allow for copying the snapshot URL as a short URL and should open it', async function () { - const re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); - await PageObjects.share.checkShortenUrl(); - let actualUrl; - await retry.try(async () => { - actualUrl = await PageObjects.share.getSharedUrl(); - expect(actualUrl).to.match(re); - }); - - const actualTime = await PageObjects.timePicker.getTimeConfig(); - - await browser.clearSessionStorage(); - await browser.get(actualUrl, false); - await retry.waitFor('shortUrl resolves and opens', async () => { - const resolvedUrl = await browser.getCurrentUrl(); - expect(resolvedUrl).to.match(/discoverLegacy/); - const resolvedTime = await PageObjects.timePicker.getTimeConfig(); - expect(resolvedTime.start).to.equal(actualTime.start); - expect(resolvedTime.end).to.equal(actualTime.end); - return true; - }); - }); - - it("sharing hashed url shouldn't crash the app", async () => { - const currentUrl = await browser.getCurrentUrl(); - const timeBeforeReload = await PageObjects.timePicker.getTimeConfig(); - await browser.clearSessionStorage(); - await browser.get(currentUrl, false); - await retry.waitFor('discover to open', async () => { - const resolvedUrl = await browser.getCurrentUrl(); - expect(resolvedUrl).to.match(/discoverLegacy/); - const { message } = await toasts.getErrorToast(); - expect(message).to.contain( - 'Unable to completely restore the URL, be sure to use the share functionality.' - ); - await toasts.dismissAllToasts(); - const timeAfterReload = await PageObjects.timePicker.getTimeConfig(); - expect(timeBeforeReload.start).not.to.be(timeAfterReload.start); - expect(timeBeforeReload.end).not.to.be(timeAfterReload.end); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - return true; - }); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_sidebar.js b/test/functional/apps/discover/_sidebar.js deleted file mode 100644 index 5d6bcb5134e..00000000000 --- a/test/functional/apps/discover/_sidebar.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const log = getService('log'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); - - describe('discover sidebar', function describeIndexTests() { - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('discover'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - - // delete .kibana index and update configDoc - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:v2': false, - }); - - log.debug('discover'); - await PageObjects.common.navigateToApp('discover'); - - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - describe('field filtering', function () { - it('should reveal and hide the filter form when the toggle is clicked', async function () { - await PageObjects.discover.openSidebarFieldFilter(); - await PageObjects.discover.closeSidebarFieldFilter(); - }); - }); - - describe('collapse expand', function () { - it('should initially be expanded', async function () { - const width = await PageObjects.discover.getSidebarWidth(); - log.debug('expanded sidebar width = ' + width); - expect(width > 20).to.be(true); - }); - - it('should collapse when clicked', async function () { - await PageObjects.discover.toggleSidebarCollapse(); - log.debug('PageObjects.discover.getSidebarWidth()'); - const width = await PageObjects.discover.getSidebarWidth(); - log.debug('collapsed sidebar width = ' + width); - expect(width < 20).to.be(true); - }); - - it('should expand when clicked', async function () { - await PageObjects.discover.toggleSidebarCollapse(); - - log.debug('PageObjects.discover.getSidebarWidth()'); - const width = await PageObjects.discover.getSidebarWidth(); - log.debug('expanded sidebar width = ' + width); - expect(width > 20).to.be(true); - }); - }); - }); -} diff --git a/test/functional/apps/discover/_source_filters.js b/test/functional/apps/discover/_source_filters.js deleted file mode 100644 index 1f425a4e341..00000000000 --- a/test/functional/apps/discover/_source_filters.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from '@osd/expect'; - -export default function ({ getService, getPageObjects }) { - const log = getService('log'); - const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); - - describe('source filters', function describeIndexTests() { - before(async function () { - log.debug('load opensearch-dashboards index with default index pattern'); - await opensearchArchiver.load('visualize_source-filters'); - - // and load a set of makelogs data - await opensearchArchiver.loadIfNeeded('logstash_functional'); - - // delete .kibana index and update configDoc - await opensearchDashboardsServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - 'discover:v2': false, - }); - - log.debug('discover'); - await PageObjects.common.navigateToApp('discover'); - - await PageObjects.timePicker.setDefaultAbsoluteRange(); - - //After hiding the time picker, we need to wait for - //the refresh button to hide before clicking the share button - await PageObjects.common.sleep(1000); - }); - - it('should not get the field referer', async function () { - const fieldNames = await PageObjects.discover.getAllFieldNames(); - expect(fieldNames).to.not.contain('referer'); - const relatedContentFields = fieldNames.filter( - (fieldName) => fieldName.indexOf('relatedContent') === 0 - ); - expect(relatedContentFields).to.have.length(0); - }); - }); -} diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js deleted file mode 100644 index b7dbe3240f7..00000000000 --- a/test/functional/apps/discover/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export default function ({ getService, loadTestFile }) { - const opensearchArchiver = getService('opensearchArchiver'); - const browser = getService('browser'); - - describe('discover app', function () { - this.tags('ciGroup6'); - - before(function () { - return browser.setWindowSize(1300, 800); - }); - - after(function unloadMakelogs() { - return opensearchArchiver.unload('logstash_functional'); - }); - - loadTestFile(require.resolve('./_saved_queries')); - loadTestFile(require.resolve('./_discover')); - loadTestFile(require.resolve('./_discover_histogram')); - loadTestFile(require.resolve('./_doc_table')); - loadTestFile(require.resolve('./_field_visualize')); - loadTestFile(require.resolve('./_filter_editor')); - loadTestFile(require.resolve('./_errors')); - loadTestFile(require.resolve('./_field_data')); - loadTestFile(require.resolve('./_shared_links')); - loadTestFile(require.resolve('./_sidebar')); - loadTestFile(require.resolve('./_source_filters')); - loadTestFile(require.resolve('./_large_string')); - loadTestFile(require.resolve('./_inspector')); - loadTestFile(require.resolve('./_doc_navigation')); - loadTestFile(require.resolve('./_date_nanos')); - loadTestFile(require.resolve('./_date_nanos_mixed')); - loadTestFile(require.resolve('./_indexpattern_without_timefield')); - loadTestFile(require.resolve('./_indexpattern_with_encoded_id')); - }); -} diff --git a/test/functional/apps/home/_navigation.ts b/test/functional/apps/home/_navigation.ts index 36f8e50ea54..03230f1270e 100644 --- a/test/functional/apps/home/_navigation.ts +++ b/test/functional/apps/home/_navigation.ts @@ -36,14 +36,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'header', 'home', 'timePicker']); const appsMenu = getService('appsMenu'); const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); describe('OpenSearch Dashboards browser back navigation should work', function describeIndexTests() { before(async () => { await opensearchArchiver.loadIfNeeded('discover'); await opensearchArchiver.loadIfNeeded('logstash_functional'); - - await opensearchDashboardsServer.uiSettings.replace({ 'discover:v2': false }); }); it('detect navigate back issues', async () => { diff --git a/test/functional/apps/management/_handle_alias.js b/test/functional/apps/management/_handle_alias.js index 203345e38f9..c5c6456f044 100644 --- a/test/functional/apps/management/_handle_alias.js +++ b/test/functional/apps/management/_handle_alias.js @@ -32,7 +32,6 @@ import expect from '@osd/expect'; export default function ({ getService, getPageObjects }) { const opensearchArchiver = getService('opensearchArchiver'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); const opensearch = getService('legacyOpenSearch'); const retry = getService('retry'); const security = getService('security'); @@ -43,9 +42,6 @@ export default function ({ getService, getPageObjects }) { await security.testUser.setRoles(['opensearch_dashboards_admin', 'test_alias_reader']); await opensearchArchiver.loadIfNeeded('alias'); await opensearchArchiver.load('empty_opensearch_dashboards'); - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); await opensearch.indices.updateAliases({ body: { actions: [ diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index fd290ce76b8..7aeb2a691a7 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -71,9 +71,6 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); await opensearchArchiver.load('discover'); - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); await opensearchDashboardsServer.uiSettings.update({}); }); diff --git a/test/functional/apps/visualize/_lab_mode.js b/test/functional/apps/visualize/_lab_mode.js index d852ac484ea..82ecbcb2a65 100644 --- a/test/functional/apps/visualize/_lab_mode.js +++ b/test/functional/apps/visualize/_lab_mode.js @@ -34,14 +34,8 @@ import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../../src/plugins/visualiza export default function ({ getService, getPageObjects }) { const log = getService('log'); const PageObjects = getPageObjects(['common', 'header', 'discover', 'settings']); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); describe('visualize lab mode', () => { - before(async () => { - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); - }); it('disabling does not break loading saved searches', async () => { await PageObjects.common.navigateToUrl('discover', '', { useActualUrl: true }); await PageObjects.discover.saveSearch('visualize_lab_mode_test'); diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index 2bdc5990b92..fb7e721db7d 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -49,7 +49,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: 'logstash-*', [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', - 'discover:v2': false, }); isOss = await deployment.isOss(); }); diff --git a/test/functional/config.js b/test/functional/config.js index b862208276b..87d4302b2a1 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -40,7 +40,6 @@ export default async function ({ readConfigFile }) { require.resolve('./apps/console'), require.resolve('./apps/context'), require.resolve('./apps/dashboard'), - require.resolve('./apps/discover'), require.resolve('./apps/getting_started'), require.resolve('./apps/home'), require.resolve('./apps/management'), @@ -80,7 +79,7 @@ export default async function ({ readConfigFile }) { pathname: '/status', }, discover: { - pathname: '/app/discoverLegacy', + pathname: '/app/data-explorer/discover', hash: '/', }, context: { diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 2deec8cd44e..395980d6c74 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -43,6 +43,10 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider const opensearchChart = getService('opensearchChart'); const docTable = getService('docTable'); + /* + * This page is left unchanged since some of the other selenium tests, ex. dashboard tests, visualization tests + * are still using some of the below helper functions. + */ class DiscoverPage { public async getChartTimespan() { const el = await find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); diff --git a/test/functional/services/dashboard/visualizations.ts b/test/functional/services/dashboard/visualizations.ts index 588368d4b4a..4a887167796 100644 --- a/test/functional/services/dashboard/visualizations.ts +++ b/test/functional/services/dashboard/visualizations.ts @@ -37,8 +37,6 @@ export function DashboardVisualizationProvider({ getService, getPageObjects }: F const queryBar = getService('queryBar'); const testSubjects = getService('testSubjects'); const dashboardAddPanel = getService('dashboardAddPanel'); - const browser = getService('browser'); - const opensearchDashboardsServer = getService('opensearchDashboardsServer'); const PageObjects = getPageObjects([ 'dashboard', 'visualize', @@ -74,10 +72,6 @@ export function DashboardVisualizationProvider({ getService, getPageObjects }: F }) { log.debug(`createSavedSearch(${name})`); - await opensearchDashboardsServer.uiSettings.replace({ - 'discover:v2': false, - }); - await browser.refresh(); await PageObjects.header.clickDiscover(); await PageObjects.timePicker.setHistoricalDataRange();