OnetapInc / chromy

Chromy is a library for operating headless chrome. 🍺🍺🍺
MIT License
605 stars 41 forks source link

userDataDir causes bug with multiple scenarios. #107

Open alucardu opened 6 years ago

alucardu commented 6 years ago

I use BackstopJS to run my test scenarios and use Chrome as the engine so I can use Chromy. When I run my BackstopJS reference with 3 scenarios I get 3 separate Chrome instances with the correct URL's and things work as intended.

If I add a userDataDir value to my onBefore.js script and run the same BackstopJS reference I get 1 Chrome instance with 3 tabs. But only the last tab will open the URL. The one Chrome instance does have my user profile, but I would expect 3 separate Chrome instances with my profile logged in.

module.exports = function (chromy, scenario, vp) {
  require('./loadCookies')(chromy, scenario);

  // IGNORE ANY CERT WARNINGS
  chromy.ignoreCertificateErrors();
  chromy.options.userDataDir = "C:/Users/Peter/AppData/Local/Google/Chrome/User Data/Default";

  return chromy
    .wait(150)      
};

This bug (if it's a bug) only happens when you have debugWindow enabled. Otherwise it works fine.