Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Facebook test user email and password after create?

I am using Selenium to test a Facebook auth app. Currently I am using a script in the test suite to create Facebook test users by posting to the test user api found here: https://developers.facebook.com/docs/test_users/

https://graph.facebook.com/APP_ID/accounts/test-users?
installed=true
&name=FULL_NAME
&locale=en_US
&permissions=read_stream
&method=post
&access_token=APP_ACCESS_TOKEN

This gives me back a response of:

{ 
  "id": "1234...",  
  "access_token":"1234567..." , 
  "login_url":"https://www.facebook.com/platform/test_account..."
  "email": "[email protected]",
  "password": "1234..."
}

This gives me the username and password of the test. However If I want to reuse the user in a later test I don't know how to get this info. I might be over looking something. If I do a GET request to get a list of registered test users the response looks like this:

{
 "data" [
   { 
    "id": "1231....",  
    "access_token":"1223134..." , 
    "login_url":"https://www.facebook.com/platform/test_account.." 
   }
   { 
    "id": "1231....",  
    "access_token":"1223134..." , 
    "login_url":"https://www.facebook.com/platform/test_account.." 
   }
 ]
}

This response dosen't give me any emails/passwords which I'd need to login the test users in a full test. I'd rather not log them in by using the access_token and login_url because this isn't true to the Facebook auth flow on the site.

like image 657
kevzettler Avatar asked Mar 07 '13 21:03

kevzettler


1 Answers

See https://developers.facebook.com/docs/test_users/#changepw

Facebook does not store cleartext passwords and will only return the password on user creation per the documentation. You can change the user's password to anything at any time without knowing their password so you could set all your test users to have whatever password you want after creation and just rely on that when running your tests.

like image 180
Daniel Williams Avatar answered Nov 15 '22 04:11

Daniel Williams