如何检查是否使用Protractor,CucumberJS和Chai检查复选框?
var el = 'myCheckbox';
this.expect(element(by.model(el)).to.have.prop("checked", true));
答案 0 :(得分:8)
isSelected()
会这样做:
this.expect(element(by.model(el)).isSelected()).to.eventually.be.true;
答案 1 :(得分:1)
您应该使用this.expect(element(by.model(el)).isSelected()).to.eventually.be(true);
答案 2 :(得分:-1)
expect(element(by.id("")).isSelected()).toBeFalsy();