[Lens] Fixes metrics test flakiness by using the Lens waitForVisualization function (#122532)

* [Lens] Fixes metrics test flakiness by using the Lens waitForVisualization function

* Update rest tests
This commit is contained in:
Stratoula Kalafateli 2022-01-11 12:04:45 +02:00 committed by GitHub
parent d0cf4890d7
commit d1049cac31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,21 +37,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.setValue('lnsPalettePanel_dynamicColoring_stop_value_1', '21000', {
clearWithKeyboard: true,
});
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
const styleObj = await PageObjects.lens.getMetricStyle();
expect(styleObj.color).to.be('rgb(32, 146, 128)');
});
it('should change the color when reverting the palette', async () => {
await testSubjects.click('lnsPalettePanel_dynamicColoring_reverse');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
const styleObj = await PageObjects.lens.getMetricStyle();
expect(styleObj.color).to.be('rgb(204, 86, 66)');
});
it('should reset the color stops when changing palette to a predefined one', async () => {
await PageObjects.lens.changePaletteTo('temperature');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.waitForVisualization();
const styleObj = await PageObjects.lens.getMetricStyle();
expect(styleObj.color).to.be('rgb(235, 239, 245)');
});