Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade backstopjs to 5.3.2 #68

Merged
merged 2 commits into from
Jun 18, 2021
Merged

Upgrade backstopjs to 5.3.2 #68

merged 2 commits into from
Jun 18, 2021

Conversation

alex9smith
Copy link
Contributor

@alex9smith alex9smith commented Jun 18, 2021

On backstopjs 5.1 and above we were seeing test failures with very minor rendering differences to the reference images, and also fonts not always loading.

We are not the only people seeing these problems - see [1] and [2]. In those issues, the author of backstopjs suggests that this is actually an issue with puppeteer, and another user suggests adding these lines to onReady.js to force the engine to wait for the fonts to load and ensure the window is always in the same place before taking a screenshot.

This should fix the issues we've been having. I've tested it locally against my local version of the DMp and have been unable to see the same problems over several runs. I've also tried running the tests locally against preview which also seemed fine. The real test, however, will be on Jenkins as that runs backstopjs in the Docker container which will run puppeteer slightly differently to on my laptop.

On backstopjs 5.1 and above we were seeing test failures with very
minor rendering differences to the reference images, and also fonts
not always loading.

We are not the only people seeing these problems - see [[1]] and [[2]].
In those issues, the author of backstopjs suggests that this is
actually an issue with puppeteer, and another user suggests adding
these lines to `onReady.js` to force the engine to wait for the fonts
to load and ensure the window is always in the same place before taking
 a screenshot.

[1]:garris/BackstopJS#1303
[2]:garris/BackstopJS#1318
@alex9smith alex9smith marked this pull request as ready for review June 18, 2021 07:47
Copy link
Contributor

@bjgill bjgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find. Let's try it and see what happens.

@alex9smith alex9smith merged commit 893f2c2 into master Jun 18, 2021
@alex9smith alex9smith deleted the as-backstop branch June 18, 2021 09:16
alex9smith pushed a commit that referenced this pull request Jun 21, 2021
On backstopjs 5.1 and above we were seeing test failures with very
minor rendering differences to the reference images, and also fonts
not always loading.

We are not the only people seeing these problems - see [[1]] and [[2]].
In those issues, the author of backstopjs suggests that this is
actually an issue with puppeteer, and another user suggests adding
these lines to `onReady.js` to force the engine to wait for the fonts
to load and ensure the window is always in the same place before taking
 a screenshot.

We already merged this in #68, however reverted it in #69 because we
thought it hadn't fixed the problems.

Some more research showed that the CSS problems with text overflow on
mobile are actually a separate bug with the GOV.UK Design System[[3]].

Therefore we can merge this again and it'll hopefully fix the problems
we can address and allow us to stay up to date with backstop.

[1]:garris/BackstopJS#1303
[2]:garris/BackstopJS#1318
[3]:alphagov/govuk-frontend#2233
alex9smith pushed a commit that referenced this pull request Jun 21, 2021
On backstopjs 5.1 and above we were seeing test failures with very
minor rendering differences to the reference images, and also fonts
not always loading.

We are not the only people seeing these problems - see [1] and [2].
In those issues, the author of backstopjs suggests that this is
actually an issue with puppeteer, and another user suggests adding
these lines to onReady.js to force the engine to wait for the fonts
to load and ensure the window is always in the same place before
taking a screenshot.

We already merged this in #68, however reverted it in #69 because we
thought it hadn't fixed the problems.

Some more research showed that the CSS problems with text overflow
on mobile are actually a separate bug with the GOV.UK Design System[3].

Therefore we can merge this again and it'll hopefully fix the problems
we can address and allow us to stay up to date with backstop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants