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

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -