eyes_selenium 1.6.0 → 1.7.0
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.
- data/README.md +1 -1
- data/lib/eyes_selenium/eyes/driver.rb +1 -2
- data/lib/eyes_selenium/eyes/eyes.rb +6 -3
- data/lib/eyes_selenium/eyes_logger.rb +24 -7
- data/lib/eyes_selenium/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -25,12 +25,11 @@ class Applitools::Driver
|
|
25
25
|
browser_obj = options.delete(:browser) || DEFAULT_DRIVER
|
26
26
|
@browser ||= case browser_obj
|
27
27
|
when Symbol
|
28
|
+
at_exit { quit rescue nil }
|
28
29
|
Selenium::WebDriver.for browser_obj
|
29
30
|
else
|
30
31
|
browser_obj
|
31
32
|
end
|
32
|
-
# TODO Remove this if all is good. We don't want to call 'quit' everytime the object is destroyed, we might still want to use the underlying driver
|
33
|
-
#at_exit { quit rescue nil }
|
34
33
|
|
35
34
|
@user_inputs = []
|
36
35
|
@remote_server_url = address_of_remote_server
|
@@ -4,6 +4,10 @@ class Applitools::Eyes
|
|
4
4
|
|
5
5
|
class << self
|
6
6
|
attr_accessor :config
|
7
|
+
|
8
|
+
def log_handler=(handler)
|
9
|
+
EyesLogger.log_handler = handler
|
10
|
+
end
|
7
11
|
end
|
8
12
|
|
9
13
|
@config = {
|
@@ -26,7 +30,6 @@ class Applitools::Eyes
|
|
26
30
|
|
27
31
|
@disabled = params[:disabled]
|
28
32
|
|
29
|
-
@driver = create_driver(params)
|
30
33
|
return if disabled?
|
31
34
|
|
32
35
|
@agent_connector = Applitools::AgentConnector.new(config[:server_url], config[:user], config[:apikey])
|
@@ -39,6 +42,7 @@ class Applitools::Eyes
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def open(params={})
|
45
|
+
@driver = create_driver(params)
|
42
46
|
return driver if disabled?
|
43
47
|
|
44
48
|
if open?
|
@@ -73,7 +77,7 @@ class Applitools::Eyes
|
|
73
77
|
if !as_expected
|
74
78
|
self.should_match_window_run_once_on_timeout = true
|
75
79
|
if !session.new_session?
|
76
|
-
|
80
|
+
EyesLogger.info %( "mismatch #{ tag ? "" : "(#{tag})" } )
|
77
81
|
if failure_reports.to_i == Applitools::FailureReports::IMMEDIATE
|
78
82
|
raise Applitools::TestFailedError.new("Mismatch found in '#{start_info.scenario_id_or_name}'"\
|
79
83
|
" of '#{start_info.app_id_or_name}'")
|
@@ -125,7 +129,6 @@ class Applitools::Eyes
|
|
125
129
|
rescue Applitools::EyesError
|
126
130
|
ensure
|
127
131
|
abort_if_not_closed
|
128
|
-
driver.quit
|
129
132
|
end
|
130
133
|
end
|
131
134
|
|
@@ -1,18 +1,35 @@
|
|
1
1
|
require 'logger'
|
2
2
|
|
3
3
|
module EyesLogger
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
|
5
|
+
class NullLogger
|
6
|
+
attr_accessor :level
|
7
|
+
|
8
|
+
def info(msg)
|
9
|
+
# do nothing
|
10
|
+
end
|
11
|
+
def debug(msg)
|
12
|
+
#do nothing
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
NULL_LOGGER = NullLogger.new
|
17
|
+
|
18
|
+
@@log_handler = NULL_LOGGER
|
19
|
+
|
20
|
+
def self.log_handler=(log_handler)
|
21
|
+
if !log_handler.respond_to?(:info) || !log_handler.respond_to?(:debug)
|
22
|
+
raise Applitools::EyesError.new('log handler must respond to "info" and "debug"!')
|
23
|
+
end
|
24
|
+
@@log_handler = log_handler
|
9
25
|
end
|
10
26
|
|
11
27
|
def self.info(msg)
|
12
|
-
|
28
|
+
@@log_handler.info(msg)
|
13
29
|
end
|
14
30
|
|
15
31
|
def self.debug(msg)
|
16
|
-
|
32
|
+
@@log_handler.debug(msg)
|
17
33
|
end
|
34
|
+
|
18
35
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -21,7 +21,7 @@ end
|
|
21
21
|
def init_eyes
|
22
22
|
before(:all) do
|
23
23
|
Applitools::Eyes.config[:apikey] = 'YOUR_API_KEY'
|
24
|
-
Applitools::Eyes.config[:server_url] = 'http://
|
24
|
+
Applitools::Eyes.config[:server_url] = 'http://eyes.applitools.com'
|
25
25
|
end
|
26
26
|
let!(:eyes) do
|
27
27
|
Applitools::Eyes.new
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
@@ -202,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
segments:
|
204
204
|
- 0
|
205
|
-
hash:
|
205
|
+
hash: -1833114255921189206
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
segments:
|
213
213
|
- 0
|
214
|
-
hash:
|
214
|
+
hash: -1833114255921189206
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project:
|
217
217
|
rubygems_version: 1.8.25
|