Skip to content

Commit

Permalink
[Data Explorer] Fix functional cigroup 3 for save search on dashboard…
Browse files Browse the repository at this point in the history
… filtering (#5111)

* fix cigroup3

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* fix error

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
  • Loading branch information
abbyhu2000 authored Sep 26, 2023
1 parent 64f6746 commit da3c209
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
7 changes: 6 additions & 1 deletion test/functional/apps/dashboard/dashboard_filter_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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 () => {
Expand Down
9 changes: 4 additions & 5 deletions test/functional/services/dashboard/expectations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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);
});
}

Expand Down
1 change: 1 addition & 0 deletions test/functional/services/data_grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TabbedGridData> {
const table = await find.byCssSelector('.euiDataGrid');
const $ = await table.parseDomContent();
Expand Down

0 comments on commit da3c209

Please sign in to comment.