superbot-cloud 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -4
- data/lib/superbot/cloud/api.rb +8 -7
- data/lib/superbot/cloud/cli/cloud/webdriver/delete_command.rb +31 -0
- data/lib/superbot/cloud/cli/cloud/webdriver/list_command.rb +30 -0
- data/lib/superbot/cloud/cli/cloud/webdriver_command.rb +22 -0
- data/lib/superbot/cloud/cli/cloud_command.rb +2 -0
- data/lib/superbot/cloud/version.rb +1 -1
- data/superbot-cloud.gemspec +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d1b40002f08217e0ca4388dd5dd84e00035aabc76ac16d47fa318d96ae23770
|
4
|
+
data.tar.gz: 6d5b75d177154480ee22ef295b1de8c86f8fd19a028db382e7854d2df5d62fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50da0fead65be52a49954d90ded6b9d997aa21cb1bd7e43a2127ca62d5a64cec6d889524d267367a81d20b14d3b0a7ca891c14b1b4e0c447e94502bb4f99448
|
7
|
+
data.tar.gz: 8392a6b5fa3f880bb0495b89e779cdbe625befb32eb5c1e648e8f2d3c2987e3addc4921cfbf7a632647a8d7cfb0a681503e2e5f22020bef71dde21d3d7698eac
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbot-cloud (0.1.
|
4
|
+
superbot-cloud (0.1.15)
|
5
5
|
marcel (= 0.3.3)
|
6
6
|
multipart-post (= 2.0.0)
|
7
7
|
|
@@ -11,8 +11,11 @@ GEM
|
|
11
11
|
addressable (2.5.2)
|
12
12
|
public_suffix (>= 2.0.2, < 4.0)
|
13
13
|
ast (2.4.0)
|
14
|
+
childprocess (0.9.0)
|
15
|
+
ffi (~> 1.0, >= 1.0.11)
|
14
16
|
clamp (1.2.1)
|
15
17
|
diff-lcs (1.3)
|
18
|
+
ffi (1.9.25)
|
16
19
|
jaro_winkler (1.5.1)
|
17
20
|
kommando (0.1.2)
|
18
21
|
launchy (2.4.3)
|
@@ -54,19 +57,24 @@ GEM
|
|
54
57
|
ruby-progressbar (~> 1.7)
|
55
58
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
56
59
|
ruby-progressbar (1.10.0)
|
60
|
+
rubyzip (1.2.2)
|
61
|
+
selenium-webdriver (3.141.0)
|
62
|
+
childprocess (~> 0.5)
|
63
|
+
rubyzip (~> 1.2, >= 1.2.2)
|
57
64
|
sinatra (2.0.3)
|
58
65
|
mustermann (~> 1.0)
|
59
66
|
rack (~> 2.0)
|
60
67
|
rack-protection (= 2.0.3)
|
61
68
|
tilt (~> 2.0)
|
62
69
|
sinatra-silent (0.0.1)
|
63
|
-
superbot (0.1.
|
70
|
+
superbot (0.1.20)
|
64
71
|
clamp (= 1.2.1)
|
65
72
|
kommando (~> 0.1)
|
66
73
|
launchy (= 2.4.3)
|
74
|
+
selenium-webdriver (~> 3.14, >= 3.14.0)
|
67
75
|
sinatra (= 2.0.3)
|
68
76
|
sinatra-silent (= 0.0.1)
|
69
|
-
superbot-cloud (~> 0.1.
|
77
|
+
superbot-cloud (~> 0.1.14)
|
70
78
|
zaru (= 0.2.0)
|
71
79
|
tilt (2.0.8)
|
72
80
|
unicode-display_width (1.4.0)
|
@@ -80,7 +88,7 @@ DEPENDENCIES
|
|
80
88
|
rake (~> 10.0)
|
81
89
|
rspec (~> 3.0)
|
82
90
|
rubocop (~> 0.53)
|
83
|
-
superbot (~> 0.1.
|
91
|
+
superbot (~> 0.1.20)
|
84
92
|
superbot-cloud!
|
85
93
|
|
86
94
|
BUNDLED WITH
|
data/lib/superbot/cloud/api.rb
CHANGED
@@ -7,12 +7,14 @@ module Superbot
|
|
7
7
|
module Api
|
8
8
|
BASE_URI = "#{Superbot::URI_SCHEME}://#{Superbot::DOMAIN}/api/v1"
|
9
9
|
ENDPOINT_MAP = {
|
10
|
-
login:
|
11
|
-
token:
|
12
|
-
organization_list:
|
13
|
-
test_list:
|
14
|
-
test_upload:
|
15
|
-
delete_test:
|
10
|
+
login: { method: :post, endpoint: 'sessions' },
|
11
|
+
token: { method: :post, endpoint: 'token' },
|
12
|
+
organization_list: { method: :get, endpoint: 'organizations' },
|
13
|
+
test_list: { method: :get, endpoint: 'tests' },
|
14
|
+
test_upload: { method: :post_multipart, endpoint: 'tests' },
|
15
|
+
delete_test: { method: :delete, endpoint: 'tests', required_param: :name },
|
16
|
+
webdriver_session_list: { method: :get, endpoint: 'webdriver_sessions' },
|
17
|
+
delete_webdriver_session: { method: :delete, endpoint: 'webdriver_sessions', required_param: :session_id }
|
16
18
|
}.freeze
|
17
19
|
|
18
20
|
def self.request(type, params: {})
|
@@ -31,7 +33,6 @@ module Superbot
|
|
31
33
|
end
|
32
34
|
|
33
35
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
34
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
35
36
|
http.request(req)
|
36
37
|
end
|
37
38
|
parsed_response = response.class.body_permitted? && JSON.parse(response.body, symbolize_names: true) || {}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Superbot
|
4
|
+
module CLI
|
5
|
+
module Cloud
|
6
|
+
module Webdriver
|
7
|
+
class DeleteCommand < Clamp::Command
|
8
|
+
include Superbot::Cloud::Validations
|
9
|
+
|
10
|
+
parameter "SESSION_ID", "webdriver session ID", required: true
|
11
|
+
|
12
|
+
def execute
|
13
|
+
require_login
|
14
|
+
delete_session
|
15
|
+
end
|
16
|
+
|
17
|
+
def delete_session
|
18
|
+
Superbot::Cloud::Api.request(
|
19
|
+
:delete_webdriver_session,
|
20
|
+
params: {
|
21
|
+
session_id: session_id
|
22
|
+
}
|
23
|
+
)
|
24
|
+
|
25
|
+
puts "Webdriver session removal has been requested."
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Superbot
|
4
|
+
module CLI
|
5
|
+
module Cloud
|
6
|
+
module Webdriver
|
7
|
+
class ListCommand < Clamp::Command
|
8
|
+
include Superbot::Cloud::Validations
|
9
|
+
|
10
|
+
def execute
|
11
|
+
require_login
|
12
|
+
list_sessions
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_sessions
|
16
|
+
api_response = Superbot::Cloud::Api.request(:webdriver_session_list)
|
17
|
+
abort api_response[:error] if api_response[:error]
|
18
|
+
puts "Webdriver Sessions:"
|
19
|
+
headers = api_response[:webdriver_sessions].first&.keys
|
20
|
+
puts headers.map { |field| field.to_s.upcase.ljust(35) }.join
|
21
|
+
puts ''.ljust(35 * headers.length, '-')
|
22
|
+
api_response[:webdriver_sessions].each do |webdriver_session|
|
23
|
+
puts webdriver_session.values.map { |v| v.to_s.ljust(35) }.join
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'webdriver/list_command'
|
4
|
+
require_relative 'webdriver/delete_command'
|
5
|
+
|
6
|
+
module Superbot
|
7
|
+
module CLI
|
8
|
+
module Cloud
|
9
|
+
class WebdriverCommand < Clamp::Command
|
10
|
+
subcommand ['list'], "List all webdriver sessions", Cloud::Webdriver::ListCommand
|
11
|
+
subcommand ['delete'], "Terminate and finish specific session", Cloud::Webdriver::DeleteCommand
|
12
|
+
|
13
|
+
def self.run
|
14
|
+
super
|
15
|
+
rescue StandardError => exc
|
16
|
+
warn exc.message
|
17
|
+
warn exc.backtrace.join("\n")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,6 +5,7 @@ require_relative 'cloud/login_command'
|
|
5
5
|
require_relative 'cloud/version_command'
|
6
6
|
require_relative 'cloud/organization_command'
|
7
7
|
require_relative 'cloud/test_command'
|
8
|
+
require_relative 'cloud/webdriver_command'
|
8
9
|
|
9
10
|
module Superbot
|
10
11
|
module CLI
|
@@ -13,6 +14,7 @@ module Superbot
|
|
13
14
|
subcommand ['login'], 'Login to superbot cloud', Cloud::LoginCommand
|
14
15
|
subcommand(['org'], 'Manage your organizations', Cloud::OrganizationCommand)
|
15
16
|
subcommand ['test'], "Manage your tests", Cloud::TestCommand
|
17
|
+
subcommand ['webdriver'], "Manage your webdriver sessions", Cloud::WebdriverCommand
|
16
18
|
|
17
19
|
option ['-v', '--version'], :flag, "Show version information" do
|
18
20
|
puts Superbot::Cloud::VERSION
|
data/superbot-cloud.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_runtime_dependency "multipart-post", "2.0.0"
|
37
37
|
spec.add_runtime_dependency "marcel", "0.3.3"
|
38
38
|
|
39
|
-
spec.add_development_dependency "superbot", "~> 0.1.
|
39
|
+
spec.add_development_dependency "superbot", "~> 0.1.20"
|
40
40
|
spec.add_development_dependency "bundler", "~> 1.16"
|
41
41
|
spec.add_development_dependency "rake", "~> 10.0"
|
42
42
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Superbots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.20
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
54
|
+
version: 0.1.20
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +143,9 @@ files:
|
|
143
143
|
- lib/superbot/cloud/cli/cloud/test_command.rb
|
144
144
|
- lib/superbot/cloud/cli/cloud/validations.rb
|
145
145
|
- lib/superbot/cloud/cli/cloud/version_command.rb
|
146
|
+
- lib/superbot/cloud/cli/cloud/webdriver/delete_command.rb
|
147
|
+
- lib/superbot/cloud/cli/cloud/webdriver/list_command.rb
|
148
|
+
- lib/superbot/cloud/cli/cloud/webdriver_command.rb
|
146
149
|
- lib/superbot/cloud/cli/cloud_command.rb
|
147
150
|
- lib/superbot/cloud/cli/root_command.rb
|
148
151
|
- lib/superbot/cloud/version.rb
|