Skip to content

Commit

Permalink
cherry-pick(#35057): chore: rename to copy prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Mar 5, 2025
1 parent 224385a commit ef33c83
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/src/release-notes-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/html-reporter/src/testErrorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const PromptButton: React.FC<{ prompt: string }> = ({ prompt }) => {
setCopied(false);
}, 3000);
}}>
{copied ? 'Copied' : 'Copy as Prompt'}
{copied ? 'Copied' : 'Copy prompt'}
</button>;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/trace-viewer/src/ui/errorsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
/>
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright-test/reporter-html.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)');
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright-test/ui-mode-trace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand Down

0 comments on commit ef33c83

Please sign in to comment.