Skip to content

Commit

Permalink
chore(test): fix navigation to webview (#1052)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lazar <[email protected]>
  • Loading branch information
cbr7 authored Nov 27, 2024
1 parent c5f5316 commit 744f6bb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/playwright/src/bootc-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,22 @@ async function ensureBootcIsRemoved(navigationBar: NavigationBar): Promise<void>
}

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');
Expand Down

0 comments on commit 744f6bb

Please sign in to comment.