testingbot 0.2.1 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 794e0199499d4673ec0942705d9de3ac37b5535211127dc1e3a291d63ea4cd03
4
- data.tar.gz: 1f2566eb58ec86366945312443c855d40d0995a24bbf848e8c7142919a596040
3
+ metadata.gz: 104c19c8464d4b3a2da5ca401c9435206893b9abcc9d633f8e06962573458ce3
4
+ data.tar.gz: 48f5415943bdbf9c89f4c386a5e74f1cefcba46f460108a9b9b9dbfc0be91c32
5
5
  SHA512:
6
- metadata.gz: 03d64dfda0351d513576dbb4c01645d75863ddac7f05c2f25530b8e736b78db4d02f9e35e2c18e6db67def006af387d849efd83968d36ba99a4b7e245c550179
7
- data.tar.gz: def50ac030356038be8f378ae29e4fd7d51120f5d9d18b5ad8d571d23bed0cd0f2b064228c6cd2e5bfd4e548291d45e29c4ee7e124a34054177c6024be886999
6
+ metadata.gz: af4c1c842c83a7321dfdf4278776f075d4241c810f73d99aff3368fa79c1b1ef58a07ac94b95cfdacafa62c273496262f545e2f7242f171077295d5cb966bf60
7
+ data.tar.gz: c1057b5b46786c4d4ba466e3324f9ba232d754811d813cbb6c3f61d511c3c3769c11b0cd81858565103b0436f6a8e114c5a6647bd3cbd64868228c8f9ef29429
@@ -0,0 +1,25 @@
1
+ name: Test Changes
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby: ['2.2', '2.5', '2.6', '2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
11
+ name: Ruby ${{ matrix.ruby }} test
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true
18
+ - name: Build and test
19
+ run: |
20
+ sudo apt-get -yqq install libpq-dev
21
+ bundle exec rake spec
22
+ env:
23
+ TB_KEY: ${{ secrets.TB_KEY }}
24
+ TB_SECRET: ${{ secrets.TB_SECRET }}
25
+
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- [![Build Status](https://travis-ci.org/testingbot/testingbot_ruby.png)](https://travis-ci.org/testingbot/testingbot_ruby)
2
1
  [![Gem Version](https://badge.fury.io/rb/testingbot.svg)](https://badge.fury.io/rb/testingbot)
2
+ [![Test Changes](https://github.com/testingbot/testingbot_ruby/actions/workflows/test.yml/badge.svg)](https://github.com/testingbot/testingbot_ruby/actions/workflows/test.yml)
3
3
 
4
4
  # Testingbot-Ruby
5
5
 
@@ -50,6 +50,83 @@ Gets a list of browsers you can test on
50
50
  @api.get_browsers
51
51
  ```
52
52
 
53
+ ### get_devices
54
+ Gets a list of (physical) devices you can test on
55
+
56
+ ```ruby
57
+ @api.get_devices
58
+ ```
59
+
60
+ ### get_available_devices
61
+ Gets a list of available (physical) devices you can test on
62
+
63
+ ```ruby
64
+ @api.get_available_devices
65
+ ```
66
+
67
+ ### get_team
68
+ Gets info about the current team you belong to
69
+
70
+ ```ruby
71
+ @api.get_team
72
+ ```
73
+
74
+ ### get_users_in_team
75
+ Gets all users in your team
76
+
77
+ ```ruby
78
+ @api.get_users_in_team(offset = 0, count = 10)
79
+ ```
80
+
81
+ ### get_user_in_team
82
+ Get info about a specific user in your team
83
+
84
+ ```ruby
85
+ @api.get_user_in_team(user_id)
86
+ ```
87
+
88
+ ### create_user_in_team
89
+ Add a user to your current team. You need to have ADMIN rights to do this.
90
+
91
+ ```ruby
92
+ @api.create_user_in_team(user = {})
93
+ ```
94
+
95
+ ### update_user_in_team
96
+ Updates a specific user in your team.
97
+
98
+ ```ruby
99
+ @api.update_user_in_team(user_id, user = {})
100
+ ```
101
+
102
+ ### reset_credentials
103
+ Resets the credentials for a specific user
104
+
105
+ ```ruby
106
+ @api.reset_credentials(user_id)
107
+ ```
108
+
109
+ ### take_screenshots
110
+ Take screenshots for a specific URL on specific browsers
111
+
112
+ ```ruby
113
+ @api.take_screenshots(configuration)
114
+ ```
115
+
116
+ ### get_screenshots_history
117
+ Retrieve screenshots that were previously generated
118
+
119
+ ```ruby
120
+ @api.get_screenshots_history(offset = 0, count = 10)
121
+ ```
122
+
123
+ ### get_screenshots
124
+ Get screenshots from a specific id
125
+
126
+ ```ruby
127
+ @api.get_screenshots(screenshots_id)
128
+ ```
129
+
53
130
  ### get_user_info
54
131
  Gets your user information
55
132
 
@@ -114,6 +191,13 @@ Gets a build from TestingBot
114
191
  @api.get_build(build_identifier)
115
192
  ```
116
193
 
194
+ ### delete_build
195
+ Deletes a build from TestingBot
196
+
197
+ ```ruby
198
+ @api.delete_build(build_identifier)
199
+ ```
200
+
117
201
  ### get_tunnels
118
202
  Gets a list of active tunnels for your account.
119
203
 
@@ -121,6 +205,13 @@ Gets a list of active tunnels for your account.
121
205
  @api.get_tunnels
122
206
  ```
123
207
 
208
+ ### delete_tunnel
209
+ Deletes an active tunnel.
210
+
211
+ ```ruby
212
+ @api.delete_tunnel(tunnel_identifier)
213
+ ```
214
+
124
215
  ### upload_local_file
125
216
  Uploads a local file (APK or IPA file) to TestingBot Storage for Mobile App Testing.
126
217
 
@@ -149,12 +240,20 @@ Retrieves meta-data for a file previously uploaded to TestingBot Storage.
149
240
  @api.get_uploaded_file(app_url)
150
241
  ```
151
242
 
243
+ ### delete_uploaded_file
244
+ Deletes a previously uploaded file
245
+
246
+ ```ruby
247
+ @api.delete_uploaded_file(remoteFileUrl)
248
+ ```
249
+
152
250
  ### upload_remote_file
153
251
  Uploads a remote file (APK or IPA URL) to TestingBot Storage for Mobile App Testing.
154
252
 
155
253
  ```ruby
156
254
  @api.upload_remote_file(remoteFileUrl)
157
255
  ```
256
+
158
257
  ### get_authentication_hash
159
258
  Calculates the hash necessary to share tests with other people
160
259
 
data/bin/testingbot CHANGED
@@ -14,6 +14,6 @@ else
14
14
  api_secret = gets.chomp
15
15
  end
16
16
 
17
- File.open(File.expand_path("~/.testingbot"), 'w') {|f| f.write("#{api_key}:#{api_secret}") }
17
+ File.open(File.join(Dir.home, ".testingbot"), 'w') {|f| f.write("#{api_key}:#{api_secret}") }
18
18
 
19
19
  p "Your system is now ready to use TestingBot's grid infrastructure."
@@ -43,6 +43,38 @@ module TestingBot
43
43
  get("/browsers")
44
44
  end
45
45
 
46
+ def get_devices
47
+ get("/devices")
48
+ end
49
+
50
+ def get_available_devices
51
+ get("/devices/available")
52
+ end
53
+
54
+ def get_team
55
+ get("/team-management")
56
+ end
57
+
58
+ def get_users_in_team(offset = 0, count = 10)
59
+ get("/team-management/users?offset=#{offset}&count=#{count}")
60
+ end
61
+
62
+ def get_user_in_team(user_id)
63
+ get("/team-management/users/#{user_id}")
64
+ end
65
+
66
+ def create_user_in_team(user = {})
67
+ post("/team-management/users/", user)
68
+ end
69
+
70
+ def update_user_in_team(user_id, user = {})
71
+ put("/team-management/users/#{user_id}", user)
72
+ end
73
+
74
+ def reset_credentials(user_id)
75
+ post("/team-management/users/#{user_id}/reset-keys")
76
+ end
77
+
46
78
  def update_user_info(params = {})
47
79
  new_params = {}
48
80
  params.keys.each do |key|
@@ -87,10 +119,30 @@ module TestingBot
87
119
  get("/builds/#{build_identifier}")
88
120
  end
89
121
 
122
+ def delete_build(build_identifier)
123
+ delete("/builds/#{build_identifier}")
124
+ end
125
+
126
+ def take_screenshots(configuration)
127
+ post("/screenshots", configuration)
128
+ end
129
+
130
+ def get_screenshots_history(offset = 0, count = 10)
131
+ get("/screenshots?offset=#{offset}&count=#{count}")
132
+ end
133
+
134
+ def get_screenshots(screenshots_id)
135
+ get("/screenshots/#{screenshots_id}")
136
+ end
137
+
90
138
  def get_tunnels
91
139
  get("/tunnel/list")
92
140
  end
93
141
 
142
+ def delete_tunnel(tunnel_identifier)
143
+ delete("/tunnel/#{tunnel_identifier}")
144
+ end
145
+
94
146
  def get_authentication_hash(identifier)
95
147
  Digest::MD5.hexdigest("#{@key}:#{@secret}:#{identifier}")
96
148
  end
@@ -133,22 +185,9 @@ module TestingBot
133
185
  private
134
186
 
135
187
  def load_config_file
136
- is_windows = false
137
-
138
- begin
139
- require 'rbconfig'
140
- is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
141
- rescue
142
- is_windows = (RUBY_PLATFORM =~ /w.*32/) || (ENV["OS"] && ENV["OS"] == "Windows_NT")
143
- end
144
-
145
- if is_windows
146
- config_file = "#{ENV['HOMEDRIVE']}\\.testingbot"
147
- else
148
- config_file = File.expand_path("#{Dir.home}/.testingbot")
149
- end
188
+ config_file = File.join(Dir.home, ".testingbot")
150
189
 
151
- if File.exists?(config_file)
190
+ if File.exist?(config_file)
152
191
  str = File.open(config_file) { |f| f.readline }.chomp
153
192
  return str.split(':')
154
193
  end
@@ -1,3 +1,3 @@
1
1
  module Testingbot
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testingbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jochen Delabie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-02 00:00:00.000000000 Z
11
+ date: 2023-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -74,8 +74,8 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/test.yml"
77
78
  - ".gitignore"
78
- - ".travis.yml"
79
79
  - Gemfile
80
80
  - LICENSE
81
81
  - README.md
@@ -90,24 +90,27 @@ files:
90
90
  homepage: https://testingbot.com
91
91
  licenses:
92
92
  - MIT
93
- metadata: {}
93
+ metadata:
94
+ bug_tracker_uri: https://github.com/testingbot/testingbot_ruby/issues
95
+ documentation_uri: https://github.com/testingbot/testingbot_ruby
96
+ homepage_uri: https://github.com/testingbot/testingbot_ruby
97
+ source_code_uri: https://github.com/testingbot/testingbot_ruby
94
98
  post_install_message:
95
99
  rdoc_options: []
96
100
  require_paths:
97
101
  - lib
98
102
  required_ruby_version: !ruby/object:Gem::Requirement
99
103
  requirements:
100
- - - "~>"
104
+ - - ">="
101
105
  - !ruby/object:Gem::Version
102
- version: '2.0'
106
+ version: '0'
103
107
  required_rubygems_version: !ruby/object:Gem::Requirement
104
108
  requirements:
105
109
  - - ">="
106
110
  - !ruby/object:Gem::Version
107
111
  version: '0'
108
112
  requirements: []
109
- rubyforge_project: testingbot
110
- rubygems_version: 2.7.8
113
+ rubygems_version: 3.0.3.1
111
114
  signing_key:
112
115
  specification_version: 4
113
116
  summary: Ruby API Gem to be used with testingbot.com
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 2.1.1
5
- - 2.3
6
- - 2.4
7
- - 2.5
8
- - 2.6
9
- script: bundle exec rake spec