This commit is contained in:
Simon Knott 2025-02-10 15:16:40 +01:00
parent 988b278c9e
commit 298f92ee7e
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -499,3 +499,22 @@ test('skipped steps should have an indicator', async ({ runUITest }) => {
await expect(skippedMarker).toBeVisible();
await expect(skippedMarker).toHaveAccessibleName('skipped');
});
test('should show copy prompt button in errors tab', async ({ runUITest }) => {
const { page } = await runUITest({
'a.spec.ts': `
import { test, expect } from '@playwright/test';
test('fails', async () => {
expect(1).toBe(2);
});
`,
});
await page.getByText('fails').dblclick();
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
await page.getByText('Errors', { exact: true }).click();
await page.locator('.tab-errors').getByRole('button', { name: 'Fix with AI' }).click();
const prompt = await page.evaluate(() => navigator.clipboard.readText());
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
});