testdroid-api-client 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +48 -9
- data/README.md +24 -5
- data/lib/testdroid-api-client.rb +1 -0
- data/lib/testdroid_api/config.rb +7 -0
- data/lib/testdroid_api/projects.rb +2 -2
- data/spec/fixtures/cassettes/pc_get_current.json +1 -0
- data/spec/fixtures/cassettes/pc_oauth2_auth_config.json +1 -0
- data/spec/fixtures/cassettes/pc_set_current_config.json +1 -0
- data/spec/fixtures/cassettes/pc_validate_config.json +1 -0
- data/spec/project_config_spec.rb +36 -0
- data/spec/spec_helper.rb +2 -2
- data/testdroid-api-client.gemspec +2 -2
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f83eb091cc4e654dc3fea2624367f7b0ed7b7d1
|
4
|
+
data.tar.gz: 9b86550f09fc612e1cd13ddf4afcce83a439d667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 713492843fc48e35ccd0147b2ee59dac1da42b0db1e49816902905ae32dcd85e1f1f7d0bc6bafe0505398e6c497f33012abfd4e0388c097ada8f139a3b34d72d
|
7
|
+
data.tar.gz: da09bd8fb287ef7d25202f6c5bd8b4b7b8d3d91d22b5b4b2100ce09db00b37f817610245d34486cf5701e4945da70dfc96bc468bbd35d3e5deb67ea55f53411b
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,62 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
testdroid-api-client (0.2.0)
|
5
|
+
faraday (~> 0.8.8, >= 0.8.8)
|
6
|
+
oauth2 (~> 0.9)
|
7
|
+
|
1
8
|
GEM
|
2
9
|
remote: https://rubygems.org/
|
3
10
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
11
|
+
addressable (2.3.6)
|
12
|
+
bump (0.5.1)
|
13
|
+
crack (0.4.2)
|
14
|
+
safe_yaml (~> 1.0.0)
|
15
|
+
diff-lcs (1.2.5)
|
16
|
+
faraday (0.8.9)
|
17
|
+
multipart-post (~> 1.2.0)
|
18
|
+
jwt (1.2.0)
|
19
|
+
multi_json (1.10.1)
|
9
20
|
multi_xml (0.5.5)
|
10
|
-
multipart-post (2.0
|
11
|
-
oauth2 (0.9.
|
21
|
+
multipart-post (1.2.0)
|
22
|
+
oauth2 (0.9.4)
|
12
23
|
faraday (>= 0.8, < 0.10)
|
13
|
-
jwt (~>
|
24
|
+
jwt (~> 1.0)
|
14
25
|
multi_json (~> 1.3)
|
15
26
|
multi_xml (~> 0.5)
|
16
27
|
rack (~> 1.2)
|
17
28
|
rack (1.5.2)
|
29
|
+
rake (10.4.0)
|
30
|
+
rspec (3.1.0)
|
31
|
+
rspec-core (~> 3.1.0)
|
32
|
+
rspec-expectations (~> 3.1.0)
|
33
|
+
rspec-mocks (~> 3.1.0)
|
34
|
+
rspec-collection_matchers (1.1.2)
|
35
|
+
rspec-expectations (>= 2.99.0.beta1)
|
36
|
+
rspec-core (3.1.7)
|
37
|
+
rspec-support (~> 3.1.0)
|
38
|
+
rspec-expectations (3.1.2)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.1.0)
|
41
|
+
rspec-mocks (3.1.3)
|
42
|
+
rspec-support (~> 3.1.0)
|
43
|
+
rspec-support (3.1.2)
|
44
|
+
safe_yaml (1.0.4)
|
45
|
+
vcr (2.9.3)
|
46
|
+
webmock (1.20.4)
|
47
|
+
addressable (>= 2.3.6)
|
48
|
+
crack (>= 0.3.2)
|
49
|
+
yard (0.8.7.6)
|
18
50
|
|
19
51
|
PLATFORMS
|
20
52
|
ruby
|
21
53
|
|
22
54
|
DEPENDENCIES
|
23
|
-
|
55
|
+
bump (~> 0.5)
|
56
|
+
rake
|
57
|
+
rspec
|
58
|
+
rspec-collection_matchers
|
59
|
+
testdroid-api-client!
|
60
|
+
vcr (~> 2.9)
|
61
|
+
webmock (~> 1.9)
|
62
|
+
yard (~> 0.8)
|
data/README.md
CHANGED
@@ -31,6 +31,12 @@ project123 = @user.projects.get(project_id)
|
|
31
31
|
p "Project name #{project123.name}"
|
32
32
|
```
|
33
33
|
|
34
|
+
## Get project by name
|
35
|
+
```ruby
|
36
|
+
android_project = @user.projects.list.detect {|project| project.name.casecmp("Android Project") == 0 }
|
37
|
+
```
|
38
|
+
|
39
|
+
|
34
40
|
## Start project
|
35
41
|
```ruby
|
36
42
|
test_run = project123.run
|
@@ -58,17 +64,30 @@ os_v2_1 = client.label_groups.get(lg_android_versions.id).labels.list.detect {|
|
|
58
64
|
#get spefici device from devices list
|
59
65
|
lenovo_a820 = devices.list.detect {|d| d.display_name == "Lenovo A820"}
|
60
66
|
|
61
|
-
|
62
67
|
```
|
68
|
+
|
69
|
+
|
63
70
|
Device Sessions
|
64
71
|
----
|
65
|
-
```
|
66
|
-
|
67
|
-
device_session = user.device_sessions.create({:params => {'deviceModelId' => '1'}})
|
72
|
+
```ruby
|
73
|
+
#create a new device session:
|
74
|
+
device_session = @user.device_sessions.create({:params => {'deviceModelId' => '1'}})
|
68
75
|
|
69
|
-
|
76
|
+
#release device session:
|
70
77
|
device_session.release()
|
71
78
|
|
72
79
|
```
|
73
80
|
|
81
|
+
|
82
|
+
Project configuration
|
83
|
+
----
|
84
|
+
```ruby
|
85
|
+
#get project and update project configuration
|
86
|
+
android_project = @user.projects.list.detect {|project| project.name.casecmp("Android Project") == 0 }
|
87
|
+
android_project.config.update({:params => {'instrumentationRunner' => 'abc'}})
|
88
|
+
#See full list of params: http://docs.testdroid.com/_pages/client.html#update-project-config
|
89
|
+
|
90
|
+
```
|
91
|
+
|
92
|
+
|
74
93
|
See https://cloud.testdroid.com/swagger/index.html for more details about API V2
|
data/lib/testdroid-api-client.rb
CHANGED
@@ -8,8 +8,8 @@ module TestdroidAPI
|
|
8
8
|
def initialize(uri, client, params= {})
|
9
9
|
super uri, client,"project", params
|
10
10
|
@uri, @client = uri, client
|
11
|
-
sub_items :runs, :files
|
12
|
-
end
|
11
|
+
sub_items :runs, :files, :config
|
12
|
+
end
|
13
13
|
#Start a new test run
|
14
14
|
#run_parameters - example {:params => {'name' => 'test'}}
|
15
15
|
def run(run_parameters={:params => {}})
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"http://localhost:9080/testdroid-cloud/api/v2/users/100030/projects","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJkYXRhIjpbeyJpZCI6MTAwMDkwLCJhcmNoaXZpbmdJdGVtQ291bnQiOm51\nbGwsImFyY2hpdmluZ1N0cmF0ZWd5IjoiTkVWRVIiLCJjb21tb24iOmZhbHNl\nLCJkZXNjcmlwdGlvbiI6IiIsIm5hbWUiOiJQcm9qZWN0IDEiLCJzaGFyZWRC\neUVtYWlsIjpudWxsLCJzaGFyZWRCeUlkIjpudWxsLCJ0eXBlIjoiQU5EUk9J\nRCIsImNyZWF0ZVRpbWUiOjE0MTMwNTI3ODQwMDAsImFyY2hpdmluZ1N0cmF0\nZWd5RGlzcGxheVZhbHVlIjoibmV2ZXIifSx7ImlkIjoxMDAyNDAsImFyY2hp\ndmluZ0l0ZW1Db3VudCI6bnVsbCwiYXJjaGl2aW5nU3RyYXRlZ3kiOiJORVZF\nUiIsImNvbW1vbiI6ZmFsc2UsImRlc2NyaXB0aW9uIjoiIiwibmFtZSI6IlBy\nb2plY3QgMiIsInNoYXJlZEJ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N0cmF0ZWd5RGlzcGxheVZhbHVlIjoibmV2\nZXIifSx7ImlkIjoxMDA3NTAsImFyY2hpdmluZ0l0ZW1Db3VudCI6bnVsbCwi\nYXJjaGl2aW5nU3RyYXRlZ3kiOiJORVZFUiIsImNvbW1vbiI6ZmFsc2UsImRl\nc2NyaXB0aW9uIjoiIiwibmFtZSI6IkFuZHJvaWQgUHJvamVjdCIsInNoYXJl\nZEJ5RW1haWwiOm51bGwsInNoYXJlZEJ5SWQiOm51bGwsInR5cGUiOiJBTkRS\nT0lEIiwiY3JlYXRlVGltZSI6MTQxOTAyOTkwNjAwMCwiYXJjaGl2aW5nU3Ry\nYXRlZ3lEaXNwbGF5VmFsdWUiOiJuZXZlciJ9XSwibGltaXQiOjIwLCJuZXh0\nIjpudWxsLCJvZmZzZXQiOjAsInByZXZpb3VzIjpudWxsLCJzZWFyY2giOiIi\nLCJzb3J0IjoiIiwidG90YWwiOjksImVtcHR5IjpmYWxzZX0=\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"}],"recorded_with":"VCR 2.9.3"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"post","uri":"http://localhost:9080/testdroid-cloud/oauth/token","body":{"encoding":"UTF-8","base64_string":"Z3JhbnRfdHlwZT1wYXNzd29yZCZ1c2VybmFtZT1hZG1pbiU0MGxvY2FsaG9z\ndCZwYXNzd29yZD1hZG1pbiZjbGllbnRfaWQ9dGVzdGRyb2lkLWNsb3VkLWFw\naSZjbGllbnRfc2VjcmV0\n"},"headers":{"User-Agent":["Faraday v0.8.9"],"Content-Type":["application/x-www-form-urlencoded"],"Accept":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"cache-control":["no-store"],"pragma":["no-cache"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJhY2Nlc3NfdG9rZW4iOiJjMjE0OWFhZi1iNzQ4LTQ2NjQtYTI1Mi0zNzFh\nZDdkOWQ0ODciLCJ0b2tlbl90eXBlIjoiYmVhcmVyIiwicmVmcmVzaF90b2tl\nbiI6ImU2N2M0NjY2LWJkMDYtNGJmMC04YTdlLTQ5OTE3NjAxNzJhYSIsImV4\ncGlyZXNfaW4iOjEwNjgsInNjb3BlIjoicmVhZCB3cml0ZSJ9\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"},{"request":{"method":"get","uri":"http://localhost:9080/testdroid-cloud/api/v2/me","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJpZCI6MTAwMDMwLCJhZGRyZXNzIjpudWxsLCJjaXR5IjpudWxsLCJjb2Rl\nIjpudWxsLCJjb3VudHJ5IjpudWxsLCJlbWFpbCI6ImFkbWluQGxvY2FsaG9z\ndCIsImVuYWJsZWQiOnRydWUsIm5hbWUiOiJBZG1pbiIsIm9yZ2FuaXphdGlv\nbiI6bnVsbCwicGhvbmUiOm51bGwsInJvbGVzIjpbeyJpZCI6MSwiZXhwaXJl\nVGltZSI6bnVsbCwibmFtZSI6IklPUyIsInVzZUxpbWl0IjpudWxsLCJsaW1p\ndFVzZWQiOmZhbHNlLCJsaW1pdGVkIjpmYWxzZX0seyJpZCI6MiwiZXhwaXJl\nVGltZSI6bnVsbCwibmFtZSI6IkFETUlOIiwidXNlTGltaXQiOm51bGwsImxp\nbWl0VXNlZCI6ZmFsc2UsImxpbWl0ZWQiOmZhbHNlfSx7ImlkIjozLCJleHBp\ncmVUaW1lIjpudWxs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wsIm5hbWUiOiJQQUlEX1JVTiIsInVzZUxp\nbWl0IjpudWxsLCJsaW1pdFVzZWQiOmZhbHNlLCJsaW1pdGVkIjpmYWxzZX0s\neyJpZCI6MTIsImV4cGlyZVRpbWUiOm51bGwsIm5hbWUiOiJURVNUX1JVTl9T\nQ1JFRU5TSE9UUyIsInVzZUxpbWl0IjpudWxsLCJsaW1pdFVzZWQiOmZhbHNl\nLCJsaW1pdGVkIjpmYWxzZX1dLCJzdGF0ZSI6bnVsbCwidGltZVpvbmUiOm51\nbGwsInZhdElEIjpudWxsLCJjcmVhdGVUaW1lIjoxNDEyOTA2NDYzMDAwLCJl\nbWFpbE5vdGlmaWNhdGlvbiI6IkFMV0FZUyIsImlzTWFpblVzZXIiOnRydWV9\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"},{"request":{"method":"get","uri":"http://localhost:9080/testdroid-cloud/api/v2/users/100030","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJpZCI6MTAwMDMwLCJhZGRyZXNzIjpudWxsLCJjaXR5IjpudWxsLCJjb2Rl\nIjpudWxsLCJjb3VudHJ5IjpudWxsLCJlbWFpbCI6ImFkbWluQGxvY2FsaG9z\ndCIsImVuYWJsZWQiOnRydWUsIm5hbWUiOiJBZG1pbiIsIm9yZ2FuaXphdGlv\nbiI6bnVsbCwicGhvbmUiOm51bGwsInJvbGVzIjpbeyJpZCI6MSwiZXhwaXJl\nVGltZSI6bnVsbCwibmFtZSI6IklPUyIsInVzZUxpbWl0IjpudWxsLCJsaW1p\ndFVzZWQiOmZhbHNlLCJsaW1p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Fsc2V9LHsiaWQiOjEwLCJleHBp\ncmVUaW1lIjpudWxsLCJuYW1lIjoiVEVTVF9USU1FT1VUIiwidXNlTGltaXQi\nOjYwMCwibGltaXRVc2VkIjpmYWxzZSwibGltaXRlZCI6dHJ1ZX0seyJpZCI6\nMTEsImV4cGlyZVRpbWUiOm51bGwsIm5hbWUiOiJQQUlEX1JVTiIsInVzZUxp\nbWl0IjpudWxsLCJsaW1pdFVzZWQiOmZhbHNlLCJsaW1pdGVkIjpmYWxzZX0s\neyJpZCI6MTIsImV4cGlyZVRpbWUiOm51bGwsIm5hbWUiOiJURVNUX1JVTl9T\nQ1JFRU5TSE9UUyIsInVzZUxpbWl0IjpudWxsLCJsaW1pdFVzZWQiOmZhbHNl\nLCJsaW1pdGVkIjpmYWxzZX1dLCJzdGF0ZSI6bnVsbCwidGltZVpvbmUiOm51\nbGwsInZhdElEIjpudWxsLCJjcmVhdGVUaW1lIjoxNDEyOTA2NDYzMDAwLCJl\nbWFpbE5vdGlmaWNhdGlvbiI6IkFMV0FZUyIsImlzTWFpblVzZXIiOnRydWV9\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"}],"recorded_with":"VCR 2.9.3"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"post","uri":"http://localhost:9080/testdroid-cloud/api/v2/users/100030/projects/100750/config?instrumentationRunner=com.my.test.Runner&timeout=100","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJpZCI6MTMsImFwcFJlcXVpcmVkIjp0cnVlLCJhcHBsaWNhdGlvblBhc3N3\nb3JkIjpudWxsLCJhcHBsaWNhdGlvblVzZXJuYW1lIjpudWxsLCJhdXRvU2Ny\nZWVuc2hvdHMiOmZhbHNlLCJjaGVja0FwcCI6ZmFsc2UsImNyZWRpdHNQcmlj\nZSI6NCwiZGV2aWNlTGFuZ3VhZ2VDb2RlIjoiZW5fVVMiLCJob29rVVJMIjpu\ndWxsLCJpbnN0cnVtZW50YXRpb25SdW5uZXIiOiJjb20ubXkudGVzdC5SdW5u\nZXIiLCJsYXVuY2hBcHAiOnRydWUsImxpbWl0YXRpb25UeXBlIjpudWxsLCJs\naW1pdGF0aW9uVmFsdWUiOm51bGwsIm1vZGUiOiJBUFBfQ1JBV0xFUiIsInBy\nb2plY3RJZCI6MTAwNzUwLCJydW5BdmFpbGFibGUiOnRydWUsInNjaGVkdWxl\nciI6IlBBUkFMTEVMIiwic2NyZWVuc2hvdERpciI6bnVsbCwidWlBdXRvbWF0\nb3JUZXN0Q2xhc3NlcyI6bnVsbCwidXNlZERldmljZUdyb3VwSWQiOm51bGws\nIndpdGhBbm5vdGF0aW9uIjpudWxsLCJ3aXRob3V0QW5ub3RhdGlvbiI6bnVs\nbCwidGltZW91dCI6MTAwfQ==\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"}],"recorded_with":"VCR 2.9.3"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"http://localhost:9080/testdroid-cloud/api/v2/users/100030/projects","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJkYXRhIjpbeyJpZCI6MTAwMDkwLCJhcmNoaXZpbmdJ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:9080/testdroid-cloud/api/v2/users/100030/projects/100750/config","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"User-Agent":["Faraday v0.8.9"],"Accept":["application/json"],"Authorization":["Bearer c2149aaf-b748-4664-a252-371ad7d9d487"]}},"response":{"status":{"code":200,"message":null},"headers":{"server":["Apache-Coyote/1.1"],"content-type":["application/json;charset=UTF-8"],"transfer-encoding":["chunked"],"date":["Fri, 19 Dec 2014 23:40:07 GMT"]},"body":{"encoding":"UTF-8","base64_string":"eyJpZCI6MTMsImFwcFJlcXVpcmVkIjp0cnVlLCJhcHBsaWNhdGlvblBhc3N3\nb3JkIjpudWxsLCJhcHBsaWNhdGlvblVzZXJuYW1lIjpudWxsLCJhdXRvU2Ny\nZWVuc2hvdHMiOmZhbHNlLCJjaGVja0FwcCI6ZmFsc2UsImNyZWRpdHNQcmlj\nZSI6NCwiZGV2aWNlTGFuZ3VhZ2VDb2RlIjoiZW5fVVMiLCJob29rVVJMIjpu\ndWxsLCJpbnN0cnVtZW50YXRpb25SdW5uZXIiOiJjb20ubXkudGVzdC5SdW5u\nZXIiLCJsYXVuY2hBcHAiOnRydWUsImxpbWl0YXRpb25UeXBlIjpudWxsLCJs\naW1pdGF0aW9uVmFsdWUiOm51bGwsIm1vZGUiOiJBUFBfQ1JBV0xFUiIsInBy\nb2plY3RJZCI6MTAwNzUwLCJydW5BdmFpbGFibGUiOnRydWUsInNjaGVkdWxl\nciI6IlBBUkFMTEVMIiwic2NyZWVuc2hvdERpciI6bnVsbCwidWlBdXRvbWF0\nb3JUZXN0Q2xhc3NlcyI6bnVsbCwidXNlZERldmljZUdyb3VwSWQiOm51bGws\nIndpdGhBbm5vdGF0aW9uIjpudWxsLCJ3aXRob3V0QW5ub3RhdGlvbiI6bnVs\nbCwidGltZW91dCI6MTAwfQ==\n"},"http_version":null},"recorded_at":"Fri, 19 Dec 2014 23:40:07 GMT"}],"recorded_with":"VCR 2.9.3"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
describe TestdroidAPI::Config do
|
4
|
+
before :all do
|
5
|
+
VCR.use_cassette('pc_oauth2_auth_config', :record => :new_episodes) do
|
6
|
+
@user = client_local_host("http://localhost:9080/testdroid-cloud").authorize
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'get current project config' do
|
11
|
+
project_name = "Android Project"
|
12
|
+
VCR.use_cassette('pc_get_current', :record => :new_episodes) do
|
13
|
+
android_project = @user.projects.list.detect {|project| project.name.casecmp(project_name) == 0 }
|
14
|
+
expect(android_project.config).to_not be_nil
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
it 'set project config' do
|
19
|
+
project_name = "Android Project"
|
20
|
+
android_project = nil
|
21
|
+
VCR.use_cassette('pc_get_current', :record => :new_episodes) do
|
22
|
+
android_project = @user.projects.list.detect {|project| project.name.casecmp(project_name) == 0 }
|
23
|
+
expect(android_project.config).to_not be_nil
|
24
|
+
|
25
|
+
end
|
26
|
+
VCR.use_cassette('pc_set_current_config', :record => :new_episodes) do
|
27
|
+
android_project.config.update({:params => {:instrumentationRunner => 'com.my.test.Runner', :timeout => 100}})
|
28
|
+
|
29
|
+
end
|
30
|
+
VCR.use_cassette('pc_validate_config', :record => :new_episodes) do
|
31
|
+
android_project = @user.projects.list.detect {|project| project.name.casecmp(project_name) == 0 }
|
32
|
+
expect(android_project.config.instrumentation_runner).to eq ('com.my.test.Runner')
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -26,9 +26,9 @@ def client
|
|
26
26
|
rescue Exception => e
|
27
27
|
end
|
28
28
|
end
|
29
|
-
def client_local_host
|
29
|
+
def client_local_host(local_cloud='http://localhost:8080/testdroid-cloud')
|
30
30
|
@client_local_host ||= begin
|
31
|
-
client_local_host = Client.new('admin@localhost', 'admin',
|
31
|
+
client_local_host = Client.new('admin@localhost', 'admin', local_cloud)
|
32
32
|
rescue Exception => e
|
33
33
|
end
|
34
34
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "testdroid-api-client"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.2.0"
|
4
4
|
|
5
5
|
|
6
6
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
7
|
s.authors = ["Sakari Rautiainen"]
|
8
|
-
s.date = %q{
|
8
|
+
s.date = %q{2014-12-19}
|
9
9
|
s.description = %q{Ruby client for testdroid api v2}
|
10
10
|
s.license = "MIT"
|
11
11
|
s.email = %q{sakari.rautiainen@bitbar.com}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testdroid-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sakari Rautiainen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/testdroid_api/client.rb
|
158
158
|
- lib/testdroid_api/cloud_list_resource.rb
|
159
159
|
- lib/testdroid_api/cloud_resource.rb
|
160
|
+
- lib/testdroid_api/config.rb
|
160
161
|
- lib/testdroid_api/device_groups.rb
|
161
162
|
- lib/testdroid_api/device_runs.rb
|
162
163
|
- lib/testdroid_api/device_sessions.rb
|
@@ -215,6 +216,10 @@ files:
|
|
215
216
|
- spec/fixtures/cassettes/p_oauth2_local.json
|
216
217
|
- spec/fixtures/cassettes/p_project_id_33029366.json
|
217
218
|
- spec/fixtures/cassettes/p_run_project.json
|
219
|
+
- spec/fixtures/cassettes/pc_get_current.json
|
220
|
+
- spec/fixtures/cassettes/pc_oauth2_auth_config.json
|
221
|
+
- spec/fixtures/cassettes/pc_set_current_config.json
|
222
|
+
- spec/fixtures/cassettes/pc_validate_config.json
|
218
223
|
- spec/fixtures/cassettes/r_all_project_33029366_runs.json
|
219
224
|
- spec/fixtures/cassettes/r_delete_test_run.json
|
220
225
|
- spec/fixtures/cassettes/r_oauth2_auth_runs.json
|
@@ -223,6 +228,7 @@ files:
|
|
223
228
|
- spec/fixtures/cassettes/upload_files.json
|
224
229
|
- spec/fixtures/project.json
|
225
230
|
- spec/label_groups_spec.rb
|
231
|
+
- spec/project_config_spec.rb
|
226
232
|
- spec/project_spec.rb
|
227
233
|
- spec/run_spec.rb
|
228
234
|
- spec/spec_helper.rb
|
@@ -291,6 +297,10 @@ test_files:
|
|
291
297
|
- spec/fixtures/cassettes/p_oauth2_local.json
|
292
298
|
- spec/fixtures/cassettes/p_project_id_33029366.json
|
293
299
|
- spec/fixtures/cassettes/p_run_project.json
|
300
|
+
- spec/fixtures/cassettes/pc_get_current.json
|
301
|
+
- spec/fixtures/cassettes/pc_oauth2_auth_config.json
|
302
|
+
- spec/fixtures/cassettes/pc_set_current_config.json
|
303
|
+
- spec/fixtures/cassettes/pc_validate_config.json
|
294
304
|
- spec/fixtures/cassettes/r_all_project_33029366_runs.json
|
295
305
|
- spec/fixtures/cassettes/r_delete_test_run.json
|
296
306
|
- spec/fixtures/cassettes/r_oauth2_auth_runs.json
|
@@ -299,6 +309,7 @@ test_files:
|
|
299
309
|
- spec/fixtures/cassettes/upload_files.json
|
300
310
|
- spec/fixtures/project.json
|
301
311
|
- spec/label_groups_spec.rb
|
312
|
+
- spec/project_config_spec.rb
|
302
313
|
- spec/project_spec.rb
|
303
314
|
- spec/run_spec.rb
|
304
315
|
- spec/spec_helper.rb
|