Skip to content

BackstopJS 2.0 -- The rewrite!

Compare
Choose a tag to compare
@garris garris released this 11 Nov 21:09
· 1002 commits to master since this release

Massive performance gains and many new features. Many thanks to @JulienPradet, @onigoetz, @borys-rudenko, @Ksushik, @dmitriyilchgmailcom, @Primajin

Highlights

  • Completely removed gulp, rely only on fs to move files around
  • Added a modal to show the images in big, with a slider to compare images in place.
  • The report doesn't need a server to be seen
  • To see the report, the files are copied in the project (previously the images were copied into Backstop)
  • Backstop relies on process.cwd() to generate its path, not ./node_modules/backstopjs
  • Add a --filter option to filter scenarii by label in test and reference

    Variants

  • You can add "variants" to a scenario, they have the same options as a scenario, but are checked against the main scenario
  • no reference is created

    Browser reporting

  • Removed resemblejs, use images generated by the CLI reporter. (we have more than 500 tests, running them in the browser just breaks the browser)
  • Copy the reporter files to the project.
  • The reporter required to disable the CSP rules of our Jenkins server, not longer the case
  • Added a way to toggle the summary of scenarii
  • Added a modal on click on reference or test image with a comparison slider
  • Tweaked the styles a bit
    • Removed custom "circles" to show the number of passed and failed tests : replaced with Bootstrap's "label" because with more than 100 tests, the circle is broken
    • Made a more compact "Report" section : removed analysisTime and dimensionDifference (if isSameDimensions is true)
    • Changed the font stack (there was a typo)

      CLI Reporting

  • Reporting is always run in the CLI and results added to an object
  • You can easily add multiple new report types with this new object
  • junit report was moved to a separate code block to not clutter the main one

    Internal changes

  • paths are made from the current working directory, not backstopjs.
  • removed the need for an internal hash of the configuration.
  • the list of comparisons to create is stored in a special temp file.
  • commands no longer have a before and after this makes the code very complicated to understand and can be replaced by promises inside the main execute
  • removed "start" and "stop" commands as the server is not needed anymore.

    Bugfixes / Regressions

  • If the tests failed, the return code was still 0
  • You could not use a JavaScript configuration anymore
  • Errors in Promises were swallowed

    Code Style

  • Replaced jshint/jscs with eslint
  • Linted with "semistandard"

    Tests

  • Run tests on travis on more node versions (0.12, 4, 5, 6)