Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Calabash - Improve your app architecture -

04ab1563ccc36f66ebea3b2a0e3488b9?s=47 chiiia12
July 25, 2017

Introduction to Calabash - Improve your app architecture -

I talked about Calabash in English at 'Tokyo Android Meetup #11'.



July 25, 2017

More Decks by chiiia12

Other Decks in Technology


  1. Introduction to Calabash -improve your app architecture-

  2. Self-Intro •Chiaki Yokoo •at Recruit Technologies Co.,Ltd •Java(Android/Spring Boot)

  3. Today’s target •For beginners •People who don't write a test

    code. •People who don’t know how to improve architecture
  4. Agenda •About Calabash •How to write Calabash Code •In our

    case •Next step in the future
  5. About Calabash

  6. Calabash

  7. What about Calabash •Automated Testing Framework •Support Android and iOS

    •Support •can write like pure English called as Gherkin
  8. start Testing •You will modify two types of file. •.feature

    and step definitions file(ruby file)
  9. Feature : write test case •can write test case in

    feature file. Scenario: press add item button Given I see view text “hoge” When I press “add item” Then I see the text “next page” additem.feature
  10. Steps : detail of test case •can write gestures about

    steps of the test case. •can use regular expression Given(/^I enter the text freeword "([^"]*)"$/) do |free_word| step %{I enter text "#{free_word}" into field with id "text_free_word"} step %{I press the enter button} end
  11. predefinition steps Then /^I toggle checkbox number (\d+)$/ do |index|

    Given /^I set the date to "(\d\d-\d\d-\d\d\d\d)" on DatePicker with index "([^\"]*)"$/ do |date, index| Then /^I swipe right$/ FYI:https://github.com/calabash/calabash-android/blob/master/ruby-gem/ lib/calabash-android/canned_steps.md
  12. Customizing • don’t worry about no steps that you want

    • can customize by using adb shell and Ruby
  13. example for customizing •update app to newer version Given (/old

    version install $/) do |version| uninstall_apps install_app(ENV['TEST_APP_PATH']) apk_path = ENV['APP_PATH'] old_version_apk_path = apk_path.sub(/^(.*)-\d+\.\d+\.\d+- ([^\/]+\.apk)$/, '\1-'+version+'-\2') install_app(old_version_apk_path) end When (/version up$/) do update_app(ENV['APP_PATH']) end
  14. example for customizing •switch network to create no internet situation

    Given(/^switch network condition $/) do `adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings` `adb shell input keyevent 19 & adb shell input keyevent 19` `adb shell input keyevent 23` end
  15. In Our Case

  16. In our team case •Process in our team was Scrum.

    •Towards Automating acceptance testing in the future. •First step for Automation to introduce calabash
  17. The first step for calabash •There are some risks. •Risk

    of changing the specification •Cost of maintenance the test code •So firstly choose test case that does not change for automation
  18. Not Changing Testcase •Trasition between pages •Main scenario for app.

    ‣Applying job offer ‣Searching by their condition ‣Add some offer to favorite list
  19. Useful? Useless? Is it really useful…?

  20. Trigger •Trigger is advice by a learned man. •Useful for

    complex architecture •For our team that didn’t have any test but have complex architecture, it is the first step to improve inner structure.
  21. Why improving architecture •For the team that don’t have any

    unit test,Changing its structure is risk. •to change its structure ,it needs test. •Writing unit testing for bad architecture, most test code may be useless.
  22. Why improving architecture •If Test outside from code,it doesn’t depends

    on inner structure. Code Test Outside from code Unit Test App
  23. Ideal steps 1.Writing test code about main scenario from outside.

    2.Measure coverage and which part of code are assert by test. 3.Improving structure the place where has test code.
  24. Summary

  25. Summary •Introducing calabash •It may be question to be useful

    for product in term of quality assurance. •I found that it is one option how to improve architecture.
  26. Thank you for listening