Is it possible to share Facebook Test users between test apps?

613 views Asked by At

We have seperate URLs for our webapp on local development and on build servers (acceptance test environment) This means that we have to setup 2 seperate Test Apps for Local and Acceptance Test.

When creating test users it seems they can only be created to be valid on only 1 test app... and I have not been able to find a way to share test users between test apps. Not being able to do this makes automated acceptanse testing a pain... as we have to have seperate testdata for Local testing and acceptance testing.

Would love to hear any suggestions on how to solve this easily?

3

There are 3 answers

4
WizKid On

Create a test user and then use the API to connect the user to the second app.

0
andyrandy On

Afaik you can only create test users for one App, but you can also create them with the API as it is explained in the Facebook docs: https://developers.facebook.com/docs/apps/test-users

Direct link to example code: https://developers.facebook.com/docs/graph-api/reference/v2.2/app/accounts/test-users

1
Jaime Agudo On

Simple example with curl (its not possible to do it from the Dashboard)

Copy

curl -i -X GET \
 "https://graph.facebook.com/v2.9/SOURCE_APP_ID/accounts/test-users?access_token=SOURCE_APP_ACCESS_TOKEN"

Paste

curl -i -X POST \
 -d "uid=TEST_USER_ID" \
 -d "owner_access_token=SOURCE_APP_ACCESS_TOKEN" \
 -d "access_token=TARGET_APP_ACCESS_TOKEN" \
 "https://graph.facebook.com/v2.9/TARGET_APP_ID/accounts/test-users"