Closed Bug 1018307 Opened 10 years ago Closed 10 years ago

[QA] Set up a Facebook app to create fake users and run automation

Categories

(Firefox OS Graveyard :: Gaia::Contacts, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jlorenzo, Unassigned)

References

Details

I'm working on creating Facebook Test Accounts for the Mobile QA team. We need to have some tests account with at least 2000 friends. To do so, Facebook's GraphAPI allows us to create and manage test accounts linked to real Facebook account.

I managed to create one test account with 2k friends on a QA real FB account : https://intranet.mozilla.org/QA:B2G_Facebook_test_account. The main problem of this account is that it cannot connect to our Contact App (as it's a test account created for another app).

Long story short, I would like to have access to the real Facebook account which has created the Firefox OS app (app_id=395559767228801) to run these scripts : https://github.com/JohanLorenzo/facebook-test-accounts-manager
From kgrandon, in the confidential bug:
> I don't think this is confidential, can you open it up? 
> 
> I think the problem is that we do not have a dev account setup with
> facebook, we should add one. The app id mentioned in the description is our
> production one, so i would not recommend that for testing. We should create
> a new app id and use it for dev purposes I think.
Maybe we should create a new app. In that case, App number 874414049252748 can be used. This app is link to our first QA FB account (see https://intranet.mozilla.org/QA:B2G_Facebook_test_account). 

Nevertheless, when you create test accounts for your FB app, tests accounts cannot interfere with production data : https://developers.facebook.com/docs/apps/test-users . As a consequence, that may be a quick fix for QA without messing up production data.
What do you think?
Flags: needinfo?(francisco)
Hi Johan,

I think is better to have sepparate app for QA, even if FB has a api that allow testing, I prefer to perform those operations over an account QA own.

Does that works for you?
Flags: needinfo?(francisco)
We're able to change the AppID by rebuilding the app. I'll check if I can use the account I created this summer.
Flags: needinfo?(jlorenzo)
I'm changing the title of this bug as we don't want to use the real Facebook AppId.

I can change the AppId by modifying build/config/communications_services.json and rebuilding the app. I can't connect though, I get this error on a Facebook page: 

> Given URL is not allowed by the Application configuration. One or more of the given URLs
> is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the
> domain must be a subdomain of the App's domain name.

Jose, do you know who I can ask for to see the configuration of the production Facebook app?
Flags: needinfo?(jlorenzo) → needinfo?(jmcf)
Summary: [QA][Facebook] Get access to the Facebook account which has created the Contact App → [QA] Set up a Facebook app to create fake users and run automation
Blocks: 1086680
Hi Johan,

I've configured the app for you, but you are going to have problems with that appId as it is not whitelisted and cannot get access to the phones column in the user table. 

E/Communications( 3546): Content JS ERROR: Error, while retrieving friends (#602) phones is not a member of the user table. 
E/Communications( 3546):     at Importer.friendsReady (app://communications.gaiamobile.org/shared/js/contacts/import/importer_ui.js:578:0)
E/Communications( 3546):     at fb.utils.runQuery/xhr.onload/< (app://communications.gaiamobile.org/shared/js/contacts/import/facebook/fb_query.js:59:10)
Flags: needinfo?(jmcf)
The "Firefox OS - Test" app is now in review to be whitelisted. It can take up to 7 business days.
The Facebook app didn't pass the review. Now, user_friends allows you to retrieve the friends who also uses our app[1]. I asked for read_friendlists[2] but this right doesn't help us to get a user's friend. Hence, I don't see any right that might help us.

Jose, do you know which right are set on the real Facebook app?

[1] https://developers.facebook.com/docs/facebook-login/permissions#reference-user_friends
[2] https://developers.facebook.com/docs/facebook-login/permissions#reference-read_friendlists
Flags: needinfo?(jmcf)
The scope we ask for in the FB App is

"scope":
      ["friends_about_me", "friends_birthday", "friends_hometown",
       "friends_location", "friends_work_history", "read_stream"],
Flags: needinfo?(jmcf)
Okay, I see what's the issue. The production Facebook app we have uses Graph API v1.0. I created the test app after April 30th, 2014, so this app has access to Graph API v2.x (and can't switch back to v1.0). Hence, we can't get the same scope as the production.

More over, regarding this page and video[1], all Facebook apps will be automatically switched to Graph API v2.0 by April 30th, 2015. As a consequence, I don't think it's worth it to waste effort of setting up a Test Application while we haven't migrated to Graph API v2.0. Do you know when we will upgrade to v2.0, Jose?

[1] https://developers.facebook.com/docs/apps/changelog
Flags: needinfo?(jmcf)
We use FQL and not Graph API. FQL will be there for quite a long time so we have not decided yet to migrate to Graph v2.0. It is very low priority for us

thanks
Flags: needinfo?(jmcf)
As the "Firefox OS - Test" app (app_id=874414049252748) is too recent compared to the production one, Jose and Francisco came up with another solution: use the app that Telefónica uses for automation (app_id=323630664378726).

I created a new test user (name=Gaia UI Tests, email=gaia_dxnzuri_tests@tfbnw.net) with 5 friends, changed the AppID and logged in with it; it works like a charm.

Martijn, I guess we're ready to ask to change an the AppID for the engineering build.
Flags: needinfo?(martijn.martijn)
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #14)
> Martijn, I guess we're ready to ask to change an the AppID for the
> engineering build.

Thanks, I filed bug 1100342 for it.
Flags: needinfo?(martijn.martijn)
Hey Johan, I guess this bug can be closed?
Flags: needinfo?(jlorenzo)
Indeed, it can :)
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jlorenzo)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.