garris / garris/BackstopJS

Unreliable font loading causes difference between test and reference

Open
#1,564 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/garris/BackstopJS/assets/160299/a1cc1aa8-c50f-4f25-890e-c22a1fb54edb)
![backstop_default_Sciety_feed_0_main_2_desktop_2](https://github.com/garris/BackstopJS/assets/160299/b7f14429-62ed-43d3-9b4b-5debca79740b)
![backstop_default_Sciety_feed_0_main_2_desktop](https://github.com/garris/BackstopJS/assets/160299/f506d884-48a6-4280-afc6-496ed7ee4383)

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?

Contributor guide

Open the contributing guide

Research direction

Start with the reported Docker command and the onReady entry point, then review how the Puppeteer API is used when a scenario becomes ready. Reproduce the intermittent font-loading failure and verify that repeated visual captures wait for fonts consistently before comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.