我有下一个场景:
Scenario: Product page contains right bar.
When right bar contains customization elements:
| Color selection | Color |
步骤:
When(/^right bar contains customization elements\:$/) do |table|
data = table.raw
on(ProductPage) do |page|
expect(page.div_element(text: data['Color selection']).present?).to be_truthy
end
end
我得到TypeError: no implicit conversion of String into Integer
上
expect(page.div_element(text: data['Color selection']).present?).to be_truthy
为什么呢?对于其他类似的场景,一切都还可以。