Fix flaky dashboard color legend (#22341) (#22545)

* Rebuild modulePath correctly if on Windows

* Adding 1 second sleep to fix flaky test

* Wait to find a gear in the visualization after clicking Edit

* Revert "Wait to find a gear in the visualization after clicking Edit"

This reverts commit 8dac3fbd63.

* use waitForRenderComplete and change that to 1s timeout

* Use sleep until TagCloud data-render-complete is fixed

* Different getIsInEditMode courtesy of @chrisdavies

* combine switchToEditMode into one method
This commit is contained in:
Lee Drengenberg 2018-08-30 12:41:25 -05:00 committed by GitHub
parent 4e6f3f0723
commit 3f3397ace5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -176,9 +176,14 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
async switchToEditMode() {
log.debug('Switching to edit mode');
await testSubjects.click('dashboardEditMode');
await retry.waitFor('not in view mode', async () => (
!await this.getIsInViewMode()
));
// wait until the count of dashboard panels equals the count of toggle menu icons
await retry.waitFor('in edit mode', async () => {
const [panels, menuIcons] = await Promise.all([
testSubjects.findAll('dashboardPanel'),
testSubjects.findAll('dashboardPanelToggleMenuIcon'),
]);
return panels.length === menuIcons.length;
});
}
async getIsInViewMode() {

View file

@ -42,7 +42,7 @@ export function RenderableProvider({ getService }) {
throw new Error(`${completedElements.length} elements completed rendering, waiting on a total of ${count}`);
}
const stillLoadingElements = await find.allByCssSelector(DATA_LOADING_SELECTOR);
const stillLoadingElements = await find.allByCssSelector(DATA_LOADING_SELECTOR, 1000);
if (stillLoadingElements.length > 0) {
throw new Error(`${stillLoadingElements.length} elements still loading contents`);
}