diff --git a/test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts index 0757304199d8a..30c8b0da3f53a 100644 --- a/test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts +++ b/test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts @@ -22,14 +22,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const dataGrid = getService('dataGrid'); const testSubjects = getService('testSubjects'); - const { common, discover, timePicker, dashboard, header, unifiedFieldList } = getPageObjects([ - 'common', - 'discover', - 'timePicker', - 'dashboard', - 'header', - 'unifiedFieldList', - ]); + const { common, discover, timePicker, dashboard, header, unifiedFieldList, context } = + getPageObjects([ + 'common', + 'discover', + 'timePicker', + 'dashboard', + 'header', + 'unifiedFieldList', + 'context', + ]); const defaultSettings = { defaultIndex: 'logstash-*', 'discover:rowHeightOption': 0, // single line @@ -69,22 +71,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should open the context view with the selected document as anchor', async () => { - // check the anchor timestamp in the context view - await retry.waitFor('selected document timestamp matches anchor timestamp ', async () => { - // get the timestamp of the first row - const discoverFields = await dataGrid.getFields(); - const firstTimestamp = discoverFields[0][0]; + // get the timestamp of the first row + const discoverFields = await dataGrid.getFields(); + const firstTimestamp = discoverFields[0][0]; - // navigate to the context view - await dataGrid.clickRowToggle({ rowIndex: 0 }); - const rowActions = await dataGrid.getRowActions({ rowIndex: 0 }); - await rowActions[1].click(); + // navigate to the context view + await dataGrid.clickRowToggle({ rowIndex: 0 }); + const rowActions = await dataGrid.getRowActions({ rowIndex: 0 }); + await rowActions[1].click(); + await context.waitUntilContextLoadingHasFinished(); - const contextFields = await dataGrid.getFields(); - const anchorTimestamp = contextFields[0][0]; + await dataGrid.clickRowToggle({ isAnchorRow: true }); + await dataGrid.isShowingDocViewer(); + const anchorTimestamp = await testSubjects.getVisibleText('tableDocViewRow-@timestamp-value'); - return anchorTimestamp === firstTimestamp; - }); + expect(anchorTimestamp).to.be(firstTimestamp); }); it('should open the context view with the filters disabled', async () => {