I am trying to write tests for clicking around on my mobile site. However, I'm having trouble finding any documentation on how to click embedded non link elements. This is my HTML:
form id="search-results-form" action="" method="post">
<div>
<ul id="see-more-search" class="see-more" style="display: block; height: auto;">
<li>
<span>Color</span>
</li>
<li>
<span>Width</span>
</li>
</ul>
</div>
...
This is my incomplete cucumber test:
When(/^touch "Color"$/) do
within(:css, '#see-more-search') do
#I want to be able to click the span with the text 'Color', but
#don't know how to target it from this point
end
end
Does anyone know how I would target the first li
or the 'Color' span?