bin/calabash-android-helpers.rb in calabash-android-0.0.13 vs bin/calabash-android-helpers.rb in calabash-android-0.0.14
- old
+ new
@@ -25,12 +25,13 @@
build
builds the test server that will be used when testing the app.
You need to run this command every time you make changes to the app.
run
runs Cucumber in the current folder with the enviroment needed.
+ submit
+ submits an apk along with your features to www.lesspainful.com
-
<options> can be
-v, --verbose
Turns on verbose logging
EOF
end
@@ -44,41 +45,9 @@
def is_json?(str)
str[0..0] == '{'
end
-
-def calabash_submit(args)
- if args.size < 2
- msg("Error") do
- puts "You must supply at path to apk and secret."
- end
- exit 1
- end
-
- apk_file = ARGV[0]
- puts "No such file '#{apk_file}'" unless File.exist?(apk_file)
- secret = ARGV[1]
-
- archive_path = "#{Tempfile.new("archive").path}.zip"
- puts "Creating zip file"
- system("zip -r -o #{archive_path} features && zip -j #{archive_path} bin/Test.apk")
-
- puts "Uploading apk and features to www.lesspainful.com"
- result = `curl -F "secret=#{secret}" -F "app=@#{apk_file}" -F "env=@#{archive_path}" https://www.lesspainful.com/cmd_upload`
-
- if is_json? result
- json_result = JSON.parse(result)
- puts "Test status is '#{json_result['status']}"
- puts "Test id is '#{json_result['id']}"
- puts "You can see the test result here: #{json_result['url']}"
- 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?"