Testing your app
Alexander Sergeevwrote this on Мар 18, 2015
What if you want to test registration with your site via Facebook, but all your Facebook accounts are already registered with your site and you can´t untie them? Registering again and again on Facebook is a long and dreary process, which is where Facebook’s tool for testing apps and websites integrated with Facebook can help you.
With this tool, you can create a test Facebook user. You can create the following test users:
- installed — If you already know that registration via Facebook is working correctly, but you want to test some functionality within the site, you can use this option, which skips the Facebook registration process on your site.
- false — If you do need to check the registration process, you should set up a False test user, through which you can go through the process of registering with your site via Facebook.
How to set up a test user:
- Type in a user name.
- Type in a location, and language (the default language is set to en_US).
- Check the permissions — if the app is working correctly, then you should see a list of permissions that your app needs to receive from each user.
Next you need to call up the Graph API function:
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
and in response you will get a set of parameters:
- id — the ID of the new test user.
- an access_token which you can use to call up the API functions on behalf of the test user.
- login_url — using this URL you can automatically log in to Facebook. The URL expires within an hour of registration, or immediately after the first login.
- e-mail — an e-mail for manual login to Facebook.
- password — a password for manual login to Facebook.
You can create a user yourself using the Graph API Explorer tool.
You can find more information on test users via the following link.