Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google provide test users for integration testing

Test users are very good to do integration testing.

When I develop facebook oauth enabled stuff I can programmatically create test users and use them as real users of my application. They behave in the same way of real users, the only difference is that they are sandboxed.

Does Google offer something like that?

They are moving all their services to oauth2 and I'd like to write a full integration test with "real" users.

Currently I manually run my integration tests and authorize the application when requested, obviously this approach is not good for CI and truly automated test.

The only alternative that I see is to create a real account used only in tests and use its credentials interacting with something like selenium.

Other alternatives?

like image 233
Fabio Avatar asked Jul 15 '13 15:07

Fabio


1 Answers

You are correct Google don't offer a test user API in the same way that Facebook do. I think you have two options:

  1. Use "real" Google users as you stated. This can cause issues if Google blocks these accounts or adds extra checks to test if they are real users to not (Phone verification). They also do some A-B testing which can break your test scripts.

  2. Use a mock third party instead of the Google service. This will test your generic oauth integration code but obviously isn't as robust as testing against the real Google service. This method can be more stable as you control the mock service.

like image 71
Mark Butler Avatar answered Oct 20 '22 21:10

Mark Butler