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.9",
text: "v1.1.10",
items: [{ text: "Changelog", link: "/changelog" }],
},
],
Expand Down
28 changes: 16 additions & 12 deletions docs/api/playwright/base-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,22 @@ Raw base configuration object. Use for advanced customization.
testDir: "./tests",
timeout: 90000,
expect: {
timeout: 30000,
timeout: 10000,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: "50%",
reporter: [["list"], ["html"]],
retries: Number(process.env.PLAYWRIGHT_RETRIES ?? 0),
workers: process.env.PLAYWRIGHT_WORKERS || "50%",
outputDir: "node_modules/.cache/e2e-test-results",
reporter: [["list"], ["html"], ["json"]],
use: {
viewport: { width: 1920, height: 1080 },
video: "on",
video: { mode: "retain-on-failure", size: { width: 1280, height: 720 } },
trace: "retain-on-failure",
screenshot: "only-on-failure",
actionTimeout: 10000,
navigationTimeout: 50000,
},
globalSetup: require.resolve("./global-setup"),
globalSetup: resolve(import.meta.dirname, "../playwright/global-setup.js"),
}
```

Expand All @@ -89,14 +91,16 @@ export default playwrightDefineConfig({
|---------|-------|
| `testDir` | `"./tests"` |
| `timeout` | `90000` |
| `expect.timeout` | `30000` |
| `fullyParallel` | `true` |
| `retries` | `1` (CI), `0` (local) |
| `workers` | `"50%"` |
| `expect.timeout` | `10000` |
| `retries` | `0` (configurable via `PLAYWRIGHT_RETRIES`) |
| `workers` | `"50%"` (configurable via `PLAYWRIGHT_WORKERS`) |
| `outputDir` | `"node_modules/.cache/e2e-test-results"` |
| `viewport` | `1920x1080` |
| `video` | `"on"` |
| `video` | `"retain-on-failure"` at `1280x720` |
| `trace` | `"retain-on-failure"` |
| `screenshot` | `"only-on-failure"` |
| `actionTimeout` | `10000` |
| `navigationTimeout` | `50000` |

## Customization Examples

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

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

## [1.1.9] - Current
## [1.1.10] - Current

### Fixed
- **`plugins-list.yaml` parsing**: Parse as proper YAML instead of text splitting, correctly handling entries with build flags (e.g., `--embed-package`, `--suppress-native-package`) and YAML comments.

### Changed
- **Video recording**: Changed mode from `"on"` to `"retain-on-failure"` and reduced size from `1920x1080` to `1280x720` to save disk space.
- **Workers and retries**: Now configurable via `PLAYWRIGHT_WORKERS` (default: `"50%"`) and `PLAYWRIGHT_RETRIES` (default: `0`) environment variables.

## [1.1.9]

### Fixed
- **OCI URL replacement with user-provided `dynamic-plugins.yaml`**: When a workspace provides its own `dynamic-plugins.yaml`, plugin package paths were not replaced with OCI URLs for PR builds. Extracted shared `replaceWithOCIUrls()` function so both `generateDynamicPluginsConfigFromMetadata()` and `loadAndInjectPluginMetadata()` code paths now perform OCI replacement when `GIT_PR_NUMBER` is set.
Expand Down
7 changes: 7 additions & 0 deletions docs/guide/configuration/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ These are set automatically during deployment:
| `K8S_CLUSTER_ROUTER_BASE` | OpenShift ingress domain | Global setup |
| `RHDH_BASE_URL` | Full RHDH URL | RHDHDeployment |

## Playwright Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `PLAYWRIGHT_WORKERS` | Number of parallel workers (e.g., `"4"`, `"50%"`) | `"50%"` |
| `PLAYWRIGHT_RETRIES` | Number of test retries on failure | `0` |

## Optional Variables

| Variable | Description | Default |
Expand Down
17 changes: 10 additions & 7 deletions docs/guide/core-concepts/playwright-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The `defineConfig` function extends your configuration with sensible defaults fo
| `testDir` | `./tests` | Test files location |
| `timeout` | 90,000ms | Test timeout |
| `expect.timeout` | 10,000ms | Assertion timeout |
| `retries` | 1 (CI), 0 (local) | Test retries |
| `workers` | 50% of CPUs | Parallel workers |
| `retries` | `0` (configurable via `PLAYWRIGHT_RETRIES`) | Test retries |
| `workers` | `"50%"` (configurable via `PLAYWRIGHT_WORKERS`) | Parallel workers |
| `outputDir` | `node_modules/.cache/e2e-test-results` | Playwright artifacts |

### Reporter Settings
Expand All @@ -44,7 +44,7 @@ The `defineConfig` function extends your configuration with sensible defaults fo
| `trace` | `"retain-on-failure"` |
| `screenshot` | `"only-on-failure"` |
| `viewport` | `{ width: 1920, height: 1080 }` |
| `video` | `"on"` |
| `video` | `"retain-on-failure"` at `1280x720` |
| `actionTimeout` | 10,000ms |
| `navigationTimeout` | 50,000ms |

Expand Down Expand Up @@ -118,11 +118,14 @@ export default defineConfig({
## Environment Variables for Configuration

```bash
# Affects retries (2 in CI, 0 locally)
# Enables forbidOnly and auto-cleanup
CI=true

# Custom test directory
# (set via defineConfig, not env var)
# Configure retries (default: 0)
PLAYWRIGHT_RETRIES=2

# Configure parallel workers (default: "50%")
PLAYWRIGHT_WORKERS=4
```

## Using Base Config Directly
Expand Down Expand Up @@ -204,7 +207,7 @@ export default defineConfig({
// Browser settings
use: {
viewport: { width: 1920, height: 1080 },
video: "on",
video: { mode: "retain-on-failure", size: { width: 1280, height: 720 } },
trace: "retain-on-failure",
screenshot: "only-on-failure",
},
Expand Down
2 changes: 1 addition & 1 deletion docs/overlay/examples/basic-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ workspaces/<plugin>/e2e-tests/
"eslint-plugin-check-file": "^3.3.1",
"eslint-plugin-playwright": "^2.4.0",
"prettier": "^3.7.4",
"rhdh-e2e-test-utils": "1.1.9",
"rhdh-e2e-test-utils": "1.1.10",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/overlay/examples/tech-radar.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ workspaces/tech-radar/e2e-tests/
"eslint-plugin-check-file": "^3.3.1",
"eslint-plugin-playwright": "^2.4.0",
"prettier": "^3.7.4",
"rhdh-e2e-test-utils": "1.1.9",
"rhdh-e2e-test-utils": "1.1.10",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/overlay/test-structure/directory-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Defines the test package with dependencies and scripts:
"eslint-plugin-check-file": "^3.3.1",
"eslint-plugin-playwright": "^2.4.0",
"prettier": "^3.7.4",
"rhdh-e2e-test-utils": "1.1.9",
"rhdh-e2e-test-utils": "1.1.10",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
}
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": "rhdh-e2e-test-utils",
"version": "1.1.9",
"version": "1.1.10",
"description": "Test utilities for RHDH E2E tests",
"license": "Apache-2.0",
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions src/playwright/base-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { resolve } from "path";
export const baseConfig: PlaywrightTestConfig = {
testDir: "./tests",
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: "50%",
retries: Number(process.env.PLAYWRIGHT_RETRIES ?? 0),
workers: process.env.PLAYWRIGHT_WORKERS || "50%",
outputDir: "node_modules/.cache/e2e-test-results",
timeout: 90_000,
reporter: [
Expand All @@ -26,8 +26,8 @@ export const baseConfig: PlaywrightTestConfig = {
screenshot: "only-on-failure",
viewport: { width: 1920, height: 1080 },
video: {
mode: "on",
size: { width: 1920, height: 1080 },
mode: "retain-on-failure",
size: { width: 1280, height: 720 },
},
actionTimeout: 10_000,
navigationTimeout: 50_000,
Expand Down
21 changes: 14 additions & 7 deletions src/utils/plugin-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,20 @@ async function getOCIUrlsForPR(
}
const ownerRepo = match[1];

// Read plugins list
const pluginsList = await fs.readFile(pluginsListPath, "utf-8");
const pluginPaths = pluginsList
.trim()
.split("\n")
.map((l: string) => l.replace(/:$/, "").trim())
.filter(Boolean);
// Parse plugins-list.yaml as YAML and extract keys (plugin paths)
const pluginsListContent = await fs.readFile(pluginsListPath, "utf-8");
const pluginsListData = yaml.load(pluginsListContent) as Record<
string,
unknown
> | null;

if (!pluginsListData || typeof pluginsListData !== "object") {
throw new Error(
`[PluginMetadata] plugins-list.yaml is empty or invalid: ${pluginsListPath}`,
);
}

const pluginPaths = Object.keys(pluginsListData);

const workspaceName = path.basename(workspacePath);

Expand Down