ruby on rails - Rspec HTML report with Fail Screenshot -
i kept scripts in below path:
c:\desktop\rspec_folder my code is:
require 'rspec' require 'watir-webdriver' require 'rautomation' browser = watir::browser.new rspec.configure |config| config.before(:each) { @browser = browser } config.after(:suite) { browser.close unless browser.nil? } end describe "outbid home scenarios validation" before(:each) @browser.goto('http://www.outbid.com') end "to validate outbid logo/home page navigation" @browser.link(:id, "home-link").click end "host & join live auctions heading available" @browser.text.include?('host & join live auctions') end "host & join live auctions " @browser.text.include?('host mail') end after(:each) @browser.close end end my r spec file name outbid.rb. while running above scrips command prompt with:
rspec --format html --out results.html outbid.rb it generating html reports.
i want create report screenshot passed , fail steps.
you can use watir-rspec , watir::rspec::htmlformatter, automatically saves screenshots (and other files generated during example) failing specs.
just follow readme configuration.
Comments
Post a Comment