rspec - 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 文件进行配置?
我在回购中找不到任何东西。
解决方案
不,不是,您要么必须对当前方法进行猴子补丁,要么更好的是,编写自己的自定义格式化程序 - https://github.com/mattheworiordan/capybara-screenshot/blob/master/lib/capybara-screenshot/rspec .rb#L19
推荐阅读
- excel - 如何忽略excel公式中包含数据的最后一个单元格
- react-native - react-native 如何从api获取查询字符串参数
- asp.net - 如何在请求中获取 IP 地址?
- css - 按下时TouchableOpacity不起作用(React-Native)
- django - Django/Docker/Logging:ValueError:无法配置处理程序“files_debug”
- azure - Azure Devops:无代理部署到 Azure 应用服务
- google-cloud-platform - 如何使用 CLI 获取节点池中运行的虚拟机数量
- reactjs - 在使用 reactstarp 打开模型时面临问题
- next.js - Applo 客户端单独或 Next js 单独可以在 Next+Applo 应用程序中进行 SSR 吗?
- c# - 有没有办法在套接字接收中引入分隔符?