Need to mock google OAuth2 service

2020-08-04 04:42发布

问题:

Need to virtualize google OAuth2 for testing a web app that uses OAuth for user sign in, Any ideas ?

Currently using Java/TestNG/Selenium, I tried with Hoverfly but I am still analyzing request/response pairs to figure out how to make simulation succeed.

(I have a web application under test (black box) where I need to automate tests of some activities made by a google-signed-in user, so first step is to login with google account, I currently do this with (selenium) actual google account but sometimes script gets blocked with google verification.)

This issue could have been solved long time ago simply if google adds [disable login challenges] option in account settings but I don't think they are doing that any time soon.

Update 2018-09-01

solved without mocking https://stackoverflow.com/a/52126066/1356559