首页 > 解决方案 > capybara-screenshot 主机 URL 是否可配置?

问题描述

在 lib/capybara-screenshot/rspec/html_link_reporter.rb 中,url 的前缀配置为:

url = URI.escape("file://#{path}")

..产生这个:

file:///var/lib/jenkins/agent/workspace/tmp/tmp/Pelican-CI/196/screenshot_2019-07-11-15-29-02.049.html

..最好是:

http://jenkins:8080/project1/build8/something.jpg

这可以通过以下方式完成:

<capybara.asset_host>/<capybara.save_path>

capybara-screenshot 的 url 前缀属性是否可以通过 .yml 文件进行配置?

我在回购中找不到任何东西。

标签: rspeccapybarascreenshot

解决方案


不,不是,您要么必须对当前方法进行猴子补丁,要么更好的是,编写自己的自定义格式化程序 - https://github.com/mattheworiordan/capybara-screenshot/blob/master/lib/capybara-screenshot/rspec .rb#L19


推荐阅读