我正在尝试编写测试以在我的移动网站上点击。但是,我无法找到有关如何单击嵌入的非链接元素的任何文档。这是我的 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>
...
这是我不完整的黄瓜测试:
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
有谁知道我将如何定位第一个li
或“颜色”跨度?