-
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
base: main
Are you sure you want to change the base?
Conversation
|
||
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. |
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:
Are you using gitCommitInfo plugin? It is internal and can go away at any moment... |
No. Just provided metadata explicitly in the config: export default defineConfig({
reporter: 'html',
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(),
}
}); |
Ah, I see. Users won't know they need to do it, the actual type for the Metadata is Record<string, any> so that everyone could provide what they want. So these properties are a subject to change and the way they are rendered in html report should be based on reflection. |
Yeah, that's why I've decided to clarify the docs. Because when I provide custom properties to metadata, they do not appear in the HTML report, that is confusing (#31415, #33831). Also the provided example does not pass the TypeScript check. What can be improved as of now? I can set more accurate type for Metadata here and use it in MetadataView instead of Metainfo type. |
Fixes #34094, #33831