From 8b8494e424a965ce7e1a462909fb0910d1b30eb0 Mon Sep 17 00:00:00 2001 From: Anton Misskii <124462506+amisskii@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:30:03 +0100 Subject: [PATCH] chore(test): handle cli tool confirmation dialog (#10532) Signed-off-by: Anton Misskii --- tests/playwright/src/model/pages/cli-tools-page.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/playwright/src/model/pages/cli-tools-page.ts b/tests/playwright/src/model/pages/cli-tools-page.ts index 615516569..966785af0 100644 --- a/tests/playwright/src/model/pages/cli-tools-page.ts +++ b/tests/playwright/src/model/pages/cli-tools-page.ts @@ -19,6 +19,8 @@ import test, { expect as playExpect } from '@playwright/test'; import type { Locator, Page } from 'playwright'; +import { handleConfirmationDialog } from '/@/utility/operations'; + import { SettingsPage } from './settings-page'; export class CLIToolsPage extends SettingsPage { @@ -87,6 +89,15 @@ export class CLIToolsPage extends SettingsPage { await playExpect(this.getVersionSelectionButton(version)).toBeEnabled(); await this.getVersionSelectionButton(version).click(); + + const confirmationDialog = this.page.getByRole('dialog', { name: toolName }); + try { + await playExpect(confirmationDialog).toBeVisible(); + await handleConfirmationDialog(this.page, toolName); + } catch { + console.log(`Dialog for tool ${toolName} was not visible. Proceeding.`); + } + return this; }); }