mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 19:04:43 +03:00
feat(html): render the suite name before test title (#9909)
This commit is contained in:
parent
4f1027bdd0
commit
d79aae633c
@ -177,8 +177,6 @@ svg {
|
||||
|
||||
.test-case-title {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
font-weight: 400;
|
||||
font-size: 32px !important;
|
||||
@ -187,9 +185,14 @@ svg {
|
||||
|
||||
.test-case-location {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10px 10px;
|
||||
padding: 0 10px 20px;
|
||||
}
|
||||
|
||||
.test-case-path {
|
||||
flex: none;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.test-details-column {
|
||||
|
@ -152,9 +152,9 @@ const TestFileSummaryView: React.FC<{
|
||||
<div key={`test-${test.testId}`} className={'test-summary outcome-' + test.outcome}>
|
||||
<span style={{ float: 'right' }}>{msToString(test.duration)}</span>
|
||||
{statusIcon(test.outcome)}
|
||||
<Link href={`#?testId=${test.testId}`}>
|
||||
{test.title}
|
||||
<span className='test-summary-path'>— {test.path.join(' › ')}</span>
|
||||
<Link href={`#?testId=${test.testId}`} title={[...test.path, test.title].join(' › ')}>
|
||||
{[...test.path, test.title].join(' › ')}
|
||||
<span className='test-summary-path'>— {test.location.file}:{test.location.line}</span>
|
||||
</Link>
|
||||
{report.projectNames.length > 1 && !!test.projectName &&
|
||||
<ProjectLink report={report} projectName={test.projectName}></ProjectLink>}
|
||||
@ -189,8 +189,9 @@ const TestCaseView: React.FC<{
|
||||
|
||||
const [selectedResultIndex, setSelectedResultIndex] = React.useState(0);
|
||||
return <div className='test-case-column vbox'>
|
||||
{test && <div className='test-case-path'>{test.path.join(' › ')}</div>}
|
||||
{test && <div className='test-case-title'>{test?.title}</div>}
|
||||
{test && <div className='test-case-location'>{test.path.join(' › ')}</div>}
|
||||
{test && <div className='test-case-location'>{test.location.file}:{test.location.line}</div>}
|
||||
{test && !!test.projectName && <ProjectLink report={report} projectName={test.projectName}></ProjectLink>}
|
||||
{test && <TabbedPane tabs={
|
||||
test.results.map((result, index) => ({
|
||||
@ -459,9 +460,10 @@ const ProjectLink: React.FunctionComponent<{
|
||||
const Link: React.FunctionComponent<{
|
||||
href: string,
|
||||
className?: string,
|
||||
title?: string,
|
||||
children: any,
|
||||
}> = ({ href, className, children }) => {
|
||||
return <a className={`no-decorations${className ? ' ' + className : ''}`} href={href}>{children}</a>;
|
||||
}> = ({ href, className, children, title }) => {
|
||||
return <a className={`no-decorations${className ? ' ' + className : ''}`} href={href} title={title}>{children}</a>;
|
||||
};
|
||||
|
||||
const Route: React.FunctionComponent<{
|
||||
|
@ -305,14 +305,14 @@ class HtmlBuilder {
|
||||
private _processJsonSuite(suite: JsonSuite, fileId: string, projectName: string, path: string[], out: TestEntry[]) {
|
||||
const newPath = [...path, suite.title];
|
||||
suite.suites.map(s => this._processJsonSuite(s, fileId, projectName, newPath, out));
|
||||
suite.tests.forEach(t => out.push(this._createTestEntry(t, fileId, projectName, newPath)));
|
||||
suite.tests.forEach(t => out.push(this._createTestEntry(t, projectName, newPath)));
|
||||
}
|
||||
|
||||
private _createTestEntry(test: JsonTestCase, fileId: string, projectName: string, path: string[]): TestEntry {
|
||||
private _createTestEntry(test: JsonTestCase, projectName: string, path: string[]): TestEntry {
|
||||
const duration = test.results.reduce((a, r) => a + r.duration, 0);
|
||||
this._tests.set(test.testId, test);
|
||||
const location = test.location;
|
||||
path = [location.file + ':' + location.line, ...path.slice(1)];
|
||||
path = [...path.slice(1)];
|
||||
this._testPath.set(test.testId, path);
|
||||
|
||||
return {
|
||||
|
@ -96,7 +96,7 @@ it('should amend method on main request', async ({ page, server }) => {
|
||||
expect((await request).method).toBe('POST');
|
||||
});
|
||||
|
||||
it.describe('', () => {
|
||||
it.describe('post data', () => {
|
||||
it.fixme(({ isAndroid }) => isAndroid, 'Post data does not work');
|
||||
|
||||
it('should amend post data', async ({ page, server }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user