This simple example provides one solution for a classic problem: automating Facebook login scenarios for iOS.
Facebook iOS SDK example application Scrumptious
is used for a demo.
When automation Facebook login scenarios application context is switched from native application to a browser. Unfortunately, Calabash does not have a control in that browser window.
When working with simulators, one solution is to handle Facebook login in a browser utilising Sikuli framework: http://www.sikulix.com/.
See screencast: http://screencast.com/t/BP9IHRjQ1f
Xcode 6.1.1
Calabash 0.11.4
run_loop 1.1.1.pre3
iPhone 6 8.1 simulator
SikuliX (Build 1.1.0 2014-12-18_01:01nightly)
- Install SikuliX
- Set SIKULIX_HOME
- Download Facebook SDK for iOS and follow setup instructions
- Run
bundle
- Create Sikuli Facebook login script. See example: https://github.com/JaniJegoroff/facebook-ios-sdk/tree/master/samples/Scrumptious/facebook-login.sikuli
- Modify Sikuli script path if needed. See https://github.com/JaniJegoroff/facebook-ios-sdk/blob/master/samples/Scrumptious/features/support/utils.rb#L2
- Build the project for iPhone 6 8.1 Simulator
- Run
cucumber