bug?
WebGL is disabled by default (in chromium and firefox browsers in testcafe docker)
WebGL is enabled by default or there is possibility to enable/disable it
Run following test with docker command:
docker run -v c:\MyPath\Tests:/tests -it testcafe/testcafe "chromium --no-sandbox" /tests/test1.ts -S -s /tests/screenshots
fixture(`Getting Started`)
.page(`https://browserleaks.com/webgl`);
test('My first test', async t => {
await t.takeScreenshot();
});
See created screenshot:

I tried real app with WebGL component (mapbox-gl) also and it fails with WebGL init js error.
As there is not chrome://settings etc. available within testcafe fixtures, there is no posibility to control webgl settings.
Thank you for any help.
After some experiments, there is no sw gl renderers in the docker image (osmesa or swiftshader).
WebGL works with osmesa installed!

Simple step to install osmesa in dockerfile:
RUN apk --no-cache add mesa-osmesa && \
ln -s /usr/lib/libOSMesa.so.8 /usr/lib/chromium/libosmesa.so
After that, following command run testcafe with WebGL support:
/opt/testcafe/docker/testcafe-docker.sh 'chromium --no-sandbox --use-gl=osmesa' /tests/test1.ts
Please add official support for sw renderers to docker image.
Thank you
Hi @sommcz! Thank you for your research! I've found a way to enable WebGL in Firefox. I'll update Dockerfile and dev build on Docker Hub.
I didn't test it, but it will be nice to add support for swiftshader too. So developers can choose which one to use.
Alpine package: https://pkgs.alpinelinux.org/contents?branch=edge&name=mesa-gles&arch=x86_64&repo=main
Library: /usr/lib/libGLESv2.so.2
Link path for Chromium: /usr/lib/chromium/swiftshader/libGLESv2.so
usage: --use-gl=swiftshader
I've also found that testcafe 'chrome --headless --use-gl=swiftshader' test.js works out of the box without any .so linking.
This issues seems to be fixed at least from the Testcafe Docker image 1.8.6 on. It worked out of the box for us after upgrading from 1.7.0. Important: I am talking about the Docker image, not just the Testcafe version.
@mhoennig Thank you for pointing this out.
Most helpful comment
Hi @sommcz! Thank you for your research! I've found a way to enable WebGL in Firefox. I'll update Dockerfile and
devbuild on Docker Hub.