Installation
Package Installation
Install via npm:
bash
npm install rhdh-e2e-test-utilsOr via yarn:
bash
yarn add rhdh-e2e-test-utilsOr directly from GitHub (for development versions):
bash
npm install github:redhat-developer/rhdh-e2e-test-utils#mainPeer Dependencies
The package requires @playwright/test as a peer dependency:
bash
npm install @playwright/testVerifying Installation
After installation, you can verify by importing the package:
typescript
import { test, expect } from "rhdh-e2e-test-utils/test";
import { defineConfig } from "rhdh-e2e-test-utils/playwright-config";
// If these imports work without errors, installation is successfulProject Setup
1. Create E2E Test Directory
bash
mkdir e2e-tests && cd e2e-tests
yarn init -y2. Install Dependencies
bash
yarn add @playwright/test rhdh-e2e-test-utils typescript3. Create Configuration Files
Create the following files in your project:
playwright.config.ts
typescript
import { defineConfig } from "rhdh-e2e-test-utils/playwright-config";
export default defineConfig({
projects: [
{
name: "my-plugin",
},
],
});tsconfig.json
json
{
"extends": "rhdh-e2e-test-utils/tsconfig",
"include": ["tests/**/*.ts"]
}eslint.config.js
javascript
import { createEslintConfig } from "rhdh-e2e-test-utils/eslint";
export default createEslintConfig(import.meta.dirname);4. Create Test Directory Structure
bash
mkdir -p tests/config tests/specsYour project structure should look like:
e2e-tests/
├── package.json
├── playwright.config.ts
├── tsconfig.json
├── eslint.config.js
├── .env # Environment variables
└── tests/
├── config/
│ ├── app-config-rhdh.yaml # RHDH app configuration
│ ├── dynamic-plugins.yaml # Plugin configuration
│ └── rhdh-secrets.yaml # Secrets template
└── specs/
└── my-plugin.spec.ts # Test filesNext Steps
- Requirements - Check system and cluster requirements
- Quick Start - Create your first test