= ({ children, value }) => {
+ return
+ {children}
+
+
+
+ ;
};
diff --git a/packages/html-reporter/src/testCaseView.spec.tsx b/packages/html-reporter/src/testCaseView.spec.tsx
index afe06cebcb..72552f5184 100644
--- a/packages/html-reporter/src/testCaseView.spec.tsx
+++ b/packages/html-reporter/src/testCaseView.spec.tsx
@@ -76,6 +76,19 @@ test('should render test case', async ({ mount }) => {
await expect(component.getByText('My test')).toBeVisible();
});
+test('should render copy buttons for annotations', async ({ mount, page, context }) => {
+ await context.grantPermissions(['clipboard-read', 'clipboard-write']);
+
+ const component = await mount();
+ await expect(component.getByText('Annotation text', { exact: false }).first()).toBeVisible();
+ component.getByText('Annotation text', { exact: false }).first().hover();
+ await expect(component.getByLabel('Copy to clipboard').first()).toBeVisible();
+ await component.getByLabel('Copy to clipboard').first().click();
+ const handle = await page.evaluateHandle(() => navigator.clipboard.readText());
+ const clipboardContent = await handle.jsonValue();
+ expect(clipboardContent).toBe('Annotation text');
+});
+
const annotationLinkRenderingTestCase: TestCase = {
testId: 'testid',
title: 'My test',
diff --git a/packages/html-reporter/src/testCaseView.tsx b/packages/html-reporter/src/testCaseView.tsx
index 5bed3c8309..1fe4f42ed3 100644
--- a/packages/html-reporter/src/testCaseView.tsx
+++ b/packages/html-reporter/src/testCaseView.tsx
@@ -26,6 +26,7 @@ import { TestResultView } from './testResultView';
import { linkifyText } from '@web/renderUtils';
import { hashStringToInt, msToString } from './utils';
import { clsx } from '@web/uiUtils';
+import { CopyToClipboardContainer } from './copyToClipboard';
export const TestCaseView: React.FC<{
projectNames: string[],
@@ -73,7 +74,7 @@ function TestCaseAnnotationView({ annotation: { type, description } }: { annotat
return (
{type}
- {description && : {linkifyText(description)}}
+ {description && : {linkifyText(description)}}
);
}