Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
feat(html): render the suite name before test title (#9909)
Pavel Feldmand79aae633cc6
diff --git a/packages/playwright-core/src/web/htmlReport/htmlReport.css b/packages/playwright-core/src/web/htmlReport/htmlReport.cssindex 33c6194b81..e0b215bc53 100644--- a/packages/playwright-core/src/web/htmlReport/htmlReport.css+++ b/packages/playwright-core/src/web/htmlReport/htmlReport.css@@ -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 {diff --git a/packages/playwright-core/src/web/htmlReport/htmlReport.tsx b/packages/playwright-core/src/web/htmlReport/htmlReport.tsxindex 44b6e97d5d..258a04147a 100644--- a/packages/playwright-core/src/web/htmlReport/htmlReport.tsx+++ b/packages/playwright-core/src/web/htmlReport/htmlReport.tsx@@ -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<{diff --git a/packages/playwright-test/src/reporters/html.ts b/packages/playwright-test/src/reporters/html.tsindex 1cf8103b56..8659ab9eec 100644--- a/packages/playwright-test/src/reporters/html.ts+++ b/packages/playwright-test/src/reporters/html.ts@@ -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 {diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.tsindex 3aca7263b2..6a7836c1fd 100644--- a/tests/page/page-request-continue.spec.ts+++ b/tests/page/page-request-continue.spec.ts@@ -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 }) => {