bin/calabash-android-helpers.rb in calabash-android-0.0.2 vs bin/calabash-android-helpers.rb in calabash-android-0.0.3
- old
+ new
@@ -7,23 +7,25 @@
puts "\n" + "-"*10 + title + "-"*10
block.call
puts "-"*10 + "-------" + "-"*10 + "\n"
end
-#TODO Jonas
def print_usage
puts <<EOF
Usage: calabash-android <command-name> [parameters]
<command-name> can be one of
help
prints more detailed help information.
gen
generate a features folder structure.
- setup
- setup your project for calabash
- submit [path] [secret] [opt_features path]?
- submits an apk and features folder to www.lesspainful.com
+ setup will ask you some questions about you application, development
+ environment and key store to user for signing.
+
+ build builds the test server that will be used when testing the app.
+ You need to run this command everytime you make changes to app.
+
+ run runs Cucumber in the current folder with the enviroment needed.
EOF
end
def print_help
file = File.join(File.dirname(__FILE__), '..', 'doc', 'calabash-android-help.txt')
@@ -64,8 +66,36 @@
puts "You can pull the status by using this command:"
puts "curl -F \"secret=#{secret}\" -F \"id=#{json_result['id']}\" https://www.lesspainful.com/cmd_status"
else
puts result
end
+end
+
+def run_build_if_test_server_does_not_exist
+ unless File.exists?(File.join(@support_dir, "Test.apk"))
+ puts "Could not find the test server"
+ puts "Should I run calabash-android build for you?"
+ puts "Please answer yes (y) or no (n)"
+ if ['yes', 'y'].include? STDIN.gets.chomp
+ calabash_build([])
+ else
+ puts "Please run: calabash-android build"
+ exit 1
+ end
+ end
+end
+
+def run_setup_if_settings_does_not_exist
+ unless File.exists?(".calabash_settings")
+ puts "Could not find .calabash_settings."
+ puts "Should I run calabash-android setup for you?"
+ puts "Please answer yes (y) or no (n)"
+ if ['yes', 'y'].include? STDIN.gets.chomp
+ calabash_setup
+ else
+ puts "Please run: calabash-android setup"
+ exit 1
+ end
+ end
end