garris / BackstopJS

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

Profile option not working #414

Open attiks opened 7 years ago

attiks commented 7 years ago

I have a Firefox profile inside my project directory, which can be used using firefox -profile ffprofile but when I add into backstop.js it's not working

  "casperFlags": [
    "--profile ffprofile",
  ],
  "engine": "slimerjs",

Tried "-profile ffprofile" as well, if I execute casperjs manually it does work ./node_modules/.bin/casperjs --engine=slimerjs --profile ./ffprofile

garris commented 7 years ago

Hi @attiks, I I personally have not gotten this feature to work. What happens when you specify the full absolute path for ./ffprofile?

Enchiridion commented 7 years ago

I've gotten it to work (on Win10) by specifying the full absolute path. In fact this was the only way I could specify a profile, -P wouldn't work for me.

garris commented 7 years ago

Glad you were able to get it working -- thanks for following up!

In the past I have had a lot of trouble trying to get FF profiles to work -- if you get a minute -- I'd really like to know how you save your profiles.

Best, Garris

Enchiridion commented 7 years ago

Sure. These are the steps on Windows, but they should work for any OS, just the keyboard shortcut and paths are different.

Here's what I do. I press Win + R, then run firefox -P to bring up the Profile Manager. If it doesn't appear, make sure all instances of Firefox are closed first. Then I created a new profile (I named mine SlimerJS). Now in backstopjs I set my Firefox profile path:

'casperFlags' : [
  '-profile C:/Users/<username>/AppData/Roaming/Mozilla/Firefox/Profiles/<profile_folder_name>',
],

That's it.

I originally looked into this because slimerjs doesn't support the option --ignore-ssl-errors=true and I needed to test against sites with test certs. So to fix that, after creating the new profile, I opened Firefox to the sites I was having SSL issues with and created exceptions for the certs it didn't like on each site. If you need to do the same thing, make sure '--ignore-ssl-errors=true' is NOT present in the list of casperFlags, slimerjs will error out with an unknown arg message.

garris commented 7 years ago

Wow -- that's great -- quick question... is it -profile or --profile (Is one of those a typo?) Thanks!

Enchiridion commented 7 years ago

Just 1 dash, which is weird as almost all the other options requires 2 dashes.