[8.0] [Discover] Unskip and improve document explorer field expand test (#107311) (#121846)

* [Discover] Unskip and improve document explorer field expand test (#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>
This commit is contained in:
Matthias Wilhelm 2022-02-16 17:04:04 +01:00 committed by GitHub
parent dcf4833bb2
commit fe9b14c5f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 () => {