Skip to content

Commit

Permalink
[8.0] [Discover] Unskip and improve document explorer field expand te…
Browse files Browse the repository at this point in the history
…st (elastic#107311) (elastic#121846)

* [Discover] Unskip and improve document explorer field expand test (elastic#107311)

* Update _data_grid_doc_table.ts

* Update _data_grid_doc_table.ts

* Update _data_grid_doc_table.ts

* Update _data_grid_doc_table.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
kertal and kibanamachine authored Feb 16, 2022
1 parent dcf4833 commit fe9b14c
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions test/functional/apps/discover/_data_grid_doc_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,46 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(finalRows.length).to.be.below(initialRows.length);
});

// flaky https://github.com/elastic/kibana/issues/94889
it.skip('should show popover with expanded cell content by click on expand button', async () => {
it('should show popover with expanded cell content by click on expand button', async () => {
log.debug('open popover with expanded cell content to get json from the editor');
const documentCell = await dataGrid.getCellElement(1, 3);
await documentCell.click();
const expandCellContentButton = await documentCell.findByClassName(
await PageObjects.timePicker.setDefaultAbsoluteRange();
await PageObjects.discover.waitUntilSearchingHasFinished();

await retry.waitForWithTimeout('timestamp matches expected doc', 5000, async () => {
const cell = await dataGrid.getCellElement(1, 3);
const text = await cell.getVisibleText();
log.debug(`row document timestamp: ${text}`);
return text === 'Sep 22, 2015 @ 23:50:13.253';
});
const docCell = await dataGrid.getCellElement(1, 4);
await docCell.click();
const expandCellContentButton = await docCell.findByClassName(
'euiDataGridRowCell__expandButtonIcon'
);
await expandCellContentButton.click();
const popoverJson = await monacoEditor.getCodeEditorValue();
let expandDocId = '';

await retry.waitForWithTimeout('expandDocId to be valid', 5000, async () => {
const text = await monacoEditor.getCodeEditorValue();
const flyoutJson = JSON.parse(text);
expandDocId = flyoutJson._id;
return expandDocId === 'AU_x3_g4GFA8no6QjkYX';
});
log.debug(`expanded document id: ${expandDocId}`);

log.debug('open expanded document flyout to get json');
await dataGrid.clickRowToggle();
await find.clickByCssSelectorWhenNotDisabled('#kbn_doc_viewer_tab_1');
const flyoutJson = await monacoEditor.getCodeEditorValue();

expect(popoverJson).to.be(flyoutJson);
await retry.waitForWithTimeout(
'document id in flyout matching the expanded document id',
5000,
async () => {
const text = await monacoEditor.getCodeEditorValue();
const flyoutJson = JSON.parse(text);
log.debug(`flyout document id: ${flyoutJson._id}`);
return flyoutJson._id === expandDocId;
}
);
});

it('should show popover with expanded cell content by click on expand button on embeddable', async () => {
Expand Down

0 comments on commit fe9b14c

Please sign in to comment.