Skip to content

Commit 5245105

Browse files
committed
Disable WebGL-requiring tests in CI
1 parent 5fbd103 commit 5245105

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

β€Žtests/paint.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { test, expect } from '@playwright/test';
22

33
test('can set wallpaper tiled (and use pencil, fill, and magnifier tools)', async ({ page }) => {
4+
// TODO: make JS Paint work without WebGL, ideally (for tests and for users)
5+
// [JavaScript Warning: "Failed to create WebGL context: WebGL creation failed:
6+
// * WebglAllowWindowsNativeGl:false restricts context creation on this system. ()
7+
// * Exhausted GL driver options. (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)" {file: "http://localhost:1998/programs/jspaint/src/image-manipulation.js" line: 1407}]
8+
test.skip(!!process.env.CI, 'needs WebGL; could maybe run headed or enable software rendering somehow?');
9+
410
await page.goto('http://localhost:1998/');
511
await page.getByText('Paint').dblclick();
612
await page.getByText('Image', { exact: true }).click();

β€Žtests/screensavers.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ test('closes when pressing a key', async ({ page }) => {
3333
});
3434

3535
test('has an animated canvas', async ({ page }) => {
36+
// [JavaScript Warning: "Failed to create WebGL context: WebGL creation failed:
37+
// * WebglAllowWindowsNativeGl:false restricts context creation on this system. ()
38+
// * Exhausted GL driver options. (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)" {file: "https://cdnjs.cloudflare.com/ajax/libs/three.js/98/three.min.js" line: 178}]
39+
test.skip(!!process.env.CI, 'needs WebGL; could maybe run headed or enable software rendering somehow?');
40+
41+
// Not every frame may be different from the last (sometimes pipes are offscreen),
42+
// so just check that we get enough unique frames to know it's animating.
43+
// This assumes `toDataURL` is deterministic, otherwise it could pass with a static image.
44+
// I tested the test by disabling animation in the screensaver and it failed correctly.
3645
const canvas = page.frameLocator('iframe').locator('#canvas-webgl');
3746
await expect(canvas).toBeVisible();
3847
expect(await canvas.evaluate((canvas: HTMLCanvasElement) => {

0 commit comments

Comments
Β (0)