diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.js b/test/functional/apps/dashboard/dashboard_filter_bar.js index 0d19c84a5089..9a0ce6a9042a 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.js +++ b/test/functional/apps/dashboard/dashboard_filter_bar.js @@ -193,7 +193,12 @@ export default function ({ getService, getPageObjects }) { it('are added when a cell magnifying glass is clicked', async function () { await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); await PageObjects.dashboard.waitForRenderComplete(); - await testSubjects.click('docTableCellFilter'); + + // Expand a doc row + await testSubjects.click('docTableExpandToggleColumn-0'); + + // Add a field filter + await testSubjects.click('tableDocViewRow-@message > addInclusiveFilterButton'); const filterCount = await filterBar.getFilterCount(); expect(filterCount).to.equal(1); diff --git a/test/functional/apps/dashboard/dashboard_filtering.js b/test/functional/apps/dashboard/dashboard_filtering.js index b3ff62c8b9da..e934169513f6 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.js +++ b/test/functional/apps/dashboard/dashboard_filtering.js @@ -123,7 +123,7 @@ export default function ({ getService, getPageObjects }) { }); it('saved search is filtered', async () => { - await dashboardExpect.savedSearchRowCount(0); + await testSubjects.missingOrFail('euiDataGrid'); }); it('vega is filtered', async () => { @@ -171,7 +171,7 @@ export default function ({ getService, getPageObjects }) { }); it('saved search is filtered', async () => { - await dashboardExpect.savedSearchRowCount(0); + await testSubjects.missingOrFail('euiDataGrid'); }); it('vega is filtered', async () => { diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index 4bdf355eb049..641c56b586fd 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -36,6 +36,7 @@ export function DashboardExpectProvider({ getService, getPageObjects }: FtrProvi const log = getService('log'); const retry = getService('retry'); const testSubjects = getService('testSubjects'); + const dataGrid = getService('dataGrid'); const find = getService('find'); const filterBar = getService('filterBar'); const PageObjects = getPageObjects(['dashboard', 'visualize']); @@ -233,11 +234,9 @@ export function DashboardExpectProvider({ getService, getPageObjects }: FtrProvi async savedSearchRowCount(expectedCount: number) { log.debug(`DashboardExpect.savedSearchRowCount(${expectedCount})`); await retry.try(async () => { - const savedSearchRows = await testSubjects.findAll( - 'docTableExpandToggleColumn', - findTimeout - ); - expect(savedSearchRows.length).to.be(expectedCount); + // Need to change it here to find out how many rows there are + const timeStamps = await dataGrid.getDataGridTableColumn('date'); + expect(timeStamps.length).to.be(expectedCount); }); } diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index a80c377e1a7d..247b74948168 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -42,6 +42,7 @@ export function DataGridProvider({ getService }: FtrProviderContext) { class DataGrid { // This test no longer works in the new data explorer data grid table // since each data grid table cell is now rendered differently + // https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5108 async getDataGridTableData(): Promise { const table = await find.byCssSelector('.euiDataGrid'); const $ = await table.parseDomContent();