testdroid-api-client 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +23 -0
- data/LICENSE +20 -0
- data/README.md +39 -0
- data/lib/testdroid-api-client.rb +19 -0
- data/lib/testdroid_api/client.rb +124 -0
- data/lib/testdroid_api/cloud_list_resource.rb +83 -0
- data/lib/testdroid_api/cloud_resource.rb +72 -0
- data/lib/testdroid_api/device_groups.rb +12 -0
- data/lib/testdroid_api/device_runs.rb +20 -0
- data/lib/testdroid_api/device_sessions.rb +15 -0
- data/lib/testdroid_api/devices.rb +13 -0
- data/lib/testdroid_api/files.rb +60 -0
- data/lib/testdroid_api/label_groups.rb +13 -0
- data/lib/testdroid_api/labels.rb +13 -0
- data/lib/testdroid_api/projects.rb +21 -0
- data/lib/testdroid_api/runs.rb +11 -0
- data/lib/testdroid_api/user.rb +8 -0
- data/spec/client_spec.rb +10 -0
- data/spec/device_groups_spec.rb +28 -0
- data/spec/device_runs_spec.rb +25 -0
- data/spec/files_spec.rb +33 -0
- data/spec/fixtures/apk.apk +0 -0
- data/spec/fixtures/cassettes/dg_all_device_groups.json +1 -0
- data/spec/fixtures/cassettes/dg_device_group_4165.json +1 -0
- data/spec/fixtures/cassettes/dg_oauth2_auth_device_groups.json +1 -0
- data/spec/fixtures/cassettes/dr_all_run_171221_device_runs.json +1 -0
- data/spec/fixtures/cassettes/dr_device_run_33044722.json +1 -0
- data/spec/fixtures/cassettes/dr_oauth2_auth_device_runs.json +1 -0
- data/spec/fixtures/cassettes/dr_run_33044722_device_runs.json +1 -0
- data/spec/fixtures/cassettes/f_android_app_file.json +1 -0
- data/spec/fixtures/cassettes/f_oauth2_auth_files.json +1 -0
- data/spec/fixtures/cassettes/f_upload_files.json +1 -0
- data/spec/fixtures/cassettes/fu_oauth2_auth_files.json +1 -0
- data/spec/fixtures/cassettes/lg_all_label_groups.json +1 -0
- data/spec/fixtures/cassettes/lg_get_resources_by_label.json +1 -0
- data/spec/fixtures/cassettes/lg_label_group_1058800.json +1 -0
- data/spec/fixtures/cassettes/lg_labels_of_group_1058800.json +1 -0
- data/spec/fixtures/cassettes/lg_oauth2_auth_label_groups.json +1 -0
- data/spec/fixtures/cassettes/p_all_projects.json +1 -0
- data/spec/fixtures/cassettes/p_get_run_devices.json +1 -0
- data/spec/fixtures/cassettes/p_oauth2_auth.json +1 -0
- data/spec/fixtures/cassettes/p_project_id_33029366.json +1 -0
- data/spec/fixtures/cassettes/p_run_project.json +1 -0
- data/spec/fixtures/cassettes/r_all_project_33029366_runs.json +1 -0
- data/spec/fixtures/cassettes/r_delete_test_run.json +1 -0
- data/spec/fixtures/cassettes/r_oauth2_auth_runs.json +1 -0
- data/spec/fixtures/cassettes/r_run_171221.json +1 -0
- data/spec/fixtures/cassettes/r_run_project.json +1 -0
- data/spec/fixtures/cassettes/upload_files.json +1 -0
- data/spec/fixtures/project.json +8 -0
- data/spec/label_groups_spec.rb +54 -0
- data/spec/project_spec.rb +43 -0
- data/spec/run_spec.rb +33 -0
- data/spec/spec_helper.rb +33 -0
- data/testdroid-api-client.gemspec +35 -0
- metadata +265 -0
data/spec/run_spec.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
describe TestdroidAPI::Run do
|
4
|
+
before :all do
|
5
|
+
VCR.use_cassette('r_oauth2_auth_runs') do
|
6
|
+
@user = client.authorize
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'get runs' do
|
11
|
+
|
12
|
+
VCR.use_cassette('r_all_project_33029366_runs') do
|
13
|
+
@user.projects.get(33029366).runs.list.should_not be nil
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
it 'get run using id' do
|
18
|
+
|
19
|
+
VCR.use_cassette('r_run_171221') do
|
20
|
+
@user.projects.get(33029366).runs.get(33044722).id.should == 33044722
|
21
|
+
end
|
22
|
+
end
|
23
|
+
it 'delete run using id' do
|
24
|
+
testRun = nil
|
25
|
+
VCR.use_cassette('r_run_project') do
|
26
|
+
testRun = @user.projects.get(33029366).run()
|
27
|
+
|
28
|
+
end
|
29
|
+
VCR.use_cassette('r_delete_test_run') do
|
30
|
+
@user.projects.get(33029366).runs.get(testRun.id).delete
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
gem 'rspec', '~> 2.4'
|
2
|
+
gem 'faraday', '~> 0.9'
|
3
|
+
|
4
|
+
require 'rspec'
|
5
|
+
require 'json'
|
6
|
+
require_relative '../lib/testdroid-api-client'
|
7
|
+
require 'webmock/rspec'
|
8
|
+
require 'vcr'
|
9
|
+
|
10
|
+
include TestdroidAPI
|
11
|
+
CLOUD_ENDPOINT='https://cloud.testdroid.com'
|
12
|
+
|
13
|
+
|
14
|
+
VCR.configure do |c|
|
15
|
+
puts "init VCR"
|
16
|
+
c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures', 'cassettes')
|
17
|
+
c.hook_into :webmock , :faraday
|
18
|
+
c.default_cassette_options = {:serialize_with => :json, :preserve_exact_body_bytes => true, :decode_compressed_response => true}
|
19
|
+
c.allow_http_connections_when_no_cassette = false
|
20
|
+
end
|
21
|
+
|
22
|
+
def client
|
23
|
+
@client ||= begin
|
24
|
+
client = Client.new('defaultuser', 'password')
|
25
|
+
rescue Exception => e
|
26
|
+
end
|
27
|
+
end
|
28
|
+
def client_local_host
|
29
|
+
@client_local_host ||= begin
|
30
|
+
client_local_host = Client.new('admin@localhost', 'admin', 'http://localhost:8080/testdroid-cloud')
|
31
|
+
rescue Exception => e
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "testdroid-api-client"
|
3
|
+
s.version = "0.1.1"
|
4
|
+
|
5
|
+
|
6
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
|
+
s.authors = ["Sakari Rautiainen"]
|
8
|
+
s.date = %q{2013-10-15}
|
9
|
+
s.description = %q{Ruby client for testdroid api v2}
|
10
|
+
s.license = "MIT"
|
11
|
+
s.email = %q{sakari.rautiainen@bitbar.com}
|
12
|
+
s.files = `git ls-files`.split($/)
|
13
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
s.homepage = %q{http://rubygems.org/gems/testdroid-api-client}
|
15
|
+
s.require_paths = ['lib']
|
16
|
+
s.rubygems_version = %q{2.2.2}
|
17
|
+
s.summary = %q{Testdroid API Client!}
|
18
|
+
s.add_runtime_dependency "oauth2",'~> 0.9'
|
19
|
+
s.add_runtime_dependency "faraday",'~> 0.9', '>= 0.9'
|
20
|
+
s.add_development_dependency "bump",'~> 0.5'
|
21
|
+
s.add_development_dependency "rake"
|
22
|
+
s.add_development_dependency "rspec"
|
23
|
+
s.add_development_dependency "vcr", '~> 2.9'
|
24
|
+
s.add_development_dependency "webmock", '~> 1.9'
|
25
|
+
s.add_development_dependency "yard", '~> 0.8'
|
26
|
+
|
27
|
+
if s.respond_to? :specification_version then
|
28
|
+
s.specification_version = 3
|
29
|
+
|
30
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
31
|
+
else
|
32
|
+
end
|
33
|
+
else
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,265 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: testdroid-api-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sakari Rautiainen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0.9'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.9'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.9'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bump
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.5'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.5'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rake
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: vcr
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.9'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '2.9'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: webmock
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.9'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '1.9'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: yard
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0.8'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0.8'
|
131
|
+
description: Ruby client for testdroid api v2
|
132
|
+
email: sakari.rautiainen@bitbar.com
|
133
|
+
executables: []
|
134
|
+
extensions: []
|
135
|
+
extra_rdoc_files: []
|
136
|
+
files:
|
137
|
+
- ".gitignore"
|
138
|
+
- Gemfile
|
139
|
+
- Gemfile.lock
|
140
|
+
- LICENSE
|
141
|
+
- README.md
|
142
|
+
- lib/testdroid-api-client.rb
|
143
|
+
- lib/testdroid_api/client.rb
|
144
|
+
- lib/testdroid_api/cloud_list_resource.rb
|
145
|
+
- lib/testdroid_api/cloud_resource.rb
|
146
|
+
- lib/testdroid_api/device_groups.rb
|
147
|
+
- lib/testdroid_api/device_runs.rb
|
148
|
+
- lib/testdroid_api/device_sessions.rb
|
149
|
+
- lib/testdroid_api/devices.rb
|
150
|
+
- lib/testdroid_api/files.rb
|
151
|
+
- lib/testdroid_api/label_groups.rb
|
152
|
+
- lib/testdroid_api/labels.rb
|
153
|
+
- lib/testdroid_api/projects.rb
|
154
|
+
- lib/testdroid_api/runs.rb
|
155
|
+
- lib/testdroid_api/user.rb
|
156
|
+
- pkg/testdroid-api-client-0.0.3.gem
|
157
|
+
- pkg/testdroid-api-client-0.0.4.gem
|
158
|
+
- pkg/testdroid-api-client-0.0.5.gem
|
159
|
+
- pkg/testdroid-api-client-0.0.6.gem
|
160
|
+
- pkg/testdroid-api-client-0.0.7.gem
|
161
|
+
- pkg/testdroid-api-client-0.1.0.gem
|
162
|
+
- pkg/testdroid-api-client-0.1.1.gem
|
163
|
+
- spec/client_spec.rb
|
164
|
+
- spec/device_groups_spec.rb
|
165
|
+
- spec/device_runs_spec.rb
|
166
|
+
- spec/files_spec.rb
|
167
|
+
- spec/fixtures/apk.apk
|
168
|
+
- spec/fixtures/cassettes/.DS_Store
|
169
|
+
- spec/fixtures/cassettes/dg_all_device_groups.json
|
170
|
+
- spec/fixtures/cassettes/dg_device_group_4165.json
|
171
|
+
- spec/fixtures/cassettes/dg_oauth2_auth_device_groups.json
|
172
|
+
- spec/fixtures/cassettes/dr_all_run_171221_device_runs.json
|
173
|
+
- spec/fixtures/cassettes/dr_device_run_33044722.json
|
174
|
+
- spec/fixtures/cassettes/dr_oauth2_auth_device_runs.json
|
175
|
+
- spec/fixtures/cassettes/dr_run_33044722_device_runs.json
|
176
|
+
- spec/fixtures/cassettes/f_android_app_file.json
|
177
|
+
- spec/fixtures/cassettes/f_oauth2_auth_files.json
|
178
|
+
- spec/fixtures/cassettes/f_upload_files.json
|
179
|
+
- spec/fixtures/cassettes/fu_oauth2_auth_files.json
|
180
|
+
- spec/fixtures/cassettes/lg_all_label_groups.json
|
181
|
+
- spec/fixtures/cassettes/lg_get_resources_by_label.json
|
182
|
+
- spec/fixtures/cassettes/lg_label_group_1058800.json
|
183
|
+
- spec/fixtures/cassettes/lg_labels_of_group_1058800.json
|
184
|
+
- spec/fixtures/cassettes/lg_oauth2_auth_label_groups.json
|
185
|
+
- spec/fixtures/cassettes/p_all_projects.json
|
186
|
+
- spec/fixtures/cassettes/p_get_run_devices.json
|
187
|
+
- spec/fixtures/cassettes/p_oauth2_auth.json
|
188
|
+
- spec/fixtures/cassettes/p_project_id_33029366.json
|
189
|
+
- spec/fixtures/cassettes/p_run_project.json
|
190
|
+
- spec/fixtures/cassettes/r_all_project_33029366_runs.json
|
191
|
+
- spec/fixtures/cassettes/r_delete_test_run.json
|
192
|
+
- spec/fixtures/cassettes/r_oauth2_auth_runs.json
|
193
|
+
- spec/fixtures/cassettes/r_run_171221.json
|
194
|
+
- spec/fixtures/cassettes/r_run_project.json
|
195
|
+
- spec/fixtures/cassettes/upload_files.json
|
196
|
+
- spec/fixtures/project.json
|
197
|
+
- spec/label_groups_spec.rb
|
198
|
+
- spec/project_spec.rb
|
199
|
+
- spec/run_spec.rb
|
200
|
+
- spec/spec_helper.rb
|
201
|
+
- testdroid-api-client.gemspec
|
202
|
+
homepage: http://rubygems.org/gems/testdroid-api-client
|
203
|
+
licenses:
|
204
|
+
- MIT
|
205
|
+
metadata: {}
|
206
|
+
post_install_message:
|
207
|
+
rdoc_options: []
|
208
|
+
require_paths:
|
209
|
+
- lib
|
210
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0'
|
220
|
+
requirements: []
|
221
|
+
rubyforge_project:
|
222
|
+
rubygems_version: 2.2.2
|
223
|
+
signing_key:
|
224
|
+
specification_version: 3
|
225
|
+
summary: Testdroid API Client!
|
226
|
+
test_files:
|
227
|
+
- spec/client_spec.rb
|
228
|
+
- spec/device_groups_spec.rb
|
229
|
+
- spec/device_runs_spec.rb
|
230
|
+
- spec/files_spec.rb
|
231
|
+
- spec/fixtures/apk.apk
|
232
|
+
- spec/fixtures/cassettes/.DS_Store
|
233
|
+
- spec/fixtures/cassettes/dg_all_device_groups.json
|
234
|
+
- spec/fixtures/cassettes/dg_device_group_4165.json
|
235
|
+
- spec/fixtures/cassettes/dg_oauth2_auth_device_groups.json
|
236
|
+
- spec/fixtures/cassettes/dr_all_run_171221_device_runs.json
|
237
|
+
- spec/fixtures/cassettes/dr_device_run_33044722.json
|
238
|
+
- spec/fixtures/cassettes/dr_oauth2_auth_device_runs.json
|
239
|
+
- spec/fixtures/cassettes/dr_run_33044722_device_runs.json
|
240
|
+
- spec/fixtures/cassettes/f_android_app_file.json
|
241
|
+
- spec/fixtures/cassettes/f_oauth2_auth_files.json
|
242
|
+
- spec/fixtures/cassettes/f_upload_files.json
|
243
|
+
- spec/fixtures/cassettes/fu_oauth2_auth_files.json
|
244
|
+
- spec/fixtures/cassettes/lg_all_label_groups.json
|
245
|
+
- spec/fixtures/cassettes/lg_get_resources_by_label.json
|
246
|
+
- spec/fixtures/cassettes/lg_label_group_1058800.json
|
247
|
+
- spec/fixtures/cassettes/lg_labels_of_group_1058800.json
|
248
|
+
- spec/fixtures/cassettes/lg_oauth2_auth_label_groups.json
|
249
|
+
- spec/fixtures/cassettes/p_all_projects.json
|
250
|
+
- spec/fixtures/cassettes/p_get_run_devices.json
|
251
|
+
- spec/fixtures/cassettes/p_oauth2_auth.json
|
252
|
+
- spec/fixtures/cassettes/p_project_id_33029366.json
|
253
|
+
- spec/fixtures/cassettes/p_run_project.json
|
254
|
+
- spec/fixtures/cassettes/r_all_project_33029366_runs.json
|
255
|
+
- spec/fixtures/cassettes/r_delete_test_run.json
|
256
|
+
- spec/fixtures/cassettes/r_oauth2_auth_runs.json
|
257
|
+
- spec/fixtures/cassettes/r_run_171221.json
|
258
|
+
- spec/fixtures/cassettes/r_run_project.json
|
259
|
+
- spec/fixtures/cassettes/upload_files.json
|
260
|
+
- spec/fixtures/project.json
|
261
|
+
- spec/label_groups_spec.rb
|
262
|
+
- spec/project_spec.rb
|
263
|
+
- spec/run_spec.rb
|
264
|
+
- spec/spec_helper.rb
|
265
|
+
has_rdoc:
|