How to validate when a checkbox is checked in AngularJS e2e tests?

后端 未结 3 808
温柔的废话
温柔的废话 2021-01-01 10:13

I\'ve been trying out the AngularJS e2e tests and am getting stuck determining whether or not a checkbox is checked.

I used the end to end test for the checkbox inp

3条回答
  •  执笔经年
    2021-01-01 10:25

    For anyone using Protractor, there is webdriver isSelected() for exactly this.

    Instead of asking for checked attribute you can do:

    expect(element(by.model('value1')).isSelected()).toBeTruthy();
    

提交回复
热议问题