I use a method where I take the text on the screen and put it into a master
reference file.
Then i write the test screen text into a compare file
Then I use FileUtils to compare the two files.
You could use HTML instead of text for the scrape.
Whey text or html instead of bitmaps. I replay on different computers and
browsers which can vary the quality of the captures.
Rough Example:
require 'fileutils'
def archiveTheScreenAsMaster()
# Get the text from the screen in question
sScreenText = browser.text.to_s
# Store as a file in the test archive as a master
myFile = File.new("masterScreen.txt","w:UTF-8")
myFile.puts sScreenText.to_s
myFile.close
end
def compareTheScreen()
sScreenText = browser.text.to_s
# Store as a current view file to compare
myFile = File.new("todaysSceen.txt","w:UTF-8")
myFile.puts sScreenText.to_s
myFile.close
# Now compare with FileUtils
if FileUtils.compare_file(masterScreen.txt","todaysSceen.txt") then
puts 'PASS'
else
puts 'FAIL"
end
end
On Thursday, August 20, 2015 at 8:17:03 AM UTC-5, christina wrote:
>
> Hi all,
>
> had anyoane know what can we user for
> a human-friendly tool for testing and reviewing visual regressions.
>
> Like comaring the screen snapshots.
>
> There is any ruby gem doing this?
>
> Kind regards,
> ~Cristina
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.