#1564·BackstopJS

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: failed_diff_backstop_default_Sciety_feed_0_main_2_desktop backstop_default_Sciety_feed_0_main_2_desktop_2 backstop_default_Sciety_feed_0_main_2_desktop

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?