Skip to content

Commit

Permalink
Solidify context app filter test (elastic#15203) (elastic#15403)
Browse files Browse the repository at this point in the history
* Solidify context filter test
  • Loading branch information
Bargs authored Dec 5, 2017
1 parent 724df60 commit 22cb168
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ui/public/doc_table/components/table_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.directive('kbnTableRow', function ($compile, $httpParamSerializer, kbnUrl
onRemoveColumn: '=?',
},
link: function ($scope, $el) {
$el.after('<tr>');
$el.after('<tr data-test-subj="docTableDetailsRow">');
$el.empty();

// when we compile the details, we use this $scope
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/doc_table/components/table_row/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
index-pattern="indexPattern"
on-add-column="onAddColumn"
on-remove-column="onRemoveColumn"
data-test-subj="docViewer"
></doc-viewer>
</td>
12 changes: 9 additions & 3 deletions test/functional/services/doc_table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export function DocTableProvider({ getService }) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');

class DocTable {
async getTable() {
Expand All @@ -15,15 +16,15 @@ 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) {
return await row.findByCssSelector('[data-test-subj~="docTableExpandToggleColumn"]');
}

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) {
Expand Down Expand Up @@ -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"]');
});
}
}

Expand Down

0 comments on commit 22cb168

Please sign in to comment.