Unreliable font loading causes difference between test and reference
Author: giorgiosironiCreated Apr 8, 2024Updated Sep 16, 2025
We are experiencing intermittent test failures due to font not loading for some scenarios.
Using BackstopJS 6.2.2, running in Docker with:
"dockerCommandTemplate": "docker run --rm -i --user $(id -u):$(id -g) --network sciety-test_default --mount type=bind,source=\"{cwd}\",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}",Examples:
Researching previous issues lead us to code to wait for font loading:
https://github.com/garris/BackstopJS/issues/1298#issuecomment-936130845
https://github.com/garris/BackstopJS/issues/1303#issuecomment-828225823
but due to the age of these issues we don't know how to implement this in onReady with the Puppeteer API, can anyone advise?
Source: garris/BackstopJS