jeudi 28 septembre 2017

how can I target a using capybara?

This is part of my view ...

  <input type="image" id="clickAction" src="<%= @bookSurveyImage %>" alt="Take Survey"%>"/>
<% end %>

</body>
</html>

I want to be able to target that input, to be redirect to another url. How can I do this ? Please help

Below are some of the things that I have tried.

describe "landings", :type => :feature do
it "index: get all params" do
visit '/sample_page?'

expect(page).to have_no_content 'Sample text'
expect(page).to have_no_content 'Example'
expect(page).to have_no_content("Some Content")

expect(page).to have_css("img", :maximum => 1)

# expect(page).to have_css("input", :id => "sampleID")
# get :survey_link
# expect(response).to render_template(:survey_link) #
# find("#clickAction").click
# input[@type='image']
# click_input

# 

# visit 'https://url........'

end end

Aucun commentaire:

Enregistrer un commentaire