Checking existence of images and favicons with RSpec and Capybara

后端 未结 4 1818
灰色年华
灰色年华 2021-01-12 09:01

Is there a good way to check on existence of images and favicons using rspec and capybara?

I can check on the DOM of favicons and images, but I want to be able to ch

4条回答
  •  时光说笑
    2021-01-12 09:44

    # frozen_string_literal: true
    
    module Capybara
      module CustomMatchers
        include Capybara::DSL
    
        class Asset
          def asset_exists?(actual, src)
            js_script = <

    Check https://gist.github.com/yovasx2/1c767114f2e003474a546c89ab4f90db to star and download

提交回复
热议问题