mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[6.x] [pageObjects/visalize/waitForRenderingCount] wait for rendering count to be >= (#29366) (#29388)
Backports the following commits to 6.x: - [pageObjects/visalize/waitForRenderingCount] wait for rendering count to be >= (#29366)
This commit is contained in:
parent
44e98ce662
commit
bd3dcf8b7e
1 changed files with 14 additions and 10 deletions
|
@ -584,7 +584,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
|||
const prevRenderingCount = await this.getVisualizationRenderingCount();
|
||||
log.debug(`Before Rendering count ${prevRenderingCount}`);
|
||||
await testSubjects.clickWhenNotDisabled('visualizeEditorRenderButton');
|
||||
await this.waitForRenderingCount(prevRenderingCount);
|
||||
await this.waitForRenderingCount(prevRenderingCount + 1);
|
||||
}
|
||||
|
||||
async clickReset() {
|
||||
|
@ -949,22 +949,26 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
|||
return Number(renderingCount);
|
||||
}
|
||||
|
||||
async waitForRenderingCount(previousCount = 0, increment = 1) {
|
||||
await retry.try(async () => {
|
||||
async waitForRenderingCount(minimumCount = 1) {
|
||||
await retry.waitFor(`rendering count to be greater than or equal to [${minimumCount}]`, async () => {
|
||||
const currentRenderingCount = await this.getVisualizationRenderingCount();
|
||||
log.debug(`Readed rendering count ${previousCount} ${currentRenderingCount}`);
|
||||
expect(currentRenderingCount).to.be(previousCount + increment);
|
||||
log.debug(`-- currentRenderingCount=${currentRenderingCount}`);
|
||||
return currentRenderingCount >= minimumCount;
|
||||
});
|
||||
}
|
||||
|
||||
async waitForVisualizationRenderingStabilized() {
|
||||
//assuming rendering is done when data-rendering-count is constant within 1000 ms
|
||||
await retry.try(async () => {
|
||||
const previousCount = await this.getVisualizationRenderingCount();
|
||||
await retry.waitFor('rendering count to stabilize', async () => {
|
||||
const firstCount = await this.getVisualizationRenderingCount();
|
||||
log.debug(`-- firstCount=${firstCount}`);
|
||||
|
||||
await PageObjects.common.sleep(1000);
|
||||
const currentCount = await this.getVisualizationRenderingCount();
|
||||
log.debug(`Readed rendering count ${previousCount} ${currentCount}`);
|
||||
expect(currentCount).to.be(previousCount);
|
||||
|
||||
const secondCount = await this.getVisualizationRenderingCount();
|
||||
log.debug(`-- secondCount=${secondCount}`);
|
||||
|
||||
return firstCount === secondCount;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue