eyes_selenium 2.27.0 → 2.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/eyes.rb +11 -3
- data/lib/applitools/version.rb +1 -1
- data/lib/eyes_selenium.rb +2 -2
- data/test/test_script.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd372027171990f6c9d885f7a7e00f65a0899d31
|
4
|
+
data.tar.gz: f93869d827f4cf50963cf7148cf63cc9df762b09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bf6b04cf2138f1714dd20d4720fe23d19dc311a9bbe24593c04263317063d298cf83771917354505870034f1fbea4430eb56944d96658ecc3dfeec0f7e7f32d
|
7
|
+
data.tar.gz: 345cfaffd6a3c34f9d64de2cb07f878dd190034f07438c4250e0bc0a1fd3291d4b55a07fb033f84a94a467a9d2ab038cfdccc5c1cc3d5a1d6a69a26b78b0186f
|
data/lib/applitools/eyes.rb
CHANGED
@@ -195,15 +195,23 @@ class Applitools::Eyes
|
|
195
195
|
Applitools::EyesLogger.debug 'Done!'
|
196
196
|
end
|
197
197
|
|
198
|
-
|
199
|
-
|
198
|
+
if how == :element
|
199
|
+
Applitools::EyesLogger.debug 'Element given as an argument...'
|
200
|
+
raise Applitools::EyesError.new('Element does not exist') if what.nil?
|
201
|
+
element_to_check = what
|
202
|
+
else
|
203
|
+
Applitools::EyesLogger.debug 'Finding element...'
|
204
|
+
element_to_check = driver.find_element(how, what)
|
205
|
+
end
|
206
|
+
|
200
207
|
Applitools::EyesLogger.debug 'Done! Getting element location...'
|
201
208
|
location = element_to_check.location
|
202
209
|
Applitools::EyesLogger.debug 'Done! Getting element size...'
|
203
210
|
size = element_to_check.size
|
211
|
+
raise Applitools::EyesError.new("Invalid region size: #{size}") if size.width <= 0 || size.height <= 0
|
204
212
|
Applitools::EyesLogger.debug 'Done! Creating region...'
|
205
213
|
region = Applitools::Base::Region.new(location.x, location.y, size.width, size.height)
|
206
|
-
Applitools::EyesLogger.debug
|
214
|
+
Applitools::EyesLogger.debug "Done! Checking region... #{region}"
|
207
215
|
check_region_(region, tag, specific_timeout)
|
208
216
|
Applitools::EyesLogger.debug 'Done!'
|
209
217
|
end
|
data/lib/applitools/version.rb
CHANGED
data/lib/eyes_selenium.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Applitools
|
2
2
|
ROOT_DIR = File.join(File.dirname(File.expand_path(__FILE__)), 'applitools').freeze
|
3
3
|
|
4
|
-
Dir["#{ROOT_DIR}/*.rb"].each { |f| require f }
|
5
|
-
Dir["#{ROOT_DIR}/**/*.rb"].each { |f| require f }
|
4
|
+
Dir["#{ROOT_DIR}/*.rb"].sort.each { |f| require f }
|
5
|
+
Dir["#{ROOT_DIR}/**/*.rb"].sort.each { |f| require f }
|
6
6
|
|
7
7
|
class EyesError < StandardError; end
|
8
8
|
class EyesAbort < EyesError; end
|
data/test/test_script.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require_relative '../lib/eyes_selenium'
|
2
2
|
|
3
3
|
require 'logger'
|
4
|
+
require 'openssl'
|
5
|
+
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
4
6
|
|
5
7
|
eyes = Applitools::Eyes.new
|
6
8
|
eyes.api_key = ENV['APPLITOOLS_API_KEY']
|
7
9
|
eyes.log_handler = Logger.new(STDOUT)
|
8
|
-
|
10
|
+
# eyes.set_proxy('https://localhost:8888')
|
9
11
|
begin
|
10
12
|
web_driver = Selenium::WebDriver.for :chrome
|
11
13
|
|
@@ -13,9 +15,8 @@ begin
|
|
13
15
|
driver: web_driver) do |driver|
|
14
16
|
driver.get 'http://www.applitools.com'
|
15
17
|
eyes.check_window('initial')
|
16
|
-
|
17
|
-
|
18
|
-
eyes.check_window('pricing page')
|
18
|
+
pricing = driver.find_element(:css, '.pricing a')
|
19
|
+
eyes.check_region(:element, pricing, 'pricing element')
|
19
20
|
end
|
20
21
|
ensure
|
21
22
|
web_driver.quit
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|