happo / happo-cypress

A Happo integration with Cypress.io
35 stars 4 forks source link

Inject classes from <html> element before screenshot #79

Closed trotzig closed 3 years ago

trotzig commented 3 years ago

I've seen classes on the html element affect styling a few times now, and I decided to do something about this. By grabbing the html classes at happoScreenshot time, and then injecting them at screenshot time, we can get better style matching with the "real" website.

An example of a style I'm testing this on is a website with a fonts-loaded class set. This class affects what fonts are shown in the UI.

trotzig commented 3 years ago

This isn't going to work, since scripts are ignored by default on the happo workers.