黄瓜嵌入的屏幕截图不链接到屏幕截图
从 Cukes Google Group 交叉发布:
我尝试了多种保存屏幕截图的方法, 但最终选择了 watir-webdriver 中内置的方法。不 无论我使用哪种方法,我都无法成功嵌入 Cucumber HTML 报告中此图像的链接。
在 c:\ruby\cucumber\project_name\features\support\hooks.rb 中,我使用:
After do |scenario|
if scenario.failed?
@browser.driver.save_screenshot("screenshot.png")
embed("screenshot.png", "image/png")
end
end
带有文本“Screenshot”的链接已添加到报告中,但 URL 是 项目目录路径 ("c:\ruby\cucumber\project_name")
而是 而不是直接链接到文件 ("c:\ruby\cucumber\project_name\screenshot.png")
。我尝试了多种不同的图像格式 和使用 Dir.pwd 的直接路径每次都有相同的结果。
我缺少什么?
感谢
Windows XP 红宝石 1.8.7 watir-webdriver (0.2.4) 黄瓜 (0.10.3)
Cross-posted from the Cukes Google Group:
I have experimented with a number of methods of saving screenshots,
but settled on the method that is built into watir-webdriver. No
matter which method I have used, I am not able to successfully embed a
link to this image in the Cucumber HTML report.
In c:\ruby\cucumber\project_name\features\support\hooks.rb, I'm using:
After do |scenario|
if scenario.failed?
@browser.driver.save_screenshot("screenshot.png")
embed("screenshot.png", "image/png")
end
end
A link with text "Screenshot" IS added to the report, but the URL is
the project directory path ("c:\ruby\cucumber\project_name")
rather
than a direct link to the file ("c:\ruby\cucumber\project_name\screenshot.png")
. I have tried a number of different image formats
and direct paths using Dir.pwd with the same results each time.
What am I missing?
Thanks
Windows XP
Ruby 1.8.7
watir-webdriver (0.2.4)
cucumber (0.10.3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阿斯拉克:
·亚当:
阿斯拉克:
Aslak:
Adam:
Aslak: