Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default defineConfig({
{ text: "Examples", link: "/examples/" },
{ text: "Overlay Testing", link: "/overlay/" },
{
text: "v1.1.22",
text: "v1.1.25",
items: [{ text: "Changelog", link: "/changelog" }],
},
],
Expand Down
8 changes: 8 additions & 0 deletions docs/api/helpers/ui-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ async waitForLoad(timeout?: number): Promise<void>
```
Wait for page to fully load.

#### `dismissQuickstartIfVisible()`
```typescript
async dismissQuickstartIfVisible(options?: {
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`.

### Verification Methods

#### `verifyHeading()`
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.

## [1.1.24] - Current
## [1.1.25] - Current

### Added

- **`UIhelper.dismissQuickstartIfVisible()`**: Optionally closes the RHDH quickstart drawer when its **Hide** control is visible, so e2e tests are not blocked by the overlay. Optional `waitHiddenMs` (default `5000`) controls how long to wait for the button to become hidden after click.

## [1.1.24]

### Added

Expand Down
11 changes: 11 additions & 0 deletions docs/guide/helpers/ui-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ await uiHelper.waitForLoad();
await uiHelper.waitForLoad(10000); // Custom timeout
```

### `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.

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

Typical use is right after navigation or login, before assertions or interactions that need an unobstructed main view.

## Verification Methods

### `verifyHeading(heading, timeout?)`
Expand Down
10 changes: 10 additions & 0 deletions docs/overlay/reference/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ await uiHelper.searchInputPlaceholder("Search...", "query");
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):

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

See [UIhelper](/guide/helpers/ui-helper) and [UIhelper API](/api/helpers/ui-helper).

## Table Patterns

### Verify Table Rows
Expand Down
1 change: 1 addition & 0 deletions docs/overlay/test-structure/spec-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ Common methods from `UIhelper`:
| `clickButton(name)` | Click button by name |
| `clickLink(text)` | Click link by text |
| `waitForLoad()` | Wait for page load |
| `dismissQuickstartIfVisible()` | Close quickstart drawer if **Hide** is visible |

See [UIhelper API](/api/helpers/ui-helper) for full reference.

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": "1.1.24",
"version": "1.1.25",
"description": "Test utilities for RHDH E2E tests",
"license": "Apache-2.0",
"repository": {
Expand Down
16 changes: 16 additions & 0 deletions src/playwright/helpers/ui-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ 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.
*/
async dismissQuickstartIfVisible(options?: { waitHiddenMs?: number }) {
const waitHiddenMs = options?.waitHiddenMs ?? 5000;
const quickstartHide = this.page.getByRole("button", { name: "Hide" });
if (await quickstartHide.isVisible()) {
await quickstartHide.click();
await quickstartHide.waitFor({
state: "hidden",
timeout: waitHiddenMs,
});
}
}

async verifyComponentInCatalog(kind: string, expectedRows: string[]) {
await this.openSidebar("Catalog");
await this.selectMuiBox("Kind", kind);
Expand Down
Loading