Partial backport of #22341 (#22547)

This commit is contained in:
Lee Drengenberg 2018-08-30 12:41:03 -05:00 committed by GitHub
parent d42e2be2ef
commit aed73026a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,8 +173,16 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
}
async clickEdit() {
log.debug('Clicking edit');
return await testSubjects.click('dashboardEditMode');
log.debug('Switching to edit mode');
await testSubjects.click('dashboardEditMode');
// 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() {