Skip to content

Commit

Permalink
[Functional test] Increase the timeout to click new vis function (#71226
Browse files Browse the repository at this point in the history
) (#71440)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
stratoula and elasticmachine authored Jul 13, 2020
1 parent 7cf821e commit e2bb566
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/functional/services/listing_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ export function ListingTableProvider({ getService, getPageObjects }: FtrProvider
* @param promptBtnTestSubj testSubj locator for Prompt button
*/
public async clickNewButton(promptBtnTestSubj: string): Promise<void> {
await retry.try(async () => {
await retry.tryForTime(20000, async () => {
// newItemButton button is only visible when there are items in the listing table is displayed.
if (await testSubjects.exists('newItemButton')) {
const isnNewItemButtonPresent = await testSubjects.exists('newItemButton', {
timeout: 5000,
});
if (isnNewItemButtonPresent) {
await testSubjects.click('newItemButton');
} else {
// no items exist, click createPromptButton to create new dashboard/visualization
Expand Down

0 comments on commit e2bb566

Please sign in to comment.