Skip to content

Commit

Permalink
[Lens] Add retry and remove unused test (#93233)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Mar 3, 2021
1 parent 6467afa commit 73f8b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 41 deletions.
38 changes: 0 additions & 38 deletions x-pack/test/functional/apps/lens/smokescreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']);
const find = getService('find');
const retry = getService('retry');
const listingTable = getService('listingTable');
const testSubjects = getService('testSubjects');
const elasticChart = getService('elasticChart');
Expand Down Expand Up @@ -600,42 +599,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 73f8b33

Please sign in to comment.