简体   繁体   English

是否可以在测试应用程序之间共享Facebook Test用户?

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

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. 在本地开发和构建服务器(验收测试环境)上,我们的Web应用程序具有单独的URL,这意味着我们必须为本地和验收测试设置2个单独的测试应用程序。

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. 创建测试用户时,似乎只能在1个测试应用程序上将其创建为有效...,而我一直无法找到一种在测试应用程序之间共享测试用户的方法。 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? 是否希望听到有关如何轻松解决此问题的建议?

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 Afaik您只能为一个应用程序创建测试用户,但是您也可以使用Facebook文档中说明的API使用API​​创建用户: 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 直接链接到示例代码: https : //developers.facebook.com/docs/graph-api/reference/v2.2/app/accounts/test-users

创建一个测试用户,然后使用API​​将用户连接到第二个应用程序。

Simple example with curl (its not possible to do it from the Dashboard) 带有curl的简单示例( 无法从仪表板执行)

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"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM