This commit is contained in:
Simon Knott 2024-10-22 12:53:56 +02:00
parent 4560b96067
commit edc052b863
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 2 additions and 2 deletions

View file

@ -439,7 +439,7 @@ function snapshotScript(...targetIds: (string | undefined)[]) {
} }
if (isTopFrame) { if (!isTopFrame) {
for (const canvas of canvasElements) { for (const canvas of canvasElements) {
const context = canvas.getContext('2d')!; const context = canvas.getContext('2d')!;
drawCheckerboard(context, canvas); drawCheckerboard(context, canvas);

View file

@ -1461,7 +1461,7 @@ test('canvas clipping in iframe', async ({ runAndTrace, page, server }) => {
await rafraf(page, 5); await rafraf(page, 5);
}); });
const snapshot = await traceViewer.snapshotFrame('page.waitForTimeout'); const snapshot = await traceViewer.snapshotFrame('page.evaluate');
const canvas = snapshot.locator('iframe').contentFrame().locator('canvas'); const canvas = snapshot.locator('iframe').contentFrame().locator('canvas');
await expect(canvas).toHaveAttribute('title', `Playwright displays canvas contents on a best-effort basis. It doesn't support canvas elements inside an iframe yet. If this impacts your workflow, please open an issue so we can prioritize.`); await expect(canvas).toHaveAttribute('title', `Playwright displays canvas contents on a best-effort basis. It doesn't support canvas elements inside an iframe yet. If this impacts your workflow, please open an issue so we can prioritize.`);
}); });