无法单击包含来自 by.repeater 的元素的复选框

Can not click checkbox with element from by.repeater

出于某种原因,我无法单击带有 by.repeater 的复选框。没有错误。查看浏览器时,复选框根本没有被选中。有任何想法吗?如果可能的话,我想留在by.repeater

  this.modelChoices = function(rowNumber) {
    return element.all(by.repeater('model in vehicleCheckboxes.models'));
  } 

  checkboxes.modelChoices().get(0).click();

给出:

<div>
    <div class="input-group" ng-repeat="item in vm.dataFiles | filter:vm.query">
        <span class="input-group-addon">
            <input type="checkbox" ng-model="item.isChecked">
        </span>
        <label class="form-control">{{item.name}}</label>
    </div>
</div>

这是我的端到端测试的一部分,可能会对您有所帮助。 请注意,我将复选框绑定到 "item.isChecked"

it("should disable the create button when there are no checked items in the vm.dataFiles", function () {
    var dataFiles = element.all(by.repeater("item in vm.dataFiles"));
    var firstCheckbox = dataFiles.get(0).element(by.model("item.isChecked"));
    var btnCreate = element(by.id("btnCreate"));

    expect(btnCreate.isEnabled()).not.toBeTruthy();
    firstCheckbox.click();
    expect(btnCreate.isEnabled()).toBeTruthy();
    firstCheckbox.click();
    expect(btnCreate.isEnabled()).not.toBeTruthy();
});