我想知道是否有办法page.should
直接使用页面对象元素执行断言,而不是将 xpath 或 CSS 选择器字符串作为参数。
IE:
页面类:
class FooClass < SitePrism::Page
element :action_select, '.autocomplete.medium'
end
步骤定义:
page.should have_css('.autocomplete.medium')
#Sort of thing desired:
page.should have_css(action_select.get_css)
那.get_css
不存在,但它用于说明所需的内容。