1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/spec/views/with_html.erb
Thorbjørn Hermansen 233dbbde4c Added support for following links containing only an image via it's alt-attribute
Given the following HTML:
<a href="/foo"><img src="img.jpg" alt="Img alt text" /><a/>

@session.click_link("Img alt text") will now work and follow to "/foo"
2010-01-15 16:13:48 +01:00

35 lines
1.6 KiB
Text

<h1>This is a test</h1>
<p id="first">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut <a href="/with_simple_html" title="awesome title" class="simple">labore</a>
et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation <a href="/foo" id="foo">ullamco</a> laboris nisi
ut aliquip ex ea commodo consequat.
<a href="/with_simple_html"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="awesome image" /></a>
</p>
<p id="second">
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat <a href="/redirect" id="red">Redirect</a> pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
<input type="text" id="test_field" value="monkey"/>
<a title="twas a fine link" href="/redirect">A link came first</a>
<a title="a fine link" href="/with_simple_html">A link</a>
<a>No Href</a>
<a href="">Blank Href</a>
<a href="#">Blank Anchor</a>
<a href="#anchor">Anchor</a>
<a href="/with_simple_html#anchor">Anchor on different page</a>
<a href="/with_html#anchor">Anchor on same page</a>
<input type="text" value="" id="test_field">
<a href="/redirect"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="very fine image" /></a>
<a href="/with_simple_html"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="fine image" /></a>
</p>
<div id="hidden" style="display:none;">
<div id="hidden_via_ancestor">Inside element with hidden ancestor</div>
</div>