Submitted by Google Cukes:
I experimented with several ways to save screenshots, but settled on a method that is built into watir-webdriver. There is no question which method I used, I can’t successfully embed a link to this image in the HTML report of the cucumber.
In c: \ ruby \ cucumber \ project_name \ features \ support \ hooks.rb, I use:
After do |scenario| if scenario.failed? @browser.driver.save_screenshot("screenshot.png") embed("screenshot.png", "image/png") end end
A link to the text “Screenshot” was added to the report, but the URL is the path to the project directory ("c:\ruby\cucumber\project_name") than the direct link to the file ("c:\ruby\cucumber\project_name\screenshot.png") . I tried several different image formats and direct paths using Dir.pwd with the same results every time.
What am I missing?
thanks
Windows XP Ruby 1.8.7 watir-webdriver (0.2.4) cucumber (0,10.3)
source share