diff --git a/src/ui/public/doc_table/components/table_row.js b/src/ui/public/doc_table/components/table_row.js index dcf9c45787cca..c8922f96855fe 100644 --- a/src/ui/public/doc_table/components/table_row.js +++ b/src/ui/public/doc_table/components/table_row.js @@ -42,7 +42,7 @@ module.directive('kbnTableRow', function ($compile, $httpParamSerializer, kbnUrl onRemoveColumn: '=?', }, link: function ($scope, $el) { - $el.after(''); + $el.after(''); $el.empty(); // when we compile the details, we use this $scope diff --git a/src/ui/public/doc_table/components/table_row/details.html b/src/ui/public/doc_table/components/table_row/details.html index 46e52b7caa4f1..5705d460172a1 100644 --- a/src/ui/public/doc_table/components/table_row/details.html +++ b/src/ui/public/doc_table/components/table_row/details.html @@ -23,5 +23,6 @@ index-pattern="indexPattern" on-add-column="onAddColumn" on-remove-column="onRemoveColumn" + data-test-subj="docViewer" > diff --git a/test/functional/services/doc_table.js b/test/functional/services/doc_table.js index 3589c3665a88e..523accee3f70f 100644 --- a/test/functional/services/doc_table.js +++ b/test/functional/services/doc_table.js @@ -1,5 +1,6 @@ export function DocTableProvider({ getService }) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); class DocTable { async getTable() { @@ -15,7 +16,7 @@ export function DocTableProvider({ getService }) { } async getAnchorDetailsRow(table) { - return await table.findByCssSelector('[data-test-subj~="docTableAnchorRow"] + tr'); + return await table.findByCssSelector('[data-test-subj~="docTableAnchorRow"] + [data-test-subj~="docTableDetailsRow"]'); } async getRowExpandToggle(row) { @@ -23,7 +24,7 @@ export function DocTableProvider({ getService }) { } async getDetailsRows(table) { - return await table.findAllByCssSelector('[data-test-subj~="docTableRow"] + tr'); + return await table.findAllByCssSelector('[data-test-subj~="docTableRow"] + [data-test-subj~="docTableDetailsRow"]'); } async getRowActions(row) { @@ -54,7 +55,12 @@ export function DocTableProvider({ getService }) { async toggleRowExpanded(row) { const rowExpandToggle = await this.getRowExpandToggle(row); - return await rowExpandToggle.click(); + await rowExpandToggle.click(); + + const detailsRow = await row.findByXpath('./following-sibling::*[@data-test-subj="docTableDetailsRow"]'); + return await retry.try(async () => { + return detailsRow.findByCssSelector('[data-test-subj~="docViewer"]'); + }); } }