Solidify context app filter test (#15203) (#15401)

* Solidify context filter test
This commit is contained in:
Matt Bargar 2017-12-05 11:33:41 -05:00 committed by GitHub
parent c6dde4c6c4
commit 620cce3583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -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

View file

@ -23,5 +23,6 @@
index-pattern="indexPattern"
on-add-column="onAddColumn"
on-remove-column="onRemoveColumn"
data-test-subj="docViewer"
></doc-viewer>
</td>

View file

@ -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"]');
});
}
}