diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts index 83992c0bad..10da0abbc3 100644 --- a/tests/playwright-test/reporter-html.spec.ts +++ b/tests/playwright-test/reporter-html.spec.ts @@ -724,7 +724,27 @@ for (const useIntermediateMergeReport of [false] as const) { 'a.test.js': ` import { test, expect } from '@playwright/test'; test('annotated test', async ({ page }) => { - test.info().annotations.push({ type: 'issue', description: 'I am not interested in this test' }); +test.info().annotations.push({ type: 'issue', description: 'I am not interested in this test' }); + }); + `, + }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never' }); + expect(result.exitCode).toBe(0); + expect(result.passed).toBe(1); + + await showReport(); + await page.click('text=annotated test'); + await expect(page.locator('.test-case-annotation')).toHaveText('issue: I am not interested in this test'); + }); + + test('should render annotations with url', async ({ runInlineTest, page, showReport }) => { + const result = await runInlineTest({ + 'playwright.config.js': ` + module.exports = { timeout: 1500 }; + `, + 'a.test.js': ` + import { test, expect } from '@playwright/test'; + test('annotated test', async ({ page }) => { + test.info().annotations.push({ type: 'issue', description: 'I add URL field to annotations for hyperlink display', url: 'https://github.com/microsoft/playwright/pull/31014' }); }); `, }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never' });