Skip to content

Commit

Permalink
[Discover] Unskip data grid context tests (#196672)
Browse files Browse the repository at this point in the history
- Closes #196120

(cherry picked from commit 6bb2d77)
  • Loading branch information
jughosta committed Oct 18, 2024
1 parent e323bce commit 392e7d5
Showing 1 changed file with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 392e7d5

Please sign in to comment.