Search Results

Search found 1 results on 1 pages for 'stayce'.

Page 1/1 | 1 

  • How do I test an image alt value using capybara?

    - by stayce
    I'm trying to define a step to test the value of alt text of an image using capybara and the css selectors. I wrote one for input values based on the readme examples: Then /^I should see a value of "([^\"])" within the "([^\"])" input$/ do |input_value, input_id| element_value = locate("input##{input_id}").value element_value.should == input_value end But I can't figure this one out...something like: Then /^I should see the alttext "([^\"]*)"$/ do | alt_text | element_value = locate("img[alt]").value Anyone know how I can locate the alt text value?

    Read the article

1