From 39533d021ac8bf813d5aa2ee70a226ebc5aabed7 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 7 Aug 2024 14:59:39 +0200 Subject: [PATCH] add threejs demo --- examples/github-api/tests/canvas-demo.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/github-api/tests/canvas-demo.spec.ts b/examples/github-api/tests/canvas-demo.spec.ts index 36ec2f3be3..a9a98de7dc 100644 --- a/examples/github-api/tests/canvas-demo.spec.ts +++ b/examples/github-api/tests/canvas-demo.spec.ts @@ -55,4 +55,15 @@ test('Go JS', async ({ page }) => { y: 289 } }); +}); + +test('ThreeJS', async ({ page }) => { + await page.addInitScript(() => { + const original = window.HTMLCanvasElement.prototype.getContext; + window.HTMLCanvasElement.prototype.getContext = function(id, options) { return original.call(this, id, {...options, preserveDrawingBuffer: true }) } + }); + await page.goto('https://threejs.org/examples/webgl_animation_skinning_morph.html'); + await page.waitForTimeout(1000); + await page.getByLabel('Surprised').fill('1'); + await page.waitForTimeout(1000); }); \ No newline at end of file