saucer 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saucer/config/common.rb +2 -1
- data/lib/saucer/config/selenium.rb +10 -6
- data/lib/saucer/driver.rb +6 -2
- data/lib/saucer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2dbf2b0339d94beec378bedf4fb5fff20c07ccf
|
4
|
+
data.tar.gz: 73e0fe1bdd5e8fb93f25dc06505073ccec501347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7f46751be467415cea49ebcb1b0251ccb5e5d55c107804da909caf3204242a8ea2e2bc030180ba1ff3f606c0b83c6fa6e9e4b9ff8bea04a8a5ce72bb2db510
|
7
|
+
data.tar.gz: 8b59759a69338cd7fef28f71408ba78990d13e913ed947e4e23938b192c6b8d0daedcec44a49eb709838ef3df5ce8694ad42772589e1c29d1c2fcbde7b8e98bf
|
data/lib/saucer/config/common.rb
CHANGED
@@ -8,11 +8,12 @@ module Saucer
|
|
8
8
|
avoid_proxy public record_video video_upload_on_pass record_screenshots
|
9
9
|
record_logs capture_html priority webdriver_remote_quiet_exceptions).freeze
|
10
10
|
|
11
|
-
attr_reader :config_params, :username, :access_key
|
11
|
+
attr_reader :config_params, :username, :access_key, :url
|
12
12
|
|
13
13
|
def initialize(opts = {})
|
14
14
|
@username = opts.delete(:username) || ENV['SAUCE_USERNAME']
|
15
15
|
@access_key = opts.delete(:access_key) || ENV['SAUCE_ACCESS_KEY']
|
16
|
+
@url = opts.delete(:url) || "https://#{@username}:#{@access_key}@ondemand.saucelabs.com:443/wd/hub"
|
16
17
|
|
17
18
|
@opts = opts
|
18
19
|
@config_params = CONFIG_PARAMS
|
@@ -17,15 +17,19 @@ module Saucer
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def capabilities
|
20
|
-
caps = @
|
21
|
-
|
22
|
-
|
20
|
+
caps = @opts[:desired_capabilities]
|
21
|
+
caps ||= begin
|
22
|
+
caps = @config_params.each_with_object({}) do |param, hash|
|
23
|
+
hash[param] = @opts[param] if @opts.key?(param)
|
24
|
+
hash[param] ||= ENV[param.to_s] if ENV[param.to_s]
|
25
|
+
end
|
26
|
+
browser_name = @opts[:browser_name] || :chrome
|
27
|
+
::Selenium::WebDriver::Remote::Capabilities.send(browser_name, caps)
|
23
28
|
end
|
24
|
-
@sauce = Sauce.new.to_hash
|
25
29
|
|
30
|
+
@sauce = Sauce.new.to_hash
|
26
31
|
caps[:"sauce:data"] = @sauce.to_hash
|
27
|
-
|
28
|
-
::Selenium::WebDriver::Remote::Capabilities.send(browser_name, caps)
|
32
|
+
caps
|
29
33
|
end
|
30
34
|
end
|
31
35
|
|
data/lib/saucer/driver.rb
CHANGED
@@ -4,8 +4,12 @@ module Saucer
|
|
4
4
|
attr_reader :driver, :config
|
5
5
|
|
6
6
|
def initialize(opt = {})
|
7
|
-
|
8
|
-
|
7
|
+
unless opt[:desired_capabilities].is_a? Selenium::WebDriver::Remote::Capabilities
|
8
|
+
opts = opt[:desired_capabilities] || {}
|
9
|
+
browser = opt.key?(:browser_name) ? opt[:browser_name].downcase.to_sym : :chrome
|
10
|
+
opt[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.send(browser, opts)
|
11
|
+
end
|
12
|
+
@config = Config::Selenium.new(opt)
|
9
13
|
|
10
14
|
opt[:url] = @config.url
|
11
15
|
opt[:desired_capabilities] = @config.capabilities
|
data/lib/saucer/version.rb
CHANGED