感谢柴冰沙!
如何使用 chai/chai-smoothie 断言输入字段的值?
鉴于 getText() 始终为空,我们应该使用 element.getAttribute('value') (请参阅:How to getText on an input in protractor)
我希望能够做类似的事情:
expect(this.nameTextbox).to.eventually.have.value('name');
这似乎不起作用:
expect(this.nameTextbox.getAttribute('value')).to.eventually.equal('name');
AssertionError: expected { Object (browser_, then, ...) } to equal 'name'