diff --git a/docs/changelog.md b/docs/changelog.md index 86372f2..3e627ef 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,7 +2,13 @@ All notable changes to this project will be documented in this file. -## [2.1.21] - Current +## [2.1.22] - Current + +### Fixed + +- **UIhelper#verifyAlertErrorMessage**: match sign-in error toasts that are not exposed as `role="alert"` (alertdialog / alert / text fallback, visible filter, 30s timeout). + +## [2.1.21] ### Fixed diff --git a/package.json b/package.json index 2152d8e..50efa74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@red-hat-developer-hub/e2e-test-utils", - "version": "2.1.21", + "version": "2.1.22", "description": "Test utilities for RHDH E2E tests", "license": "Apache-2.0", "repository": { diff --git a/src/playwright/helpers/ui-helper.ts b/src/playwright/helpers/ui-helper.ts index 44b871e..8cd6ce8 100644 --- a/src/playwright/helpers/ui-helper.ts +++ b/src/playwright/helpers/ui-helper.ts @@ -584,9 +584,14 @@ export class UIhelper { } async verifyAlertErrorMessage(message: string | RegExp) { - const alert = this.page.getByRole("alert"); - await alert.waitFor(); - await expect(alert).toHaveText(message); + const alert = this.page + .getByRole("alertdialog") + .filter({ hasText: message }) + .or(this.page.getByRole("alert").filter({ hasText: message })) + .or(this.page.getByText(message)); + await expect(alert.filter({ visible: true }).first()).toBeVisible({ + timeout: 30_000, + }); } async verifyTextInTooltip(text: string | RegExp) {