# Load classes
require 'rubygems'
require 'watir'
# The main test
begin
# Create the
new report
r = CLReport.
new()
testReport = r.createReport('C:\\testlocation\\reports\\ExampleScript')
# Start browser
browser = Watir::IE.
new
browser.
goto('http:
# --- START TEST ---
# Do a check and report the result
if (1 > 0)
r.addtoReport(testReport, 'Check
if 1 is bigger than 0', 'PASSED', '1 is indeed bigger than 0')
else
r.addtoReport(testReport, 'Check
if 1 is bigger than 0', 'FAILED', '1 is NOT bigger than 0!')
end
# Do another check and report the result
if (2 > 1)
r.addtoReport(testReport, 'Check
if 2 is bigger than 1', 'PASSED', '2 is indeed bigger than 1')
else
r.addtoReport(testReport, 'Check
if 2 is bigger than 1', 'FAILED', '2 is NOT bigger than 1!')
end
# --- END TEST ---
# Close browser
browser.close
# Finish the report
r.finishReport(testReport)
rescue
# Send crash info to report
r.addtoReport(testReport, 'Test crashed with reason '+$!, 'FAILED', 'Test crashed!')
# Finish the report
r.finishReport(testReport)
end