eyes_selenium 3.1.1 → 3.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e037337acd0f2a41bc0e035c240f932356872ec6
|
4
|
+
data.tar.gz: d0c6c9b63cd2deda518b9de3f692c1e7fdf2e0d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68472b7e43372a9cd06239024ea150d7929a043352e9b02e2da663fafca71c1b45238766fc323cedf48a8b3917eeb8cf79ca674eb17cccb09347337384a72b7a
|
7
|
+
data.tar.gz: c9289c73be9483f507079909d3154fa160e1eb4be0683ce88b9ef83c4b1b40362f312dbcda3a593f3e6811077a7e0c5a24fb3a088bf1e0f54202b264a5880ccd
|
@@ -6,8 +6,10 @@ module Applitools::Selenium
|
|
6
6
|
|
7
7
|
attr_accessor :last_state_position
|
8
8
|
|
9
|
-
def initialize(executor)
|
9
|
+
def initialize(executor, disable_horizontal = false, disable_vertical = false)
|
10
10
|
self.executor = executor
|
11
|
+
self.disable_horizontal = disable_horizontal
|
12
|
+
self.disable_vertical = disable_vertical
|
11
13
|
end
|
12
14
|
|
13
15
|
def current_position
|
@@ -45,14 +47,17 @@ module Applitools::Selenium
|
|
45
47
|
alias scroll_to position=
|
46
48
|
|
47
49
|
def entire_size
|
50
|
+
viewport_size = Applitools::Utils::EyesSeleniumUtils.extract_viewport_size(executor)
|
48
51
|
e_size = Applitools::Utils::EyesSeleniumUtils.current_frame_content_entire_size(executor)
|
49
52
|
logger.info "Entire size: #{e_size}"
|
53
|
+
e_size.width = viewport_size.width if disable_horizontal
|
54
|
+
e_size.height = viewport_size.height if disable_vertical
|
50
55
|
e_size
|
51
56
|
end
|
52
57
|
|
53
58
|
private
|
54
59
|
|
55
|
-
attr_accessor :executor
|
60
|
+
attr_accessor :executor, :disable_horizontal, :disable_vertical
|
56
61
|
|
57
62
|
def get_position_from_transform(transform)
|
58
63
|
regexp = /^translate\(\s*(\-?)(\d+)px,\s*(\-?)(\d+)px\s*\)/
|
@@ -73,7 +73,8 @@ module Applitools::Selenium
|
|
73
73
|
# @return [boolean] stitch_mode (:CSS or :SCROLL)
|
74
74
|
|
75
75
|
attr_accessor :base_agent_id, :screenshot, :force_full_page_screenshot, :hide_scrollbars,
|
76
|
-
:wait_before_screenshots, :debug_screenshot, :stitch_mode
|
76
|
+
:wait_before_screenshots, :debug_screenshot, :stitch_mode, :disable_horizontal_scrolling,
|
77
|
+
:disable_vertical_scrolling
|
77
78
|
attr_reader :driver
|
78
79
|
|
79
80
|
def_delegators 'Applitools::EyesLogger', :logger, :log_handler, :log_handler=
|
@@ -94,6 +95,8 @@ module Applitools::Selenium
|
|
94
95
|
self.wait_before_screenshots = DEFAULT_WAIT_BEFORE_SCREENSHOTS
|
95
96
|
self.region_visibility_strategy = MoveToRegionVisibilityStrategy.new
|
96
97
|
self.debug_screenshot = false
|
98
|
+
self.disable_horizontal_scrolling = false
|
99
|
+
self.disable_vertical_scrolling = false
|
97
100
|
end
|
98
101
|
|
99
102
|
# Starts a test
|
@@ -136,7 +139,9 @@ module Applitools::Selenium
|
|
136
139
|
|
137
140
|
self.device_pixel_ratio = UNKNOWN_DEVICE_PIXEL_RATIO
|
138
141
|
|
139
|
-
self.position_provider = self.class.position_provider(
|
142
|
+
self.position_provider = self.class.position_provider(
|
143
|
+
stitch_mode, driver, disable_horizontal_scrolling, disable_vertical_scrolling
|
144
|
+
)
|
140
145
|
|
141
146
|
self.eyes_screenshot_factory = lambda do |image|
|
142
147
|
Applitools::Selenium::EyesWebDriverScreenshot.new(
|
@@ -150,7 +155,11 @@ module Applitools::Selenium
|
|
150
155
|
|
151
156
|
def stitch_mode=(value)
|
152
157
|
@stitch_mode = value.to_s.upcase == STICH_MODE[:css].to_s ? STICH_MODE[:css] : STICH_MODE[:scroll]
|
153
|
-
|
158
|
+
unless driver.nil?
|
159
|
+
self.position_provider = self.class.position_provider(
|
160
|
+
stitch_mode, driver, disable_horizontal_scrolling, disable_vertical_scrolling
|
161
|
+
)
|
162
|
+
end
|
154
163
|
if stitch_mode == STICH_MODE[:css]
|
155
164
|
@css_transition_original_hide_scrollbars = hide_scrollbars
|
156
165
|
self.hide_scrollbars = true
|
@@ -909,12 +918,12 @@ module Applitools::Selenium
|
|
909
918
|
end
|
910
919
|
|
911
920
|
class << self
|
912
|
-
def position_provider(stitch_mode, driver)
|
921
|
+
def position_provider(stitch_mode, driver, disable_horizontal = false, disable_vertical = false)
|
913
922
|
case stitch_mode
|
914
923
|
when :SCROLL
|
915
|
-
Applitools::Selenium::ScrollPositionProvider.new(driver)
|
924
|
+
Applitools::Selenium::ScrollPositionProvider.new(driver, disable_horizontal, disable_vertical)
|
916
925
|
when :CSS
|
917
|
-
Applitools::Selenium::CssTranslatePositionProvider.new(driver)
|
926
|
+
Applitools::Selenium::CssTranslatePositionProvider.new(driver, disable_horizontal, disable_vertical)
|
918
927
|
end
|
919
928
|
end
|
920
929
|
end
|
@@ -5,8 +5,10 @@ module Applitools::Selenium
|
|
5
5
|
|
6
6
|
def_delegators 'Applitools::EyesLogger', :logger, :log_handler, :log_handler=
|
7
7
|
|
8
|
-
def initialize(executor)
|
8
|
+
def initialize(executor, disable_horizontal = false, disable_vertical = false)
|
9
9
|
self.executor = executor
|
10
|
+
self.disable_horizontal = disable_horizontal
|
11
|
+
self.disable_vertical = disable_vertical
|
10
12
|
end
|
11
13
|
|
12
14
|
# The scroll position of the current frame
|
@@ -36,8 +38,11 @@ module Applitools::Selenium
|
|
36
38
|
alias scroll_to position=
|
37
39
|
|
38
40
|
def entire_size
|
41
|
+
viewport_size = Applitools::Utils::EyesSeleniumUtils.extract_viewport_size(executor)
|
39
42
|
result = Applitools::Utils::EyesSeleniumUtils.entire_page_size(executor)
|
40
43
|
logger.info "Entire size: #{result}"
|
44
|
+
result.width = viewport_size.width if disable_horizontal
|
45
|
+
result.height = viewport_size.height if disable_vertical
|
41
46
|
result
|
42
47
|
end
|
43
48
|
|
@@ -47,6 +52,6 @@ module Applitools::Selenium
|
|
47
52
|
|
48
53
|
private
|
49
54
|
|
50
|
-
attr_accessor :executor
|
55
|
+
attr_accessor :executor, :disable_horizontal, :disable_vertical
|
51
56
|
end
|
52
57
|
end
|
data/lib/applitools/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eyes_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: 3.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: 3.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|