Skip to content

Commit

Permalink
Wrap with retry (#63101)
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof authored Apr 9, 2020
1 parent a66948c commit f699bd1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f699bd1

Please sign in to comment.