Skip to content

Commit

Permalink
chore(test): handle cli tool confirmation dialog (#10532)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Misskii <[email protected]>
  • Loading branch information
amisskii authored Jan 7, 2025
1 parent 7729cfd commit 8b8494e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/playwright/src/model/pages/cli-tools-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
});
}
Expand Down

0 comments on commit 8b8494e

Please sign in to comment.