From 14e5373cdf1ac3b1cb610a0f993f9f4317206cd4 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 18 Jan 2022 11:36:34 +0200 Subject: [PATCH] [Lens] Fix flakiness of formula functional tests (#123165) --- x-pack/test/functional/apps/lens/formula.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/test/functional/apps/lens/formula.ts b/x-pack/test/functional/apps/lens/formula.ts index 64cedd7e88e7c..12d7f9cf9036b 100644 --- a/x-pack/test/functional/apps/lens/formula.ts +++ b/x-pack/test/functional/apps/lens/formula.ts @@ -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'); @@ -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 @@ -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); }); @@ -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); @@ -302,7 +302,7 @@ 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 @@ -310,7 +310,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 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'); }); @@ -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'); }); });