chore: rename to copy prompt (#35057)

This commit is contained in:
Pavel Feldman 2025-03-05 13:07:52 -08:00 committed by GitHub
parent 43a09e827a
commit 1423d0f8a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -58,7 +58,7 @@ const PromptButton: React.FC<{ prompt: string }> = ({ prompt }) => {
setCopied(false);
}, 3000);
}}>
{copied ? 'Copied' : 'Copy as Prompt'}
{copied ? 'Copied' : 'Copy prompt'}
</button>;
};

View File

@ -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' }}
/>

View File

@ -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)');

View File

@ -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(`