title: How to validate when a checkbox is checked in AngularJS e2e tests?
body: <p>I've been trying out the <a href="http://docs.angularjs.org/guide/dev_guide.e2e-testing" rel="noreferrer">AngularJS e2e tests</a> and am getting stuck determining whether or not a checkbox is checked. </p>
  
  <p>I used the end to end test for the <a href="http://docs.angularjs.org/api/ng.directive:input.checkbox" rel="noreferrer">checkbox input</a> as a sample (see the <em>End to end test</em> tab in the <em>Example</em>).</p>
  
  <p><strong>Html snippet:</strong></p>
  
  <p><code>Value1: &lt;input type="checkbox" ng-model="value1"&gt; &lt;br/&gt;</code></p>
  
  <p><strong>Controller snippet:</strong></p>
  
  <pre><code>function Ctrl($scope) {
    $scope.value1 = true;
  }
  </code></pre>
  
  <p><strong>Here is what I tried:</strong></p>
  
  <p>1) <code>expect(binding('value1')).toEqual('true');</code></p>
  
  <p>This works in the sample end to end test as long as <code>value1</code> is displayed on screen with <code>{{value1}}</code>. If you test this locally and remove `{{value1}} the binding test fails. In most of my real-world examples I am not displaying the checkbox value on the screen anywhere.</p>
  
  <p>2) <code>expect(input('value1').val()).toEqual('true');</code></p>
  
  <p>The value will always default to <code>on</code> and is not related to whether or not the checkbox is in a checked state (taken from <a href="https://stackoverflow.com/q/5621324/1207991">this post</a>).</p>
  
  <hr>
  
  <p><strong>Note:</strong> It looks like the Angular E2E testing will be replaced with <a href="https://github.com/angular/protractor" rel="noreferrer">Protractor</a> in the future (see <a href="http://docs.angularjs.org/guide/dev_guide.e2e-testing" rel="noreferrer">the docs</a>)</p>