-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(html): allow setting a title to display #35659
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Please make laser-focused changes that are required for this feature, otherwise it is hard to review / land it.
projectNames={report?.json().projectNames || []} | ||
/> | ||
<Body> | ||
<TestFilesHeader report={json} filteredStats={filteredStats} metadataVisible={metadataVisible} toggleMetadataVisible={() => setMetadataVisible(visible => !visible)}/> |
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.
Why is everything changes?
@@ -55,7 +55,7 @@ export const TestCaseView: React.FC<{ | |||
<div style={{ width: 10 }}></div> | |||
<div className={clsx(!next && 'hidden')}><Link href={testResultHref({ test: next }) + filterParam}>next »</Link></div> | |||
</div>} | |||
{test && <div className='test-case-title'>{test?.title}</div>} | |||
{test && <div className='report-title'>{test?.title}</div>} |
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.
We should have it with a neutral name in the common.css
@@ -83,6 +84,9 @@ export const TestFilesHeader: React.FC<{ | |||
<div data-testid='overall-duration' style={{ color: 'var(--color-fg-subtle)' }}>Total time: {msToString(report.duration ?? 0)}</div> | |||
</div> | |||
{metadataVisible && <MetadataView metadata={report.metadata}/>} | |||
{report.options.title && <div className={clsx('report-title', metadataVisible && 'metadata-visible')}> |
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.
Let's make sure the titles is above the metadata.
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"2 failed 5 flaky39054 passed, 799 skipped Merge workflow run. |
Allow the user to display a title in the HTML reporter. It is configured through the main Playwright config:
or via the envvar
PLAYWRIGHT_HTML_TITLE
.Titles are displayed solely on the root page of the reporter, in the same manner as we display test titles.
The document title is also set to this configured value, if set.
Addresses #35614.