eGo meetup - Сalabash in mobile automated testing

696 views

Published on

Published in: Technology, Economy & Finance
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
696
On SlideShare
0
From Embeds
0
Number of Embeds
114
Actions
Shares
0
Downloads
11
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

eGo meetup - Сalabash in mobile automated testing

  1. 1. eGo Creative Media Solutions
  2. 2. Acceptance testing
  3. 3. Behavior-driven development (BDD) BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high- automation, agile methodology
  4. 4. What is Calabash? Calabash provides a bridge that allows Cucumber tests to run and validate on iOS and Android
  5. 5. Calabash ● Cucumber - framework that performs tests ● Calabash – bridge to device ● Gherkin - syntax Cucumber + Calabash & Ruby + Gherkin
  6. 6. Calabash’s Client-Server Model Calabash has a Client-Server model in which the server portion is a lightweight web server that runs on the device and listens for a client to connect and initiate the tests. It then communicates via JSON over HTTP
  7. 7. Calabash in Android
  8. 8. Calabash in iOS
  9. 9. Calabash.app
  10. 10. Calabash-iOS setup calabash-ios setup calabash-ios gen
  11. 11. Calabash-iOS setup Drag calabash.framework from Finder into your project's Frameworks folder in Xcode. Make sure that a. Copy items into destination group's folder (if needed) is checked and b. only your "-cal " target is checked in Add to targets. You must also link you -cal target with CFNetwork.framework (unless your production target is already linking with CFNetwork). To do this click on your -cal target in XCode. Click on Build Phases, expand Link Binary with Libraries, click + to add CFNetwork.framework. o Click on your project and select your new "-cal" target. o Select "Build Settings". o Ensure that "All" and not "Basic" settings are selected in "build settings". o Find "Other Linker Flags" (you can type "other link" in the search field). o Ensure that "Other linker flags" contains: -force_load "$(SRCROOT)/calabash.framework/calabash" -lstdc++
  12. 12. Calabash-iOS setup
  13. 13. Calabash with Xamarin
  14. 14. Calabash iOS/Android gen
  15. 15. Config
  16. 16. cucumber.yml # config/cucumber.yml ##YAML Template android: PLATFORM=android -r features/support -r features/android/support -r features/android/helpers -r features/step_definitions -r features/android/pages ios: PLATFORM=ios SDK_VERSION=7.0 -r features/support -r features/ios/support -r features/ios/helpers -r features/step_definitions -r features/ios/pages iPhone: DEVICE=iphone iPad: DEVICE=ipad
  17. 17. Test anatomy
  18. 18. First feature example credit_card_validation.feature Feature: Credit card validation. Credit card numbers must be exactly 16 digits. Scenario: Credit card number is to short Given I use the native keyboard to enter "123456" into text field number 1 And I touch the "Validate" button Then I see the text "Credit card number is to short."
  19. 19. First feature execution Console Log $ cucumberFeature: Credit card validation. Credit card numbers must be exactly 16 digits. Sceanario: Credit Card is too short # features/credit_card_validation.feature:4 Given I use the native keyboard to enter "123456" into text field number 1 # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:140 And I touch the "Validate" button # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:31 Then I see the text "Credit card number is to short." # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:3731 scenario (1 passed)3 steps (3 passed)0m18.035s
  20. 20. Second feature Implementing the Second Scenario Scenario: Credit card number is to long Given I try to validate a credit card number that is 17 characters long Then I should see the error message "Credit card number is to long."
  21. 21. First rough going
  22. 22. Step definitions
  23. 23. Calabash Ruby API Calabash has a client-server architecture. The Calabash Ruby API is the client side which communicates over HTTP with the server that is embedded in your app via the Calabash component.
  24. 24. Calabash query
  25. 25. Uploading and Executing Tests in Test Cloud
  26. 26. Resources https://github.com/calabash/calabash-ios https://github.com/calabash/calabash-android http://docs.xamarin.com/guides/testcloud/calabash/ http://docs.xamarin.com/guides/testcloud/calabash/calabash-predefined-steps/ http://calaba.sh/ http://cukes.info/ https://github.com/xamarin/mobile-samples
  27. 27. Thank You 

×