1
我正在做一些使用Rspec和Watir的自动化测试。
我目前想要做的是验证是否存在标题为hidden
的按钮元素的属性。因此,在伪代码,我想这样做:
Rspec;验证一个元素的状态,当属性没有值
Find button element; press click
Verify button element now has another attribute titled "hidden"
perform further actions
是否有可能找到这种性质的属性,还是他们总是需要这样说hidden=hidden
?
对于RSpec,[谓词匹配器](https://www.relishapp.com/rspec/rspec-expectations/v/3-4/docs/built-in-matchers/predicate-matchers)可能更好 - 'expect(browser.button).to be_hidden' –
@Justin Ko:Good call。试图保持简单。我已更新您的建议。 – orde
谢谢,这个作品 - 我需要做一些重构来利用语法糖,但总体来说#hidden?作品! – kmancusi