From 0559acdcc0edcd8e750efb7f8ef5f7c8b44c9cae Mon Sep 17 00:00:00 2001 From: Lukas Grossmann Date: Thu, 17 Oct 2024 14:08:01 +0200 Subject: [PATCH] Stabilizing failing test by adding conditional wait Signed-off-by: Lukas Grossmann --- test/ui/suite/createComponent.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/ui/suite/createComponent.ts b/test/ui/suite/createComponent.ts index 6a28b6cb4..8013cad2a 100644 --- a/test/ui/suite/createComponent.ts +++ b/test/ui/suite/createComponent.ts @@ -231,12 +231,15 @@ export function testCreateComponent(path: string) { async function loadCreateComponentButton() { section = await view.getContent().getSection(VIEWS.components); - const buttons = await (await section.findWelcomeContent()).getButtons(); - for (const btn of buttons) { - if ((await btn.getTitle()) === BUTTONS.newComponent) { - button = btn; + await VSBrowser.instance.driver.wait( async () => { + const buttons = await (await section.findWelcomeContent()).getButtons(); + for (const btn of buttons) { + if ((await btn.getTitle()) === BUTTONS.newComponent) { + button = btn; + return true + } } - } + }, 10_000); } }); }