Skip to content

Commit 64bea89

Browse files
authored
update screenshot test for ios (#166)
1 parent 4790685 commit 64bea89

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/functional/ios/webdriver/device_test.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ def test_screenshot_quality
146146
@@driver.update_settings({ screenshotQuality: 2 })
147147
@@driver.save_screenshot lower_again_image_path
148148

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)
150151

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')
154155
end
155156
end
156157
end

0 commit comments

Comments
 (0)