Skip to content

Commit

Permalink
add retry and remove unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Mar 2, 2021
1 parent 3d54379 commit cf1dad5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 40 deletions.
37 changes: 0 additions & 37 deletions x-pack/test/functional/apps/lens/smokescreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,42 +600,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
expect(await testSubjects.isEnabled('lnsApp_downloadCSVButton')).to.eql(true);
});

it('should able to sort a table by a column', async () => {
await PageObjects.visualize.gotoVisualizationLandingPage();
await listingTable.searchForItemWithName('lnsXYvis');
await PageObjects.lens.clickVisualizeListItemTitle('lnsXYvis');
await PageObjects.lens.goToTimeRange();
await PageObjects.lens.switchToVisualization('lnsDatatable');
// Sort by number
await PageObjects.lens.changeTableSortingBy(2, 'ascending');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.getDatatableCellText(0, 2)).to.eql('17,246');
// Now sort by IP
await PageObjects.lens.changeTableSortingBy(0, 'ascending');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('78.83.247.30');
// Change the sorting
await PageObjects.lens.changeTableSortingBy(0, 'descending');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('169.228.188.120');
// Remove the sorting
await PageObjects.lens.changeTableSortingBy(0, 'none');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.isDatatableHeaderSorted(0)).to.eql(false);
});

it('should able to use filters cell actions in table', async () => {
const firstCellContent = await PageObjects.lens.getDatatableCellText(0, 0);
await retry.try(async () => {
await PageObjects.lens.clickTableCellAction(0, 0, 'lensDatatableFilterOut');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(
await find.existsByCssSelector(
`[data-test-subj*="filter-value-${firstCellContent}"][data-test-subj*="filter-negated"]`
)
).to.eql(true);
});
});
});
}
8 changes: 5 additions & 3 deletions x-pack/test/functional/apps/lens/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('169.228.188.120');
// Remove the sorting
await PageObjects.lens.changeTableSortingBy(0, 'none');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.isDatatableHeaderSorted(0)).to.eql(false);
await retry.try(async () => {
await PageObjects.lens.changeTableSortingBy(0, 'none');
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.lens.isDatatableHeaderSorted(0)).to.eql(false);
});
});

it('should able to use filters cell actions in table', async () => {
Expand Down

0 comments on commit cf1dad5

Please sign in to comment.