superbot 0.1.8 → 0.1.9
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/superbot/cli/root_command.rb +0 -1
- data/lib/superbot/cli/run_command.rb +1 -1
- data/lib/superbot/cli/teleport_command.rb +1 -1
- data/lib/superbot/version.rb +1 -1
- data/lib/superbot/web.rb +0 -12
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b92ae576ff82672508bbfe3d7620763df2fd2004a28f8da31a66d9ce1d470ea
|
|
4
|
+
data.tar.gz: 6e324743a0bbdbaa6f41cd31d70dabd9c67493dc8c034bc2f185a78103d4a3be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df458ef3f52997bf520e987d68ee07068c365add3bb19429928e0250d72e1fc048b7ecea68c78066248e11ffb9e0ae306ce291568d75b0ee408a5208395d6365
|
|
7
|
+
data.tar.gz: eb4a4e7e3358b4c03b56a0eec82467d1ab907a35bc3c70e98a0cbc187832dcaefafdf74055f29eecb6df77235c7468a8f12298f6bf2a24d9a5964ef2b73ef484
|
data/Gemfile.lock
CHANGED
|
@@ -11,7 +11,6 @@ module Superbot
|
|
|
11
11
|
banner "superbot 🤖"
|
|
12
12
|
|
|
13
13
|
subcommand ["new"], "Create a new project", NewCommand
|
|
14
|
-
subcommand ["run"], "Run a project", RunCommand
|
|
15
14
|
subcommand ["version"], "Show version information", VersionCommand
|
|
16
15
|
subcommand ["teleport"], "Open a teleport for superbots", TeleportCommand
|
|
17
16
|
|
|
@@ -9,7 +9,7 @@ module Superbot
|
|
|
9
9
|
validates_project_path path
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: '
|
|
12
|
+
option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: 'cloud' do |browser|
|
|
13
13
|
validates_browser_type browser
|
|
14
14
|
end
|
|
15
15
|
option ['--region'], 'REGION', 'Region for remote webdriver'
|
|
@@ -5,7 +5,7 @@ module Superbot
|
|
|
5
5
|
class TeleportCommand < Clamp::Command
|
|
6
6
|
include Superbot::Validations
|
|
7
7
|
|
|
8
|
-
option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: '
|
|
8
|
+
option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: 'cloud' do |browser|
|
|
9
9
|
validates_browser_type browser
|
|
10
10
|
end
|
|
11
11
|
option ['--region'], 'REGION', 'Region for remote webdriver'
|
data/lib/superbot/version.rb
CHANGED
data/lib/superbot/web.rb
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
require "sinatra/base"
|
|
4
4
|
require "sinatra/silent"
|
|
5
5
|
require 'net/http'
|
|
6
|
-
require 'selenium-webdriver'
|
|
7
6
|
|
|
8
7
|
require_relative "capybara/convert"
|
|
9
8
|
require_relative "capybara/runner"
|
|
@@ -61,17 +60,6 @@ module Superbot
|
|
|
61
60
|
)
|
|
62
61
|
status response.code
|
|
63
62
|
headers instance.all_headers(response)
|
|
64
|
-
|
|
65
|
-
if %w(cloud local_cloud).include?(webdriver_type) && verb == 'post' && request.path_info == '/wd/hub/session' && response.kind_of?(Net::HTTPSuccess)
|
|
66
|
-
session_id = JSON.parse(response.body)['sessionId']
|
|
67
|
-
|
|
68
|
-
puts "Opening screenshots stream..."
|
|
69
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
|
70
|
-
options.add_argument("app=#{Superbot.screenshots_url(webdriver_type, session_id)}")
|
|
71
|
-
options.add_argument('no-sandbox')
|
|
72
|
-
::Selenium::WebDriver.for :chrome, options: options
|
|
73
|
-
end
|
|
74
|
-
|
|
75
63
|
response.body
|
|
76
64
|
rescue
|
|
77
65
|
error_message = "Remote webdriver doesn't responding"
|