Having trouble using Capybara and Selenium to find an svg tag on a page

后端 未结 2 1110
难免孤独
难免孤独 2021-01-06 07:05

I had a test case like this:

  scenario \"there should be an SVG tag\" do
    ...
    page.find(\"svg\")
  end

For some reason, Capybara co

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 07:52

    I have found a solution which enables the use of CSS selectors:

    
    scenario "there should be an SVG tag" do
        ...
        Nokogiri::HTML.parse(page.body).css('svg')
    end
    
    

    Strange and annoying that it doesn't work out the box using page.find(), though.

提交回复
热议问题