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.37",
text: "v1.1.38",
items: [{ text: "Changelog", link: "/changelog" }],
},
],
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.37] - Current
## [1.1.38] - Current

### Added

- **Automatic workspace and project annotations**: All tests now automatically receive `workspace` and `project` annotations via a Playwright [automatic fixture](https://playwright.dev/docs/test-fixtures#automatic-fixtures). The workspace name is derived from `testDir` and the project name comes from the Playwright project configuration. No consumer changes required.

## [1.1.37]

### Added

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.37",
"version": "1.1.38",
"description": "Test utilities for RHDH E2E tests",
"license": "Apache-2.0",
"repository": {
Expand Down
16 changes: 16 additions & 0 deletions src/playwright/fixtures/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { test as base } from "@playwright/test";
import { LoginHelper, UIhelper } from "../helpers/index.js";
import { runOnce } from "../run-once.js";
import { $ } from "../../utils/bash.js";
import { WorkspacePaths } from "../../utils/workspace-paths.js";
import path from "path";

type RHDHDeploymentTestFixtures = {
rhdh: RHDHDeployment;
uiHelper: UIhelper;
loginHelper: LoginHelper;
autoAnnotations: void;
};

type RHDHDeploymentWorkerFixtures = {
Expand Down Expand Up @@ -61,6 +63,20 @@ const baseTest = base.extend<
},
{ scope: "test" },
] as const,
autoAnnotations: [
// eslint-disable-next-line no-empty-pattern
async ({}, use, testInfo) => {
testInfo.annotations.push(
{
type: "workspace",
description: path.basename(WorkspacePaths.workspaceRoot),
},
{ type: "project", description: testInfo.project.name },
);
await use();
},
{ auto: true, scope: "test" },
],
});

export const test = Object.assign(baseTest, {
Expand Down
Loading