Search code examples
unit-testingopenidgoogle-openid

How to unit test my Google OpenID consumer app?


My web app is a Google OpenID consumer (with Attribute Exchange and OAuth Extension) and I need to write some unit test for it [edit: to test the unit that is responsible to interact with google].

The problem is that default OpenID login procedure needs user interaction (entering user/pass) which is not possible in unit test.

Do you have any idea how can I solve this problem and unit test my OpenID consumer app?

(I prefer not to run my own OpenID provider.)


Solution

  • You need to use a remote controlled browser for this. Selenium was made for this use case.

    (indeed they are called functional tests then).

    Search on Google for the best way to integrate selenium tests into your web framework.