Monday, September 2, 2013

Testing Facebook feature in iOS application. (Old)

Facebook plays an important role in any application or game. It is a medium where you can share about your application or share content of your application. As a tester we have to make sure Facebook feature is tested properly.

Work flow of Facebook in any application is as follows

1) iOS 5.1.1 and below

a) Facebook application not installed.
On tapping share button in application Facebook log in pop up has to be displayed if SDK has been integrated else it should take you to safari web browser. After entering the credentials Facebook would take you to Request for Permission page to ask you if it should allow to access the application. On tapping allow it should open up the share message window where you can share the content If you tap on don't allow it should cancel and take you back to application

Step 1 - Login window

Step 2 - Request Permission for Profile
Step 3 - Requests permission for sharing

3. You can choose with whom you want to share the content of application. Tap on Ok.

4. Share message window would appear. Tap on share and it would get shared in Facebook. 

b) Facebook application installed and not logged in.
On tapping share button in application it should take you to Facebook application. After entering the credentials it should display Request for Permission page to ask you if it should allow to access the application. On tapping allow it should open up the share message window where you can share the content If you tap on don't allow it should cancel and take you back to application

c) If user has logged in to Facebook application and user taps on share content in his application then it should redirect directly to Facebook application to request for permission without asking for login 

d) If user has already allowed sharing content to Facebook then it should take you to Facebook application and should immediately take you back to application to display share message window.

Step 1 : Redirects to Facebook application


Step 2: Permission Page

3.  Redirects to application to display share window. You can see in the screenshot below that eBay uses customized share message window which looks much better than the normal share window of Facebook. 

2) iOS 6.0 and above

a) Do not login to Facebook in settings.
On tapping share button in application it should display a native dialog box informing that you have not logged in to Facebook in settings.

b) Login to Facebook from settings
On tapping share button in application a system dialog box has to be displayed asking you if it can post to your friends on your behalf.
- On tapping OK button share message window would appear and on tapping share, post would get shared to your Facebook timeline.
- On tapping Don't allow device would display an alert which would indicate that in future if you want to share any content from this application You have to enable sharing in Facebook of settings

Step 1: Request for permission.


Step 2: Share window to share the content.


Tap on Dont allow


Useful test cases.

1) Revoke permission of the application through browser and share.
On sharing the content, error message has to be displayed and it should allow to re revoke the permission

- How to revoke permission
Facebook -> Apps -> App Center -> Your apps -> Tap on clear button (x) of the app you want to revoke permission

2) Change facebook password of the user who is already logged in setting
On sharing the content in iOS 6, an alert has to be displayed requesting to enter the password. Tapping on setting should take you to setting screen to enter the new password.

Tap on share - This would display alert displayed in screenshot


Tap on Settings and change password. Return back to application to share the content again.


3) Delete the Facebook account
Error message has to be displayed in message window of Facebook window in iOS 5.

4) Timeout
Sometimes due to slow network it would take lot of time to post the content. A timeout alert has to be displayed if the content doesn't get shared.

5) Disconnect network and then tap on share
No internet connection dialog has to be displayed.

6) In iOS 5.1.1 and below you would get an error in Facebook message window and you will not be able to share any content. This is because of
a) You have revoked the permission and your application is already running.
b) You are not given access to post in Sandbox environment
c) Developer account in which you have created is deleted

7) General
Always have a sign out button in application for iOS 5.1.1 At-least if your Facebook is not responding you can log-out and then try it again.