【发布时间】:2018-08-28 12:26:11
【问题描述】:
我正在尝试使用 BDD 和量角器检查三个下拉框的值。
与此相关的代码是:
checkDropdown: function (value, dropdown) {
let name = element(by.id(dropdown));
console.log(name.getText());
expect(name.getText()).to.equal(value);
},
输出是:
AssertionError: expected { Object (browser_, then, ...) } to equal 'Apparent Energy'
我该怎么做才能让它发挥作用?我认为 getText 应该检索字符串而不是对象。
提前致谢。
【问题讨论】:
-
console.log(name.getText())的输出;?
标签: javascript angularjs protractor chai cucumberjs