Wrap with retry (#63101)

This commit is contained in:
Daniil Suleiman 2020-04-09 16:59:48 +03:00 committed by GitHub
parent a66948cfaf
commit f699bd1e75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,15 +244,17 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
}
public async clickFieldListItemVisualize(fieldName: string) {
const field = await testSubjects.find(`field-${fieldName}`);
const isActive = await field.elementHasClass('dscSidebarItem--active');
await retry.try(async () => {
const field = await testSubjects.find(`field-${fieldName}`);
const isActive = await field.elementHasClass('dscSidebarItem--active');
if (!isActive) {
// expand the field to show the "Visualize" button
await field.click();
}
if (!isActive) {
// expand the field to show the "Visualize" button
await field.click();
}
await testSubjects.click(`fieldVisualize-${fieldName}`);
await testSubjects.click(`fieldVisualize-${fieldName}`);
});
}
public async expectFieldListItemVisualize(field: string) {