Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: rename to copy prompt (#35057)

Pavel Feldman1423d0f8a76d
diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md
index 143e6dd701..4083014edb 100644
--- a/docs/src/release-notes-js.md
+++ b/docs/src/release-notes-js.md
@@ -31,9 +31,9 @@ import LiteYouTube from '@site/src/components/LiteYouTube';
### Copy as prompt
-New "Copy as Prompt" button on errors in the HTML report, trace viewer and UI mode. Click to copy a pre-filled LLM prompt that contains the error message and useful context for fixing the error.
+New "Copy prompt" button on errors in the HTML report, trace viewer and UI mode. Click to copy a pre-filled LLM prompt that contains the error message and useful context for fixing the error.
- ![Copy as Prompt](https://github.com/user-attachments/assets/f3654407-dd6d-4240-9845-0d96df2bf30a)
+ ![Copy prompt](https://github.com/user-attachments/assets/f3654407-dd6d-4240-9845-0d96df2bf30a)
### Filter visible elements
diff --git a/packages/html-reporter/src/testErrorView.tsx b/packages/html-reporter/src/testErrorView.tsx
index b85eab50ca..1ba8432829 100644
--- a/packages/html-reporter/src/testErrorView.tsx
+++ b/packages/html-reporter/src/testErrorView.tsx
@@ -58,7 +58,7 @@ const PromptButton: React.FC<{ prompt: string }> = ({ prompt }) => {
setCopied(false);
}, 3000);
}}>
- {copied ? 'Copied' : 'Copy as Prompt'}
+ {copied ? 'Copied' : 'Copy prompt'}
</button>;
};
diff --git a/packages/trace-viewer/src/ui/errorsTab.tsx b/packages/trace-viewer/src/ui/errorsTab.tsx
index d18c1bb445..7ade3e2dbf 100644
--- a/packages/trace-viewer/src/ui/errorsTab.tsx
+++ b/packages/trace-viewer/src/ui/errorsTab.tsx
@@ -31,7 +31,7 @@ const CopyPromptButton: React.FC<{ prompt: string }> = ({ prompt }) => {
return (
<CopyToClipboardTextButton
value={prompt}
- description='Copy as Prompt'
+ description='Copy prompt'
copiedDescription={<>Copied <span className='codicon codicon-copy' style={{ marginLeft: '5px' }}/></>}
style={{ width: '120px', justifyContent: 'center' }}
/>
diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts
index 178266d514..cf84a65cc5 100644
--- a/tests/playwright-test/reporter-html.spec.ts
+++ b/tests/playwright-test/reporter-html.spec.ts
@@ -2779,7 +2779,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
await page.getByRole('link', { name: 'sample' }).click();
- await page.getByRole('button', { name: 'Copy as Prompt' }).click();
+ await page.getByRole('button', { name: 'Copy prompt' }).click();
const prompt = await page.evaluate(() => navigator.clipboard.readText());
expect(prompt, 'first line').toContain(`Playwright test failed.`);
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts
index 090e39ecfe..71b63da16e 100644
--- a/tests/playwright-test/ui-mode-trace.spec.ts
+++ b/tests/playwright-test/ui-mode-trace.spec.ts
@@ -514,7 +514,7 @@ test('fails', async ({ page }) => {
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
await page.getByText('Errors', { exact: true }).click();
- await page.locator('.tab-errors').getByRole('button', { name: 'Copy as Prompt' }).click();
+ await page.locator('.tab-errors').getByRole('button', { name: 'Copy prompt' }).click();
const prompt = await page.evaluate(() => navigator.clipboard.readText());
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
expect(prompt.replaceAll('\r\n', '\n'), 'contains test sources').toContain(`