Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Conversation

cmcculloh-kr
Copy link

fixes #1986

The regression tests require an express server to be spun up and render handlebars templates on the server side so that what is served to the page is static HTML. This is because Fuel UX is declarative and some components either initialize on page load or on user interaction (eg. checkbox). In order to accomplish this, the component has to be rendered and ready on pageload when Fuel UX scrapes the page looking for components to initialize.

The Fuel UX Handlebars templates are used to accomplish this.

The test/regression folder should have a separate file for each Fuel UX asset.

The regression tests will look at either the local dev code (from js/* or dist/css/fuelux.css) or will look at the reference code in reference/dist/. Ideally the reference code will match the last prod release. Upon Fuel UX release the code from /dist/ is copied into /reference/dist/. We use the dist version of CSS so that we don't have to deal with LESS crap in the browser.

If a change intends to modify the look of an asset, those changes should be manually copied into the reference directory. The reason this was done was that otherwise we would have to "ignore" failing tests when you made a change that modified the look and feel. Now since you will be manually copying the changes into the reference folder, you are intentionally changing the output of reference and when you run the tests they will merely be making sure they match. Further changes tested against this new output will make sure that the change did not revert.

@interactivellama
Copy link
Contributor

In Jest snapshot testing which is kind of similar, but strings of DOM or HTML, there's an overwrite command jest snapshot -- -u or something like that that basically says, all this stuff is correct--I'm 100% sure--please overwrite all the references. Then git only notices the ones that change and we version that.

Is there something like that that can be done?

@cmcculloh-kr
Copy link
Author

done.

@cmcculloh-kr
Copy link
Author

Of course it doesn't work on Travis 😐

@cmcculloh-kr cmcculloh-kr added this to the 3.16.1 milestone Jun 9, 2017
@cmcculloh-kr cmcculloh-kr added this to the 3.16.1 milestone Jun 9, 2017
Copy link
Contributor

@futuremint futuremint left a comment

Choose a reason for hiding this comment

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

Looks like the regression test fails on Travis because it is .0005% different.

  1. can that error threshold be tuned somewhere? If so what is a reasonable amount of "noise" to use?
  2. is there a way to access those diff images for errored checks? I cannot reproduce this locally therefore without access to the diff that was generated on Travis troubleshooting errored regression checks will be nigh impossible.

@futuremint
Copy link
Contributor

Looks like niffy hardcodes the filepath to /tmp/niffy/: https://github.com/segmentio/niffy/blob/master/index.js#L186

Christopher McCulloh added 3 commits June 13, 2017 11:13
…fuel-ux-tests-should-include-visual-regression-testing
…-testing' of github.com:cormacmccarthy/fuelux into GH1986---fuel-ux-tests-should-include-visual-regression-testing
Copy link
Contributor

@futuremint futuremint left a comment

Choose a reason for hiding this comment

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

Once we raise the threshold up from 0% enough for it to stop failing on TravisCI I think this is good to go!


If a change intends to change the look of an asset, you will need:

1. Make a build (`npm build`)
Copy link
Contributor

Choose a reason for hiding this comment

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

npm run build

@cmcculloh-kr
Copy link
Author

Done! All ready for you again @futuremint

@futuremint futuremint merged commit ea09f1a into ExactTarget:master Jun 14, 2017
@cmcculloh-kr cmcculloh-kr deleted the GH1986---fuel-ux-tests-should-include-visual-regression-testing branch June 16, 2017 18:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fuel UX Tests should include visual regression testing
3 participants