-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
vitalets
wants to merge
1
commit into
microsoft:main
Choose a base branch
from
vitalets:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
- `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(), | ||
} | ||
}); | ||
``` | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: