Skip to content

ExtensionsPage API

Page object for the RHDH extensions/plugins marketplace page.

Import

typescript
import { ExtensionsPage } from "rhdh-e2e-test-utils/pages";

Constructor

typescript
new ExtensionsPage(page: Page)

Creates a new ExtensionsPage instance with an internal UIhelper.

ParameterTypeDescription
pagePagePlaywright Page object

Properties

PropertyTypeDescription
badgeLocatorLocator for the TaskAltIcon badge

Methods

clickReadMoreByPluginTitle(pluginTitle)

typescript
async clickReadMoreByPluginTitle(pluginTitle: string): Promise<void>

Click the "Read more" link for a specific plugin.

ParameterTypeDescription
pluginTitlestringThe plugin title to find

Example:

typescript
await extensionsPage.clickReadMoreByPluginTitle("Tech Radar");

selectSupportTypeFilter(supportType)

typescript
async selectSupportTypeFilter(supportType: string): Promise<void>

Filter plugins by support type.

ParameterTypeDescription
supportTypestringThe support type to filter by

Example:

typescript
await extensionsPage.selectSupportTypeFilter("Red Hat");

resetSupportTypeFilter(supportType)

typescript
async resetSupportTypeFilter(supportType: string): Promise<void>

Reset/toggle off a support type filter.

ParameterTypeDescription
supportTypestringThe support type to toggle off

waitForSearchResults(searchText)

typescript
async waitForSearchResults(searchText: string): Promise<void>

Wait for search results to contain the specified text.

ParameterTypeDescription
searchTextstringText to wait for in results

verifyMultipleHeadings(headings?)

typescript
async verifyMultipleHeadings(headings?: string[]): Promise<void>

Verify multiple headings are visible on the page.

ParameterTypeDefaultDescription
headingsstring[]Common headingsList of headings to verify

Default headings: ["Versions", "Author", "Tags", "Category", "Publisher", "Support Provider"]

verifyPluginDetails(options)

typescript
async verifyPluginDetails(options: {
  pluginName: string;
  badgeLabel: string;
  badgeText: string;
  headings?: string[];
  includeTable?: boolean;
  includeAbout?: boolean;
}): Promise<void>

Click on a plugin and verify its details modal.

OptionTypeDefaultDescription
pluginNamestring-Plugin name to click
badgeLabelstring-Expected badge label
badgeTextstring-Expected badge text
headingsstring[]Common headingsHeadings to verify
includeTablebooleantrueVerify table headers
includeAboutbooleanfalseVerify "About" text

Example:

typescript
await extensionsPage.verifyPluginDetails({
  pluginName: "Tech Radar",
  badgeLabel: "support-type",
  badgeText: "Red Hat",
  includeAbout: true,
});

verifySupportTypeBadge(options)

typescript
async verifySupportTypeBadge(options: {
  supportType: string;
  pluginName?: string;
  badgeLabel: string;
  badgeText: string;
  tooltipText: string;
  searchTerm?: string;
  headings?: string[];
  includeTable?: boolean;
  includeAbout?: boolean;
}): Promise<void>

Filter by support type and verify badge details, optionally opening a specific plugin.

OptionTypeDescription
supportTypestringSupport type to filter by
pluginNamestringOptional plugin to verify
badgeLabelstringExpected badge label
badgeTextstringExpected badge text
tooltipTextstringExpected tooltip text on hover
searchTermstringOptional search term
headingsstring[]Headings to verify
includeTablebooleanVerify table headers
includeAboutbooleanVerify "About" text

verifyKeyValueRowElements(rowTitle, rowValue)

typescript
async verifyKeyValueRowElements(rowTitle: string, rowValue: string): Promise<void>

Verify a key-value row in a table.

ParameterTypeDescription
rowTitlestringThe row title/key
rowValuestringThe expected value

Complete Example

typescript
import { test, expect } from "@playwright/test";
import { ExtensionsPage } from "rhdh-e2e-test-utils/pages";
import { UIhelper } from "rhdh-e2e-test-utils/helpers";

test("browse and filter extensions", async ({ page }) => {
  const uiHelper = new UIhelper(page);
  const extensionsPage = new ExtensionsPage(page);

  // Navigate to extensions
  await uiHelper.openSidebar("Extensions");

  // Filter by support type
  await extensionsPage.selectSupportTypeFilter("Red Hat");

  // Verify a specific plugin
  await extensionsPage.verifyPluginDetails({
    pluginName: "Tech Radar",
    badgeLabel: "support-type",
    badgeText: "Red Hat",
    includeAbout: true,
  });

  // Reset filter
  await extensionsPage.resetSupportTypeFilter("Red Hat");
});

Released under the Apache-2.0 License.