Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: list fields allowed in metadata #34095

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
25 changes: 21 additions & 4 deletions docs/src/test-api/class-testconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,34 @@ export default defineConfig({

## property: TestConfig.metadata
* since: v1.10
- type: ?<[Metadata]>

Metadata that will be put directly to the test report serialized as JSON.
- type: ?<[Object]>
- `revision.id` ?<[string]> The unique identifier (e.g., hash or GUID) for the revision or commit that triggered the test run.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not actually populated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavelfeldman could you elaborate more, what do you mean under "not actually populated"?
I've tried with the latest Playwright - all these fields are shown in the report:
image

- `revision.author` ?<[string]> The name of the person who authored the revision or commit.
- `revision.email` ?<[string]> The email address of the author of the revision or commit.
- `revision.subject` ?<[string]> The subject or short description of the revision or commit, often provided in the commit message.
- `revision.timestamp` ?<[int]> The UNIX timestamp representing when the revision or commit was created.
- `revision.link` ?<[string]> A URL link to view details about the revision or commit in the repository's source control system.
- `ci.link` ?<[string]> A URL link to view the details of the test run in the CI/CD system.
- `timestamp` ?<[int]> The UNIX timestamp representing when the test run was initiated.

Metadata that will be put directly to the test report. Only certain fields are allowed in the metadata.

**Usage**

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';

export default defineConfig({
metadata: 'acceptance tests',
metadata: {
'revision.id': 'adcb0c51debdbe96a6a836e2ead9d40a859f6438',
'revision.author': 'Your Name',
'revision.email': '[email protected]',
'revision.subject': 'Acceptance tests',
'revision.timestamp': Date.now(),
'revision.link': 'https://github.com/microsoft/playwright',
'ci.link': 'https://github.com/microsoft/playwright/actions/workflows/tests_primary.yml',
'timestamp': Date.now(),
}
});
```

Expand Down
Loading