Error: Invalid Chai property: __wd_promise_enriched

Error: Invalid Chai property: __wd_promise_enriched

出于某种原因,我一直收到此错误。这是有问题的代码行

.elementByXPath('//textarea').getAttribute('innerHTML').should.eventually.equal('abcdefg')

我在代码的其他地方使用了 elementByXPath、getAttribute 和 should eventually 语句,它工作正常。 _wd_promise_enriched 错误甚至意味着什么?

我遇到了同样的问题,但无法理解为什么会发生这种情况。但是,我使用 become 解决了这个问题,因此您的代码将变成:

.elementByXPath('//textarea').getAttribute('innerHTML').should.become('abcdefg')

这相当于:

.elementByXPath('//textarea').getAttribute('innerHTML').should.eventually.deep.equal('abcdefg')