saucer 0.3.0 → 0.4.0

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
  SHA1:
3
- metadata.gz: 4a2c37e1cabccacc4e978ccea9531be62b2397bf
4
- data.tar.gz: 42780591f1c4b0a3a7f6f1972ff6e1f45417db14
3
+ metadata.gz: 0e168f7731c03d863f52a22e041e176da846368d
4
+ data.tar.gz: 997a371d47a26c67f401731ff34b4422051bfff0
5
5
  SHA512:
6
- metadata.gz: bd6dcb38eeb62ec7a203fc3e4725f8fd7e2f8d322637151df0b326fb9510444acf7edd9ad826da6a8f745336326a2294d11b5814a56426b9857d07f31f5c8c6c
7
- data.tar.gz: 743b759e3447cba6f4e3b81a8a34f797abd08f527ba79f2f4b954af21508842454577b951815e5eb339ff7ffdf883e5b6d198459d518a9cce7281aebafd68f71
6
+ metadata.gz: 3991811258564869643e4ba974e4939dbfe49034db9847907f263b849923f601db33b0242186b9f3f68f59f6a70b22b85239b0d44b46b6b654a4bd397e9331c0
7
+ data.tar.gz: e2380a77094d580b890591d3380317a73abd4697df82a980a545fc152fcbd9762b085f8fbf13305fe6c160a94aba7998c0b9f787647d7db145ef62e2ea478cff
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in saucer.gemspec
4
4
  gemspec
5
+
6
+ gem 'sauce_whisk', git: 'https://github.com/titusfortner/sauce_whisk'
data/lib/saucer/driver.rb CHANGED
@@ -1,28 +1,23 @@
1
1
  module Saucer
2
- class Driver < Selenium::WebDriver::Driver
3
-
4
- include Annotations
2
+ class Driver
5
3
 
6
4
  attr_reader :driver, :config
7
5
 
8
6
  def initialize(opt = {})
9
7
  caps = opt[:desired_capabilities] || {}
10
- @config ||= Config::Selenium.new(caps)
11
- listener = opt.delete :listener
8
+ @config = Config::Selenium.new(caps)
9
+
12
10
  opt[:url] = @config.url
13
11
  opt[:desired_capabilities] = @config.capabilities
14
12
 
15
- bridge = Selenium::WebDriver::Remote::Bridge.new(opt)
16
- bridge = Support::EventFiringBridge.new(bridge, listener) if listener
13
+ @driver = Selenium::WebDriver.for(:remote, opt)
17
14
 
18
- @driver = super bridge
19
-
20
- @driver.job_name = @config.sauce[:name]
21
- @driver.build_name = @config.sauce[:build]
15
+ sauce.job_name = @config.sauce[:name]
16
+ sauce.build_name = @config.sauce[:build]
22
17
  end
23
18
 
24
19
  def sauce
25
- @api ||= API.new(self, @config)
20
+ @sauce ||= Sauce.new(driver, @config)
26
21
  end
27
22
 
28
23
  def quit
@@ -35,15 +30,25 @@ module Saucer
35
30
  end
36
31
 
37
32
  if exception
38
- @driver.comment = "Error: #{exception.inspect}"
39
- @driver.comment = "Error Location: #{exception.backtrace.first}"
33
+ sauce.comment = "Error: #{exception.inspect}"
34
+ sauce.comment = "Error Location: #{exception.backtrace.first}"
40
35
  end
41
36
 
42
- @driver.job_result = result unless result.nil?
43
- results = @driver.sauce.job.log_url[/(.*)\/.*$/, 1]
37
+ sauce.job_result = result unless result.nil?
38
+ results = sauce.api.job.log_url[/(.*)\/.*$/, 1]
44
39
  Selenium::WebDriver.logger.warn("Sauce Labs results: #{results}")
45
40
 
46
- super(*[])
41
+ driver.quit
42
+ end
43
+
44
+ def method_missing(method_name, *arguments, &block)
45
+ if driver.respond_to? method_name
46
+ driver.send(method_name, *arguments, &block)
47
+ end
48
+ end
49
+
50
+ def respond_to?(method_name, include_private = false)
51
+ driver.respond_to?(method_name)
47
52
  end
48
53
 
49
54
  end
@@ -0,0 +1,22 @@
1
+ require 'sauce_whisk'
2
+
3
+ module Saucer
4
+ class Sauce
5
+
6
+ include Annotations
7
+
8
+ def initialize(driver, config)
9
+ @driver = driver
10
+ @config = config
11
+ end
12
+
13
+ def api
14
+ @api ||= API.new(@driver, @config)
15
+ end
16
+
17
+ def driver
18
+ @driver
19
+ end
20
+
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Saucer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/saucer.gemspec CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.add_dependency 'parallel_split_test'
38
38
  spec.add_dependency 'require_all'
39
- spec.add_dependency 'selenium-webdriver', "~> 3.0", "< 3.4.1"
39
+ spec.add_dependency 'selenium-webdriver', "~> 3.0", "< 3.4.3"
40
40
  spec.add_dependency 'sauce_whisk'
41
41
  spec.add_dependency 'sauce_platforms'
42
42
  spec.add_dependency 'json'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '3.0'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: 3.4.1
92
+ version: 3.4.3
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '3.0'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: 3.4.1
102
+ version: 3.4.3
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: sauce_whisk
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -165,6 +165,7 @@ files:
165
165
  - lib/saucer/driver.rb
166
166
  - lib/saucer/parallel.rb
167
167
  - lib/saucer/platform_configuration.rb
168
+ - lib/saucer/sauce.rb
168
169
  - lib/saucer/version.rb
169
170
  - saucer.gemspec
170
171
  homepage: http://github.com/titusfortner/saucer