mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: rename prompt button (#34851)
This commit is contained in:
parent
f5b8cca1eb
commit
1f1e2acf9b
@ -66,7 +66,7 @@ const PromptButton: React.FC<{
|
|||||||
setCopied(false);
|
setCopied(false);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}}>
|
}}>
|
||||||
{copied ? <span className='prompt-button-copied'>Copied <icons.copy/></span> : 'Fix with AI'}
|
{copied ? <span className='prompt-button-copied'>Copied <icons.copy/></span> : 'Copy as Prompt'}
|
||||||
</button>;
|
</button>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ const CopyPromptButton: React.FC<{
|
|||||||
return (
|
return (
|
||||||
<CopyToClipboardTextButton
|
<CopyToClipboardTextButton
|
||||||
value={prompt}
|
value={prompt}
|
||||||
description='Fix with AI'
|
description='Copy as Prompt'
|
||||||
copiedDescription={<>Copied <span className='codicon codicon-copy' style={{ marginLeft: '5px' }}/></>}
|
copiedDescription={<>Copied <span className='codicon codicon-copy' style={{ marginLeft: '5px' }}/></>}
|
||||||
style={{ width: '90px', justifyContent: 'center' }}
|
style={{ width: '90px', justifyContent: 'center' }}
|
||||||
/>
|
/>
|
||||||
|
@ -2802,7 +2802,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
|
|||||||
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
||||||
|
|
||||||
await page.getByRole('link', { name: 'sample' }).click();
|
await page.getByRole('link', { name: 'sample' }).click();
|
||||||
await page.getByRole('button', { name: 'Fix with AI' }).click();
|
await page.getByRole('button', { name: 'Copy as Prompt' }).click();
|
||||||
const prompt = await page.evaluate(() => navigator.clipboard.readText());
|
const prompt = await page.evaluate(() => navigator.clipboard.readText());
|
||||||
expect(prompt, 'first line').toContain(`My Playwright test failed, what's going wrong? I've included the error, a code diff and a snapshot of the page below.`);
|
expect(prompt, 'first line').toContain(`My Playwright test failed, what's going wrong? I've included the error, a code diff and a snapshot of the page below.`);
|
||||||
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
|
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
|
||||||
|
@ -514,7 +514,7 @@ test('should show copy prompt button in errors tab', async ({ runUITest }) => {
|
|||||||
|
|
||||||
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
||||||
await page.getByText('Errors', { exact: true }).click();
|
await page.getByText('Errors', { exact: true }).click();
|
||||||
await page.locator('.tab-errors').getByRole('button', { name: 'Fix with AI' }).click();
|
await page.locator('.tab-errors').getByRole('button', { name: 'Copy as Prompt' }).click();
|
||||||
const prompt = await page.evaluate(() => navigator.clipboard.readText());
|
const prompt = await page.evaluate(() => navigator.clipboard.readText());
|
||||||
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
|
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user