How can I check if checkbox is checked with Protractor, CucumberJS and Chai ?
var el = 'myCheckbox';
this.expect(element(by.model(el)).to.have.prop("checked", true));
How can I check if checkbox is checked with Protractor, CucumberJS and Chai ?
var el = 'myCheckbox';
this.expect(element(by.model(el)).to.have.prop("checked", true));
isSelected()
would do that:
this.expect(element(by.model(el)).isSelected()).to.eventually.be.true;
You should use this.expect(element(by.model(el)).isSelected()).to.eventually.be(true);
expect(element(by.id("")).isSelected()).toBeFalsy();
I have tried with the following code and it passed.
expect(element(by.css("")).get(i).isSelected()).toBeFalsy();
where, i corresponds to which checkbox needs to be tested