diff --git a/tests/playwright/src/bootc-extension.spec.ts b/tests/playwright/src/bootc-extension.spec.ts index 8b7acd53..65dc3dd1 100644 --- a/tests/playwright/src/bootc-extension.spec.ts +++ b/tests/playwright/src/bootc-extension.spec.ts @@ -214,13 +214,22 @@ async function ensureBootcIsRemoved(navigationBar: NavigationBar): Promise } async function handleWebview(runner: Runner): Promise<[Page, Page]> { + const BOOTC_NAVBAR_EXTENSION_LABEL: string = 'Bootable Containers'; + const BOOTC_PAGE_BODY_LABEL: string = 'Webview Bootable Containers'; + const page = runner.getPage(); - await page.getByLabel('Bootable Containers').click(); - await page.waitForTimeout(2000); + const navigationBar = new NavigationBar(page); + const bootcPodmanExtensionButton = navigationBar.navigationLocator.getByRole('link', { + name: BOOTC_NAVBAR_EXTENSION_LABEL, + }); + + await playExpect(bootcPodmanExtensionButton).toBeEnabled(); + await bootcPodmanExtensionButton.click(); + await page.waitForTimeout(2_000); - const webView = page.getByRole('document', { name: 'Bootable Containers' }); + const webView = page.getByRole('document', { name: BOOTC_PAGE_BODY_LABEL }); await playExpect(webView).toBeVisible(); - await new Promise(resolve => setTimeout(resolve, 1000)); + await new Promise(resolve => setTimeout(resolve, 1_000)); const [mainPage, webViewPage] = runner.getElectronApp().windows(); await mainPage.evaluate(() => { const element = document.querySelector('webview');