问题
I am running automated tests (using Protractor and PhantomJS) on a Web UI tool that uses Google authentication (you have to log in with a Google account). I am running into issues because my CI server is located a few thousand miles away, and Google blocks those login attempts. Even after I confirm the device, Google will force two-factor auth on those attempts (even though I have two-factor turned off in that account). Which means every time I run an automated test I'm going to have to check my phone for messages and then figure out how to feed the verification code into my automated process!!!
So I'm looking for a way to pre-authorize or get an auth token from an auth API that I can use in my requests, instead of having to fight against the standard Google web auth flow. Is there a way?
来源:https://stackoverflow.com/questions/37956067/automating-ui-test-with-google-auth