garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.7k stars 604 forks source link

SlimerJs incompatible with Webpack as devDependency #369

Open amigolargo opened 7 years ago

amigolargo commented 7 years ago

With the engine set to slimerjs in the standard backstop.json (from genConfig), and the following dependencies in package.json,

"optionalDependencies": {
    "backstopjs": "^2.3.5",
    "slimerjs": "^0.10.2"
  },
  "devDependencies": {
    "webpack": "^1.14.0"
  }

running npm run reference from within the node_modules folder does not produce any output images.

Terminal output is

CasperJS:  CREATING NEW REFERENCE FILES
CasperJS:  onBefore.js has run for phone.
CasperJS:  onBefore.js has run for tablet_v.
CasperJS:  onBefore.js has run for tablet_h.
CasperJS:  onReady.js has run for:  phone
CasperJS:
CasperJS:  onReady.js has run for:  tablet_v
CasperJS:  onReady.js has run for:  tablet_h
CasperJS:  Comparison config file updated.

And with debugging switched on

Testing script failed with code: 1

An unexpected error occured. You may want to try setting the debug option to `true` in your config file.
COMMAND | Command `reference` ended with an error
COMMAND | Error: An unexpected error occured. You may want to try setting the debug option to `true` in your config file.`

Removing Webpack from the dependencies in this minimal test scenario, or switching the engine to PhantomJs will give me screengrabs again, but these are requirements for the project in which I am installing Backstop.

Any suggestions as to how I can debug further? Thanks!

garris commented 7 years ago

I believe you need a global install of slimerjs.

amigolargo commented 7 years ago

Hey @garris, thanks for your reply. I'm trying to avoid a global install of SlimerJs in order to keep all dependencies localised for CI integration, is this likely to be possible?

garris commented 7 years ago

Yup, totally understand. I'm pretty sure it's possible, you'd probably need to do a little research on how to specify the path of the slimer executable. Try looking at slimerjs documentation-- you may be able to specify it using the casperFlags property in BackstopJS.

amigolargo commented 7 years ago

Awesome, thanks. Will investigate & post back