testdroid-api-client 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/testdroid_api/client.rb +5 -0
- data/lib/testdroid_api/cloud_resource.rb +1 -1
- data/lib/testdroid_api/device_sessions.rb +0 -1
- data/lib/testdroid_api/runs.rb +3 -0
- data/sample/sample.rb +39 -0
- data/testdroid-api-client.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 032442944630e8efe8636bf520cddefeec30946a
|
4
|
+
data.tar.gz: 58fc17ad7d3c661a3e8d165e66aaff6cabe65906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f050beaeec123d9898b1ff5db6ab893947b385fbf4c537720c23b441c916ef9f35231a764f6ae3bc58b4e46e6ac1411a942ea579381a39e75fbb636e561740cf
|
7
|
+
data.tar.gz: afcd6cf4fb3dab79441fb536d2fd078f30cc1fd7f2d911243a9d14698a595c078648f0d08a19994fa9bd1c264c752a78a6795cffec7cc58961522f019a67c104
|
data/lib/testdroid_api/client.rb
CHANGED
data/lib/testdroid_api/runs.rb
CHANGED
data/sample/sample.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'testdroid-api-client'
|
2
|
+
|
3
|
+
client = TestdroidAPI::Client.new('admin@localhost', 'admin')
|
4
|
+
#to use private cloud specify cloud url as:
|
5
|
+
#client = TestdroidAPI::Client.new('my@host.com', 'hostpass', 'https://customer.testdroid.com/cloud')
|
6
|
+
#oauth
|
7
|
+
user = client.authorize
|
8
|
+
|
9
|
+
# Create Android project
|
10
|
+
android_project = user.projects.create({:params => {:name => "Android robotium", :type => "ANDROID"}})
|
11
|
+
|
12
|
+
# Create iOS project
|
13
|
+
ios_project = user.projects.create({:params => {:name => "iOS project", :type => "IOS"}})
|
14
|
+
|
15
|
+
#Android applicaiton
|
16
|
+
android_project.files.uploadApplication("BitbarSampleApp.apk")
|
17
|
+
|
18
|
+
#instrumentation package
|
19
|
+
android_project.files.uploadTest("BitbarSampleAppTests.apk")
|
20
|
+
|
21
|
+
|
22
|
+
#Set custom runner and set mode for instrumentaiton test
|
23
|
+
android_project.config.update({:params => {'instrumentationRunner' => 'com.testrunners.MyRunner', :mode=> 'FULL_RUN'}})
|
24
|
+
|
25
|
+
#get all the Android devices
|
26
|
+
android_devices = client.devices.list.select {|device| device.os_type.casecmp("ANDROID") == 0 }
|
27
|
+
|
28
|
+
#get IDs of the android devices
|
29
|
+
id_list = android_devices.collect{|device| device.id }
|
30
|
+
|
31
|
+
run_parameters = {:params => {:name => 'Test run 1', "usedDeviceIds[]" => id_list.join(',') }}
|
32
|
+
#Run project using the parameters
|
33
|
+
android_project.run(run_parameters)
|
34
|
+
|
35
|
+
#wait until the whole test run is completed
|
36
|
+
sleep 20 until android_project.runs.list.first.state == "FINISHED"
|
37
|
+
|
38
|
+
#download junit xml from the all device runs
|
39
|
+
android_project.runs.list.first.device_runs.list({:params => {:limit => 0}}).each { |device_run| device_run.download_junit("#{device_run.id}_junit.xml") }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testdroid-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sakari Rautiainen
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- pkg/testdroid-api-client-0.1.0.gem
|
178
178
|
- pkg/testdroid-api-client-0.1.1.gem
|
179
179
|
- pkg/testdroid-api-client-0.1.2.gem
|
180
|
+
- sample/sample.rb
|
180
181
|
- spec/client_spec.rb
|
181
182
|
- spec/device_groups_spec.rb
|
182
183
|
- spec/device_runs_spec.rb
|