Skip to content

RHDH E2E Test UtilsEnd-to-End Testing Framework

Deploy, test, and validate Red Hat Developer Hub plugins with Playwright

Quick Example

typescript
// playwright.config.ts
import { defineConfig } from "rhdh-e2e-test-utils/playwright-config";

export default defineConfig({
  projects: [{ name: "my-plugin" }],
});
typescript
// tests/my-plugin.spec.ts
import { test, expect } from "rhdh-e2e-test-utils/test";

test.beforeAll(async ({ rhdh }) => {
  await rhdh.configure({ auth: "keycloak" });
  await rhdh.deploy();
});

test.beforeEach(async ({ loginHelper }) => {
  await loginHelper.loginAsKeycloakUser();
});

test("verify catalog", async ({ uiHelper }) => {
  await uiHelper.openSidebar("Catalog");
  await uiHelper.verifyHeading("My Catalog");
});

What is rhdh-e2e-test-utils?

rhdh-e2e-test-utils is a comprehensive test utility package for Red Hat Developer Hub (RHDH) end-to-end testing. It provides a unified framework for:

  • Deploying RHDH instances to OpenShift clusters via Helm or the RHDH Operator
  • Managing Keycloak for OIDC authentication testing
  • Running Playwright tests with custom fixtures optimized for RHDH
  • Interacting with RHDH UI through helper classes and page objects
  • Managing Kubernetes resources through a simplified client API

Next Steps

Released under the Apache-2.0 License.