有没有一种好方法可以使用 rspec 和 capybara 检查图像和 favicons 是否存在?
我可以检查网站图标和图像的 DOM,但我希望也能够检查这些图像是否加载。 rspec 和 capybara 可以做到这一点吗?
describe "check images and favicon" do
before { visit "url/to/check")
it "should have the images" do
page.should have_css('img', text: "image1.jpg")
it "should have the favicon" do
page.should have_xpath("/html/head/link[@href='favicon.ico']"
end
end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)