From e8f68435aceca533cdfdb5865c87de46dc6104ee Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Tue, 6 Feb 2024 22:37:09 +0000 Subject: [PATCH] fix functional 3 and 4 Signed-off-by: abbyhu2000 --- test/functional/apps/dashboard/dashboard_filter_bar.js | 4 +++- test/functional/apps/dashboard/dashboard_filtering.js | 7 +++++-- test/functional/apps/dashboard/dashboard_state.js | 3 +++ test/functional/apps/dashboard/dashboard_time_picker.js | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.js b/test/functional/apps/dashboard/dashboard_filter_bar.js index c159683c8ed1..dde86c697e3c 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.js +++ b/test/functional/apps/dashboard/dashboard_filter_bar.js @@ -192,13 +192,15 @@ export default function ({ getService, getPageObjects }) { describe('saved search filtering', function () { before(async () => { await filterBar.ensureFieldEditorModalIsClosed(); + await PageObjects.common.navigateToApp('discover'); + await PageObjects.discover.switchDiscoverTable('new'); + await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultDataRange(); }); it('are added when a cell magnifying glass is clicked', async function () { - await PageObjects.discover.switchDiscoverTable('new'); await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); await PageObjects.dashboard.waitForRenderComplete(); diff --git a/test/functional/apps/dashboard/dashboard_filtering.js b/test/functional/apps/dashboard/dashboard_filtering.js index 1a69b97bfec9..7e1be60ddb66 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.js +++ b/test/functional/apps/dashboard/dashboard_filtering.js @@ -79,6 +79,10 @@ export default function ({ getService, getPageObjects }) { describe('adding a filter that excludes all data', () => { before(async () => { + await PageObjects.common.navigateToApp('discover'); + await PageObjects.discover.switchDiscoverTable('new'); + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultDataRange(); await dashboardAddPanel.addEveryVisualization('"Filter Bytes Test"'); @@ -189,7 +193,6 @@ export default function ({ getService, getPageObjects }) { describe('disabling a filter unfilters the data on', function () { before(async () => { await filterBar.toggleFilterEnabled('bytes'); - await PageObjects.discover.switchDiscoverTable('new'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.dashboard.waitForRenderComplete(); }); @@ -227,7 +230,7 @@ export default function ({ getService, getPageObjects }) { }); it('saved searches', async () => { - await dashboardExpect.savedSearchRowCount(1); + await dashboardExpect.savedSearchRowCountFromLegacyTable(1); }); it('vega', async () => { diff --git a/test/functional/apps/dashboard/dashboard_state.js b/test/functional/apps/dashboard/dashboard_state.js index edb2002624f5..11196a1b69b9 100644 --- a/test/functional/apps/dashboard/dashboard_state.js +++ b/test/functional/apps/dashboard/dashboard_state.js @@ -56,6 +56,9 @@ export default function ({ getService, getPageObjects }) { describe('dashboard state', function describeIndexTests() { before(async function () { + await PageObjects.common.navigateToApp('discover'); + await PageObjects.discover.switchDiscoverTable('new'); + await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.initTests(); await PageObjects.dashboard.preserveCrossAppState(); await browser.refresh(); diff --git a/test/functional/apps/dashboard/dashboard_time_picker.js b/test/functional/apps/dashboard/dashboard_time_picker.js index b1e57fbe8e5e..e5da381ec06e 100644 --- a/test/functional/apps/dashboard/dashboard_time_picker.js +++ b/test/functional/apps/dashboard/dashboard_time_picker.js @@ -68,14 +68,14 @@ export default function ({ getService, getPageObjects }) { fields: ['bytes', 'agent'], }); // Current data grid loads 100 rows per page by default with inspect button and time range - await dashboardExpect.dataGridTableCellCount(400); + await dashboardExpect.savedSearchRowCountFromLegacyTable(100); // Set to time range with no data await PageObjects.timePicker.setAbsoluteRange( 'Jan 1, 2000 @ 00:00:00.000', 'Jan 1, 2000 @ 01:00:00.000' ); - await dashboardExpect.dataGridTableCellCount(0); + await dashboardExpect.savedSearchRowCountFromLegacyTable(0); }); it('Timepicker start, end, interval values are set by url', async () => {