Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Chrome with user logged in. #106

Open
alucardu opened this issue Mar 2, 2018 · 2 comments
Open

Open Chrome with user logged in. #106

alucardu opened this issue Mar 2, 2018 · 2 comments

Comments

@alucardu
Copy link

alucardu commented Mar 2, 2018

Is it possible to open a Chrome browser with Chromy with a user logged in with his google account in the browser?

@dotneet
Copy link
Contributor

dotneet commented Mar 5, 2018

userDataDir option can be used to open a browser with specific browser profile.
https://github.com/OnetapInc/chromy#options

@alucardu
Copy link
Author

alucardu commented Mar 9, 2018

I'm having some difficulty implementing this in my application. I'm running BackstopJS for my test scenarios with Chrome is the engine so I can use Chromy.

BackstopJS has made userDataDir available in their configuration but this causes a bug when running multiple scenarios. So I would like to add the userDataDir value to each scenario separately.

I have this onBefore.js script that runs on each scenario:

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

  // IGNORE ANY CERT WARNINGS
  chromy.ignoreCertificateErrors();

  return chromy
    .wait(150)
      
};

Could you perhaps give an example on how to implement the userDataDir in this set up?

//update.

Never mind, seem like adding chromy.options.userDataDir = "C:/Users/Peter/AppData/Local/Google/Chrome/User Data/Default"; to the onBeforej.js script does the trick :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants