superbot-cloud 0.1.2 → 0.1.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: 6474827e46f3fda75cd8ba484cb27b98716c9808328e407d9ea2537099aac09d
4
- data.tar.gz: a0043c715428a6c261eaa58655cd2f281cd85705fea6775653f95a995ffa1b35
3
+ metadata.gz: 1ae988b6f7d3f14042272a8c07cd5099ca4b8122cb8336c7c3362ad07fdc9f6d
4
+ data.tar.gz: 5ec512314125dd22919a91c43845c0130627dbc9be46082e584b7fd9ced34cd8
5
5
  SHA512:
6
- metadata.gz: a52936c87c8ea7bc3f684e89a03dcd91c5c953fe1ce0ef4b868fd370fed11355a686ad4e1436201405cfdb8936023157e2c8097ce0dd3084276e524e63c94eb0
7
- data.tar.gz: 4a6b35802c08279bdd63bdbe2765b46a9c338314e0b3d86e55371daaaf66cf1db82b140f98256e41b5267f21e08f06de1246dd7eee60216619d99cccb7947e51
6
+ metadata.gz: 1371582b6206d569005f3851277acd698156094cfcc83cdd96188f8f67c6ccbed250c6c8a0a557f2b51b3164e9e0e180837399d7f661bf6e4ddd6c50af2c197c
7
+ data.tar.gz: b2941c4d8cfdfedc332e38eba76244f08c68164fe7e3aa7cd755f5a9bf175f898d09015f14359c1dda566ffb74e94c45b9c6bc3c1a1dd8f65c10dca0291453b4
data/Gemfile.lock CHANGED
@@ -2,16 +2,9 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  superbot-cloud (0.1.2)
5
- capybara (~> 3.6, >= 3.6.0)
6
- clamp (= 1.2.1)
7
- launchy (= 2.4.3)
8
5
  marcel (= 0.3.3)
9
6
  multipart-post (= 2.0.0)
10
- selenium-webdriver (~> 3.14, >= 3.14.0)
11
- sinatra (= 2.0.3)
12
- sinatra-silent (= 0.0.1)
13
- superbot (~> 0.1.2)
14
- zaru (= 0.2.0)
7
+ superbot (~> 0.1.4)
15
8
 
16
9
  GEM
17
10
  remote: https://rubygems.org/
@@ -19,19 +12,8 @@ GEM
19
12
  addressable (2.5.2)
20
13
  public_suffix (>= 2.0.2, < 4.0)
21
14
  ast (2.4.0)
22
- capybara (3.10.0)
23
- addressable
24
- mini_mime (>= 0.1.3)
25
- nokogiri (~> 1.8)
26
- rack (>= 1.6.0)
27
- rack-test (>= 0.6.3)
28
- regexp_parser (~> 1.2)
29
- xpath (~> 3.2)
30
- childprocess (0.9.0)
31
- ffi (~> 1.0, >= 1.0.11)
32
15
  clamp (1.2.1)
33
16
  diff-lcs (1.3)
34
- ffi (1.9.25)
35
17
  jaro_winkler (1.5.1)
36
18
  kommando (0.1.2)
37
19
  launchy (2.4.3)
@@ -39,12 +21,8 @@ GEM
39
21
  marcel (0.3.3)
40
22
  mimemagic (~> 0.3.2)
41
23
  mimemagic (0.3.2)
42
- mini_mime (1.0.1)
43
- mini_portile2 (2.3.0)
44
24
  multipart-post (2.0.0)
45
25
  mustermann (1.0.3)
46
- nokogiri (1.8.5)
47
- mini_portile2 (~> 2.3.0)
48
26
  parallel (1.12.1)
49
27
  parser (2.5.1.2)
50
28
  ast (~> 2.4.0)
@@ -53,11 +31,8 @@ GEM
53
31
  rack (2.0.5)
54
32
  rack-protection (2.0.3)
55
33
  rack
56
- rack-test (1.1.0)
57
- rack (>= 1.0, < 3)
58
34
  rainbow (3.0.0)
59
35
  rake (10.5.0)
60
- regexp_parser (1.2.0)
61
36
  rspec (3.8.0)
62
37
  rspec-core (~> 3.8.0)
63
38
  rspec-expectations (~> 3.8.0)
@@ -80,26 +55,21 @@ GEM
80
55
  ruby-progressbar (~> 1.7)
81
56
  unicode-display_width (~> 1.0, >= 1.0.1)
82
57
  ruby-progressbar (1.10.0)
83
- rubyzip (1.2.2)
84
- selenium-webdriver (3.14.1)
85
- childprocess (~> 0.5)
86
- rubyzip (~> 1.2, >= 1.2.2)
87
58
  sinatra (2.0.3)
88
59
  mustermann (~> 1.0)
89
60
  rack (~> 2.0)
90
61
  rack-protection (= 2.0.3)
91
62
  tilt (~> 2.0)
92
63
  sinatra-silent (0.0.1)
93
- superbot (0.1.3)
64
+ superbot (0.1.4)
94
65
  clamp (= 1.2.1)
66
+ kommando (~> 0.1)
95
67
  launchy (= 2.4.3)
96
68
  sinatra (= 2.0.3)
97
69
  sinatra-silent (= 0.0.1)
98
70
  zaru (= 0.2.0)
99
71
  tilt (2.0.8)
100
72
  unicode-display_width (1.4.0)
101
- xpath (3.2.0)
102
- nokogiri (~> 1.8)
103
73
  zaru (0.2.0)
104
74
 
105
75
  PLATFORMS
@@ -4,16 +4,9 @@ module Superbot
4
4
  module Cloud
5
5
  LOGIN_URI = 'http://www.superbot.cloud/login/cloud'
6
6
  CREDENTIALS_PATH = File.join(Dir.home, '.superbot')
7
+ private_constant :CREDENTIALS_PATH
7
8
  CREDENTIALS_FILE_PATH = File.join(CREDENTIALS_PATH, 'cloud_token.json')
8
- SCREENSHOTS_BASE_URL = {
9
- local: "http://localhost:3002/v1",
10
- remote: "http://peek.superbot.cloud/v1"
11
- }.freeze
12
- WEBDRIVER_URL = {
13
- local: "http://localhost:3000/webdriver/v1",
14
- remote: "http://webdriver.superbot.cloud:3000/webdriver/v1"
15
- }.freeze
16
- WEBDRIVER_TYPE = :remote # use :local if you are running superbot webdriver cluster locally
9
+ private_constant :CREDENTIALS_FILE_PATH
17
10
 
18
11
  def self.credentials
19
12
  return unless File.exist?(CREDENTIALS_FILE_PATH)
@@ -29,14 +22,6 @@ module Superbot
29
22
  puts message
30
23
  end
31
24
  end
32
-
33
- def self.webdriver_url
34
- WEBDRIVER_URL[WEBDRIVER_TYPE]
35
- end
36
-
37
- def self.screenshots_url(session_id)
38
- "#{SCREENSHOTS_BASE_URL[WEBDRIVER_TYPE]}/#{session_id}"
39
- end
40
25
  end
41
26
  end
42
27
 
@@ -5,7 +5,6 @@ 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/run_command'
9
8
 
10
9
  module Superbot
11
10
  module CLI
@@ -14,7 +13,6 @@ module Superbot
14
13
  subcommand ['login'], 'Login to superbot cloud', Cloud::LoginCommand
15
14
  subcommand ['org'], 'Manage your organizations', Cloud::OrganizationCommand
16
15
  subcommand ['test'], "Manage your tests", Cloud::TestCommand
17
- subcommand ['run'], "Run your test in the cloud", Cloud::RunCommand
18
16
 
19
17
  def self.run
20
18
  super
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Superbot
4
4
  module Cloud
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
@@ -34,15 +34,8 @@ Gem::Specification.new do |spec|
34
34
 
35
35
  spec.add_dependency "multipart-post", "2.0.0"
36
36
 
37
- spec.add_runtime_dependency "superbot", "~> 0.1.2"
38
- spec.add_runtime_dependency "clamp", "1.2.1"
39
- spec.add_runtime_dependency "zaru", "0.2.0"
40
- spec.add_runtime_dependency "sinatra", "2.0.3"
41
- spec.add_runtime_dependency "launchy", "2.4.3"
42
- spec.add_runtime_dependency "sinatra-silent", "0.0.1"
37
+ spec.add_runtime_dependency "superbot", "~> 0.1.4"
43
38
  spec.add_runtime_dependency "marcel", "0.3.3"
44
- spec.add_runtime_dependency 'selenium-webdriver', '~> 3.14', '>= 3.14.0'
45
- spec.add_runtime_dependency 'capybara', '~> 3.6', '>= 3.6.0'
46
39
 
47
40
  spec.add_development_dependency "kommando", "~> 0.1"
48
41
  spec.add_development_dependency "bundler", "~> 1.16"
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Superbots
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post
@@ -30,84 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.2
33
+ version: 0.1.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.2
41
- - !ruby/object:Gem::Dependency
42
- name: clamp
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 1.2.1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 1.2.1
55
- - !ruby/object:Gem::Dependency
56
- name: zaru
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 0.2.0
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '='
67
- - !ruby/object:Gem::Version
68
- version: 0.2.0
69
- - !ruby/object:Gem::Dependency
70
- name: sinatra
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 2.0.3
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 2.0.3
83
- - !ruby/object:Gem::Dependency
84
- name: launchy
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 2.4.3
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 2.4.3
97
- - !ruby/object:Gem::Dependency
98
- name: sinatra-silent
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '='
102
- - !ruby/object:Gem::Version
103
- version: 0.0.1
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 0.0.1
40
+ version: 0.1.4
111
41
  - !ruby/object:Gem::Dependency
112
42
  name: marcel
113
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,46 +52,6 @@ dependencies:
122
52
  - - '='
123
53
  - !ruby/object:Gem::Version
124
54
  version: 0.3.3
125
- - !ruby/object:Gem::Dependency
126
- name: selenium-webdriver
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '3.14'
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 3.14.0
135
- type: :runtime
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '3.14'
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: 3.14.0
145
- - !ruby/object:Gem::Dependency
146
- name: capybara
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '3.6'
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: 3.6.0
155
- type: :runtime
156
- prerelease: false
157
- version_requirements: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - "~>"
160
- - !ruby/object:Gem::Version
161
- version: '3.6'
162
- - - ">="
163
- - !ruby/object:Gem::Version
164
- version: 3.6.0
165
55
  - !ruby/object:Gem::Dependency
166
56
  name: kommando
167
57
  requirement: !ruby/object:Gem::Requirement
@@ -261,7 +151,6 @@ files:
261
151
  - lib/superbot/cloud/cli/cloud/login_command.rb
262
152
  - lib/superbot/cloud/cli/cloud/organization/list_command.rb
263
153
  - lib/superbot/cloud/cli/cloud/organization_command.rb
264
- - lib/superbot/cloud/cli/cloud/run_command.rb
265
154
  - lib/superbot/cloud/cli/cloud/test/delete_command.rb
266
155
  - lib/superbot/cloud/cli/cloud/test/list_command.rb
267
156
  - lib/superbot/cloud/cli/cloud/test/upload_command.rb
@@ -1,98 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "selenium/webdriver"
4
- require "capybara"
5
- require "capybara/dsl"
6
-
7
- module Superbot
8
- module CLI
9
- module Cloud
10
- class RunCommand < Clamp::Command
11
- include Superbot::Validations
12
-
13
- option ['--region'], 'REGION', 'Region for remote webdriver'
14
-
15
- parameter "PATH", "the path to folder containing tests to upload" do |path|
16
- validates_project_path path
17
- end
18
-
19
- def execute
20
- register_remote_webdriver
21
- open_screenshots_stream
22
- run_test
23
-
24
- puts 'Press ENTER to exit.'
25
- $stdin.gets
26
-
27
- close_screenshot_stream
28
- end
29
-
30
- private
31
-
32
- def register_remote_webdriver
33
- puts "Attaching to remote webdriver..."
34
-
35
- ::Capybara.register_driver :chrome_remote do |app|
36
- ::Capybara::Selenium::Driver.new(
37
- app,
38
- browser: :remote,
39
- desired_capabilities: webdriver_capabilities,
40
- http_client: webriver_http_client,
41
- url: Superbot::Cloud.webdriver_url
42
- )
43
- end
44
-
45
- ::Capybara.current_driver = :chrome_remote
46
- end
47
-
48
- def webdriver_capabilities
49
- ::Selenium::WebDriver::Remote::Capabilities.chrome(
50
- chromeOptions: {
51
- 'args' => [
52
- "--no-sandbox",
53
- "--disable-infobars",
54
- "--start-minimized",
55
- "--app=about:blank"
56
- ]
57
- },
58
- superOptions: region && { region: region } || {}
59
- )
60
- end
61
-
62
- def webriver_http_client
63
- ::Selenium::WebDriver::Remote::Http::Default.new.tap do |client|
64
- client.read_timeout = 2000
65
- client.open_timeout = 2000
66
- end
67
- end
68
-
69
- def open_screenshots_stream
70
- session_id = ::Capybara.current_session.driver.browser.send(:bridge).session_id
71
- puts "Opening test stream..."
72
- screenshots_url = Superbot::Cloud.screenshots_url(session_id)
73
- options = ::Selenium::WebDriver::Chrome::Options.new
74
- options.add_argument("app=#{screenshots_url}")
75
- @screenshots_stream = ::Selenium::WebDriver.for(:chrome, options: options)
76
- rescue ::Selenium::WebDriver::Error::ServerError => e
77
- abort "Remote webdriver error: #{e.message}"
78
- end
79
-
80
- def close_screenshot_stream
81
- @screenshots_stream&.quit
82
- end
83
-
84
- def run_test
85
- puts "Running test..."
86
- ::Capybara.send(:eval, test_script)
87
- puts "Succeed!"
88
- rescue ::Capybara::CapybaraError => e
89
- puts "Test failed!", e.message
90
- end
91
-
92
- def test_script
93
- @test_script ||= File.read(File.join(path, 'main.rb'))
94
- end
95
- end
96
- end
97
- end
98
- end