File tree 1 file changed +5
-4
lines changed
test/functional/ios/webdriver
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,12 @@ def test_screenshot_quality
146
146
@@driver . update_settings ( { screenshotQuality : 2 } )
147
147
@@driver . save_screenshot lower_again_image_path
148
148
149
- assert File . size ( lower_image_path ) < File . size ( higher_image_path )
149
+ assert File . size ( lower_image_path ) != File . size ( higher_image_path )
150
+ assert_equal File . size ( lower_again_image_path ) , File . size ( lower_image_path )
150
151
151
- # lowest quality ( the value is 2) is almost under 52KB
152
- assert File . size ( lower_image_path ) < 52_000
153
- assert File . size ( lower_again_image_path ) < 52_000
152
+ # make sure the screenshot is png
153
+ assert Base64 . encode64 ( File . read ( lower_image_path ) ) . start_with? ( 'iVBOR' )
154
+ assert Base64 . encode64 ( File . read ( higher_image_path ) ) . start_with? ( 'iVBOR' )
154
155
end
155
156
end
156
157
end
You can’t perform that action at this time.
0 commit comments