【发布时间】:2014-12-17 15:07:52
【问题描述】:
你能帮我为检查 CSS 属性创建一个正确的 RSpec 期望吗?
例如我有:
<td class="MenuItem">
而 MenuItem 有一个属性“background-color: #c0c0c0”。
我需要检查 background-color 是否等于 #c0c0c0。
我的例子:
expect(page.td_element(:class => "MenuItem").attribute(class).MenuItem).to be == "#c0c0c0"
【问题讨论】:
-
你会用Capybara吗?使用Capybara::Element 会很容易
-
不幸的是我不能:(
标签: ruby watir watir-webdriver page-object-gem rspec-expectations