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
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
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
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.