Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/api/helpers/ui-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ Alias for `waitForLoad()`.
#### `dismissQuickstartIfVisible()`
```typescript
async dismissQuickstartIfVisible(options?: {
waitVisibleMs?: number;
waitHiddenMs?: number;
}): Promise<void>
```
If the RHDH quickstart drawer is open, clicks its **Hide** button and waits for the control to disappear. Does nothing when the button is not visible. Use before catalog search or other UI that the drawer can cover. Default `waitHiddenMs` is `5000`.
Waits briefly for the RHDH quickstart **Hide** button (`waitVisibleMs`, default `5000`), clicks it if it appears, then waits for it to disappear (`waitHiddenMs`, default `5000`). Returns quietly if Hide never shows. Call after login before `waitForAppReady` — the open drawer keeps a progressbar visible that would otherwise block app-ready waits.

### Verification Methods

Expand Down
8 changes: 7 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

All notable changes to this project will be documented in this file.

## [2.1.4] - Current
## [2.1.5] - Current

### Fixed

- **`dismissQuickstartIfVisible()` race after login**: The helper used an immediate `isVisible()` check, so it no-op'd when the Quickstart drawer mounted shortly after login. Later `waitForAppReady` / `waitForLoad` calls then timed out on the drawer's sticky `[role="progressbar"]`. The helper now waits briefly for the **Hide** button (`waitVisibleMs`, default `5000`) before clicking, and still returns quietly if Quickstart never appears.

## [2.1.4]

### Changed

Expand Down
9 changes: 6 additions & 3 deletions docs/guide/helpers/ui-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ On instances using the new frontend system (BUI), `waitForLoad` waits for both l

### `dismissQuickstartIfVisible(options?)`

When the [quickstart](https://github.com/redhat-developer/rhdh-plugins/tree/main/workspaces/quickstart) plugin opens its drawer (for example after login), it can sit over the catalog, search field, or other controls. This method clicks **Hide** only if that button is visible, then waits for it to go away; otherwise it returns immediately.
When the [quickstart](https://github.com/redhat-developer/rhdh-plugins/tree/main/workspaces/quickstart) plugin opens its drawer (for example after login), it can sit over the catalog, search field, or other controls — and its sticky progressbar blocks `waitForAppReady`. This method waits briefly for **Hide** to appear (`waitVisibleMs`, default `5000`), clicks it, then waits for it to go away (`waitHiddenMs`, default `5000`). If Hide never shows, it returns immediately.

```typescript
await uiHelper.dismissQuickstartIfVisible();
await uiHelper.dismissQuickstartIfVisible({ waitHiddenMs: 10_000 });
await uiHelper.dismissQuickstartIfVisible({
waitVisibleMs: 10_000,
waitHiddenMs: 10_000,
});
```

Typical use is right after navigation or login, before assertions or interactions that need an unobstructed main view.
Typical use is right after login, before `waitForAppReady` or assertions that need an unobstructed main view. Do not call `waitForAppReady` first — that wait includes the quickstart progressbar.

## Verification Methods

Expand Down
3 changes: 2 additions & 1 deletion docs/overlay/reference/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ await uiHelper.selectMuiBox("Category", "Option 1");

### Dismiss quickstart drawer

When the RHDH quickstart plugin shows its drawer, it can cover catalog search and other controls. Call this after login or navigation if needed (it is a no-op when **Hide** is not visible):
When the RHDH quickstart plugin shows its drawer, it can cover catalog search and other controls — and its progressbar blocks `waitForAppReady`. Call this after login (it waits briefly for **Hide**, then no-ops if the drawer never appears). Call it *before* `waitForAppReady`:

```typescript
await uiHelper.dismissQuickstartIfVisible();
await uiHelper.waitForAppReady();
```

See [UIhelper](/guide/helpers/ui-helper) and [UIhelper API](/api/helpers/ui-helper).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@red-hat-developer-hub/e2e-test-utils",
"version": "2.1.4",
"version": "2.1.5",
"description": "Test utilities for RHDH E2E tests",
"license": "Apache-2.0",
"repository": {
Expand Down
29 changes: 22 additions & 7 deletions src/playwright/helpers/ui-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,34 @@ export class UIhelper {
}

/**
* Closes the quickstart drawer when the "Hide" button is visible (RHDH quickstart plugin),
* so it does not cover catalog or other UI under test.
* Closes the quickstart drawer when the "Hide" button appears (RHDH quickstart plugin),
* so it does not cover catalog or other UI under test / block waitForAppReady via its
* sticky progressbar. Waits briefly for Hide to mount (drawer often appears after login
* settles); returns without error if it never shows.
*
* Do not call waitForAppReady before this — that wait includes `[role="progressbar"]`,
* which the open quickstart drawer keeps visible until dismissed.
*/
async dismissQuickstartIfVisible(options?: { waitHiddenMs?: number }) {
async dismissQuickstartIfVisible(options?: {
waitVisibleMs?: number;
waitHiddenMs?: number;
}) {
const waitVisibleMs = options?.waitVisibleMs ?? 5000;
const waitHiddenMs = options?.waitHiddenMs ?? 5000;
const quickstartHide = this.page.getByRole("button", { name: "Hide" });
if (await quickstartHide.isVisible()) {
await quickstartHide.click();
try {
await quickstartHide.waitFor({
state: "hidden",
timeout: waitHiddenMs,
state: "visible",
timeout: waitVisibleMs,
});
} catch {
return;
}
await quickstartHide.click();
await quickstartHide.waitFor({
state: "hidden",
timeout: waitHiddenMs,
});
}

async verifyComponentInCatalog(kind: string, expectedRows: string[]) {
Expand Down
Loading