@@ -87,11 +87,11 @@ def save_screenshot_and_assert(source, path)
8787 screenshot = driver . save_screenshot path
8888
8989 if Platform . linux?
90- expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . first . to be <= viewport_width
91- expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . last . to be <= viewport_height
90+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack1 ( 'NN' ) ) . to be <= viewport_width
91+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) . last ) . to be <= viewport_height
9292 else
93- expect ( ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . first / 2 ) . to be <= viewport_width
94- expect ( ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . last / 2 ) . to be <= viewport_height
93+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack1 ( 'NN' ) / 2 ) . to be <= viewport_width
94+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) . last / 2 ) . to be <= viewport_height
9595 end
9696 end
9797
@@ -101,11 +101,11 @@ def save_screenshot_and_assert(source, path)
101101
102102 screenshot = driver . save_screenshot path , full_page : true
103103 if Platform . linux?
104- expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . first . to be >= viewport_width
105- expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . last . to be > viewport_height
104+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack1 ( 'NN' ) ) . to be >= viewport_width
105+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) . last ) . to be > viewport_height
106106 else
107- expect ( ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . first / 2 ) . to be >= viewport_width
108- expect ( ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) ) . last / 2 ) . to be > viewport_height
107+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack1 ( 'NN' ) / 2 ) . to be >= viewport_width
108+ expect ( File . read ( screenshot ) [ 0x10 ..0x18 ] . unpack ( 'NN' ) . last / 2 ) . to be > viewport_height
109109 end
110110 end
111111
0 commit comments