testingbot 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c1801b21d64a6515b1fd8d1f1a6db23b0915dff62121b49a681d02eff530c2a
4
- data.tar.gz: 30edd8ebbc255bf2b14005e9c5ea881b5bfc1ef6a19a1e8b9a24ed2bc2584f59
3
+ metadata.gz: 104c19c8464d4b3a2da5ca401c9435206893b9abcc9d633f8e06962573458ce3
4
+ data.tar.gz: 48f5415943bdbf9c89f4c386a5e74f1cefcba46f460108a9b9b9dbfc0be91c32
5
5
  SHA512:
6
- metadata.gz: 50e9843ec66a235debde34b17f2a40ab05bc545fd175959d14497b5b23a133beb9155408d61363cf307d2463b1aeb23cad50d081d05ff6a40dd431b9b82c3119
7
- data.tar.gz: e781af83c71eeb24d0d086e29b1ee1e0bce71263b260045e1d2acc656f7d55409a03991bde4802edfae33bf474648184e45755bb7324ac6c9bcb8b0c1c48fc03
6
+ metadata.gz: af4c1c842c83a7321dfdf4278776f075d4241c810f73d99aff3368fa79c1b1ef58a07ac94b95cfdacafa62c273496262f545e2f7242f171077295d5cb966bf60
7
+ data.tar.gz: c1057b5b46786c4d4ba466e3324f9ba232d754811d813cbb6c3f61d511c3c3769c11b0cd81858565103b0436f6a8e114c5a6647bd3cbd64868228c8f9ef29429
@@ -7,18 +7,17 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ '2.5', '2.6' ]
10
+ ruby: ['2.2', '2.5', '2.6', '2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
11
11
  name: Ruby ${{ matrix.ruby }} test
12
12
  steps:
13
- - uses: actions/checkout@v2
14
- - uses: actions/setup-ruby@v1
13
+ - uses: actions/checkout@v3
14
+ - uses: ruby/setup-ruby@v1
15
15
  with:
16
16
  ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true
17
18
  - name: Build and test
18
19
  run: |
19
20
  sudo apt-get -yqq install libpq-dev
20
- gem install bundler
21
- bundle install --jobs 3 --retry 3
22
21
  bundle exec rake spec
23
22
  env:
24
23
  TB_KEY: ${{ secrets.TB_KEY }}
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
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)
2
3
 
3
4
  # Testingbot-Ruby
4
5
 
@@ -63,6 +64,69 @@ Gets a list of available (physical) devices you can test on
63
64
  @api.get_available_devices
64
65
  ```
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
+
66
130
  ### get_user_info
67
131
  Gets your user information
68
132
 
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."
@@ -51,6 +51,30 @@ module TestingBot
51
51
  get("/devices/available")
52
52
  end
53
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
+
54
78
  def update_user_info(params = {})
55
79
  new_params = {}
56
80
  params.keys.each do |key|
@@ -99,6 +123,18 @@ module TestingBot
99
123
  delete("/builds/#{build_identifier}")
100
124
  end
101
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
+
102
138
  def get_tunnels
103
139
  get("/tunnel/list")
104
140
  end
@@ -149,22 +185,9 @@ module TestingBot
149
185
  private
150
186
 
151
187
  def load_config_file
152
- is_windows = false
153
-
154
- begin
155
- require 'rbconfig'
156
- is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
157
- rescue
158
- is_windows = (RUBY_PLATFORM =~ /w.*32/) || (ENV["OS"] && ENV["OS"] == "Windows_NT")
159
- end
160
-
161
- if is_windows
162
- config_file = "#{ENV['HOMEDRIVE']}\\.testingbot"
163
- else
164
- config_file = File.expand_path("#{Dir.home}/.testingbot")
165
- end
188
+ config_file = File.join(Dir.home, ".testingbot")
166
189
 
167
- if File.exists?(config_file)
190
+ if File.exist?(config_file)
168
191
  str = File.open(config_file) { |f| f.readline }.chomp
169
192
  return str.split(':')
170
193
  end
@@ -1,3 +1,3 @@
1
1
  module Testingbot
2
- VERSION = "0.2.2"
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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jochen Delabie
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 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
@@ -76,7 +76,6 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - ".github/workflows/test.yml"
78
78
  - ".gitignore"
79
- - ".travis.yml"
80
79
  - Gemfile
81
80
  - LICENSE
82
81
  - README.md
@@ -96,24 +95,23 @@ metadata:
96
95
  documentation_uri: https://github.com/testingbot/testingbot_ruby
97
96
  homepage_uri: https://github.com/testingbot/testingbot_ruby
98
97
  source_code_uri: https://github.com/testingbot/testingbot_ruby
99
- post_install_message:
98
+ post_install_message:
100
99
  rdoc_options: []
101
100
  require_paths:
102
101
  - lib
103
102
  required_ruby_version: !ruby/object:Gem::Requirement
104
103
  requirements:
105
- - - "~>"
104
+ - - ">="
106
105
  - !ruby/object:Gem::Version
107
- version: '2.0'
106
+ version: '0'
108
107
  required_rubygems_version: !ruby/object:Gem::Requirement
109
108
  requirements:
110
109
  - - ">="
111
110
  - !ruby/object:Gem::Version
112
111
  version: '0'
113
112
  requirements: []
114
- rubyforge_project: testingbot
115
- rubygems_version: 2.7.10
116
- signing_key:
113
+ rubygems_version: 3.0.3.1
114
+ signing_key:
117
115
  specification_version: 4
118
116
  summary: Ruby API Gem to be used with testingbot.com
119
117
  test_files:
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