@@ -119,12 +119,12 @@ def session_url(path)
119119 end
120120
121121 it "allows the page to be scrolled" do
122- @session . visit ( "/cuprite/long_page " )
123- @driver . resize ( 10 , 10 )
124- @driver . scroll_to ( 200 , 100 )
122+ @session . visit ( "/cuprite/scroll_long_page " )
123+ @driver . scroll_to ( 200 , 500 )
124+
125125 expect (
126126 @driver . evaluate_script ( "[window.scrollX, window.scrollY]" )
127- ) . to eq ( [ 200 , 100 ] )
127+ ) . to eq ( [ 200 , 500 ] )
128128 end
129129
130130 it "supports specifying viewport size with an option" do
@@ -154,7 +154,7 @@ def session_url(path)
154154 create_screenshot file , full : true
155155 File . open ( file , "rb" ) do |f |
156156 expect ( ImageSize . new ( f . read ) . size ) . to eq (
157- @driver . evaluate_script ( "[document.documentElement.clientWidth , document.documentElement.clientHeight ]" )
157+ @driver . evaluate_script ( "[document.documentElement.scrollWidth , document.documentElement.scrollHeight ]" )
158158 )
159159 end
160160 end
@@ -195,7 +195,7 @@ def session_url(path)
195195
196196 File . open ( file , "rb" ) do |f |
197197 expect ( ImageSize . new ( f . read ) . size ) . to eq (
198- @driver . evaluate_script ( "[document.documentElement.clientWidth , document.documentElement.clientHeight ]" )
198+ @driver . evaluate_script ( "[document.documentElement.scrollWidth , document.documentElement.scrollHeight ]" )
199199 )
200200 end
201201 end
@@ -763,8 +763,7 @@ def create_screenshot(file, *args)
763763 resources_size = {
764764 %r{/cuprite/jquery.min.js$} => File . size ( "#{ CUPRITE_ROOT } /spec/support/public/jquery-1.11.3.min.js" ) ,
765765 %r{/cuprite/jquery-ui.min.js$} => File . size ( "#{ CUPRITE_ROOT } /spec/support/public/jquery-ui-1.11.4.min.js" ) ,
766- %r{/cuprite/test.js$} => File . size ( "#{ CUPRITE_ROOT } /spec/support/public/test.js" ) ,
767- %r{/cuprite/with_js$} => 2405
766+ %r{/cuprite/test.js$} => File . size ( "#{ CUPRITE_ROOT } /spec/support/public/test.js" )
768767 }
769768
770769 resources_size . each do |resource , size |
@@ -927,7 +926,7 @@ def create_screenshot(file, *args)
927926 it "allows the driver to have a custom host" do
928927 # Use custom host "pointing" to localhost, specified by BROWSER_TEST_HOST env var.
929928 # Use /etc/hosts or iptables for this: https://superuser.com/questions/516208/how-to-change-ip-address-to-point-to-localhost
930- host = ENV [ "BROWSER_TEST_HOST" ]
929+ host = ENV . fetch ( "BROWSER_TEST_HOST" , nil )
931930
932931 skip "BROWSER_TEST_HOST not set" if host . nil? # skip test if var is unspecified
933932
0 commit comments