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
fix(html): dont show empty project label (#39966)
Simon Knott3c43adfd23af
diff --git a/packages/html-reporter/src/labels.tsx b/packages/html-reporter/src/labels.tsxindex 9aa52487cb..044e9ea074 100644--- a/packages/html-reporter/src/labels.tsx+++ b/packages/html-reporter/src/labels.tsx@@ -46,8 +46,8 @@ export const ProjectAndTagLabelsView: React.FC<{// We can have an empty project name if we have no projects specified in the configconst hasProjectNames = projectNames.length > 0 && !!activeProjectName;- return (hasProjectNames || otherLabels.length > 0) && <span className='label-row' style={style ?? {}}>- <ProjectLink projectNames={projectNames} projectName={activeProjectName} />+ return (hasProjectNames || otherLabels.length > 0) && <span className='label-row' style={style}>+ {hasProjectNames && <ProjectLink projectNames={projectNames} projectName={activeProjectName} />}<LabelsClickView labels={otherLabels} /></span>;};diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.tsindex 6631f7071e..bbc7230cd9 100644--- a/tests/playwright-test/reporter-html.spec.ts+++ b/tests/playwright-test/reporter-html.spec.ts@@ -1768,7 +1768,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {const result = await runInlineTest({'a.test.js': `const { expect, test } = require('@playwright/test');- test('pass', async ({}) => {+ test('pass', { tag: '@smoke' }, async ({}) => {expect(1).toBe(1);});`,@@ -1779,8 +1779,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {await showReport();- await expect(page.locator('.test-file-test .label')).toHaveCount(0);- await expect(page.locator('.label-row')).not.toBeVisible();+ await expect(page.locator('.test-file-test .label')).toHaveCount(1);});test('testCaseView - after click test label and go back, testCaseView should be visible', async ({ runInlineTest, showReport, page }) => {