Skip to content

Commit

Permalink
Fix flaky dashboard color legend (#22341) (#22545)
Browse files Browse the repository at this point in the history
* 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 8dac3fb.

* 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
  • Loading branch information
Lee Drengenberg authored Aug 30, 2018
1 parent 4e6f3f0 commit 3f3397a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/renderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
Expand Down

0 comments on commit 3f3397a

Please sign in to comment.