Skip to content

Commit

Permalink
[Lens] Fix flakiness of formula functional tests (elastic#123165)
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Jan 18, 2022
1 parent 49c97c5 commit 14e5373
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions x-pack/test/functional/apps/lens/formula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']);
const PageObjects = getPageObjects(['visualize', 'lens', 'common']);
const find = getService('find');
const listingTable = getService('listingTable');
const browser = getService('browser');
Expand All @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

await PageObjects.lens.switchToFormula();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
// .echLegendItem__title is the only viable way of getting the xy chart's
// legend item(s), so we're using a class selector here.
// 4th item is the other bucket
Expand Down Expand Up @@ -175,7 +175,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
operation: 'formula',
});

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
expect(await PageObjects.lens.getErrorCount()).to.eql(0);
});

Expand All @@ -198,7 +198,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
keepOpen: true,
});
await PageObjects.lens.setTableDynamicColoring('text');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
const styleObj = await PageObjects.lens.getDatatableCellStyle(1, 1);
expect(styleObj['background-color']).to.be(undefined);
expect(styleObj.color).not.to.be(undefined);
Expand Down Expand Up @@ -302,15 +302,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

// check the numbers
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('14,005');

// add an advanced filter by filter
await PageObjects.lens.enableFilter();
await PageObjects.lens.setFilterBy('bytes > 4000');

// check that numbers changed
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
await retry.try(async () => {
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('9,169');
});
Expand All @@ -322,7 +322,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await input.type(`bytes > 600000`);
// the autocomplete will add quotes and closing brakets, so do not worry about that

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('0');
});
});
Expand Down

0 comments on commit 14e5373

Please sign in to comment.