title: AngularJS: End to End Testing Issue
body: <p>I am attempting to create an end-to-end test for my application. I just performed a basic test and it is working fine.  </p>
  
  <pre><code>it('should not show any criterias when the application loads initially', 
      function() {
          expect(repeater('.new-criteria').count()).toBe(0);
  });
  </code></pre>
  
  <p>The above test works correctly.  </p>
  
  <p>Now, I am using <code>ng-repeat</code> directive for an element. The array for this repeat increases by 1 count every time a button is clicked. Thus, I wrote the followin test:</p>
  
  <pre><code>it('should show one criteria when the user adds a criteria', function() {
      element('.add-criteria').click();
      expect(repeater('.new-criteria').count()).toBe(1);
  });
  </code></pre>
  
  <p>I am using runner.html (that can be found in AngularJS end to end tutorial). When I load the page, the first test is a success. However, the second test results in the following error:</p>
  
  <pre><code>Selector .add-criteria did not match any elements.
  </code></pre>
  
  <p>I do have a button with the class <code>add-criteria</code> as follows:</p>
  
  <pre><code>    &lt;button type="button" class="btn btn-inverse add-criteria" ng-click="addNewCriteria()"&gt;
          &lt;i class="icon-plus-sign icon-white"&gt;&lt;/i&gt; 
          Add a new criteria
      &lt;/button&gt;
  </code></pre>
  
  <p>Yet, the test fails. If I remove <code>.add-criteria</code> and replace it with <code>.new-criteria</code>, even then I get the same error. Somehow, <code>repeater()</code> is able to get the correct element but <code>element()</code> reports that the element matching the selector could not be found.  </p>
  
  <p>Any idea what is going wrong?</p>
  
  <p><strong>Edit :</strong> I wish to add here that I am using AngularJS with Node / Express. My directory structure is the same as the one in <a href="https://github.com/btford/angular-express-seed" rel="nofollow">angular-express-seed</a>. I found that the issue occurs because the CSS and JS files are located in the public folder while the HTML page is in the views folder. <strong>Copying the CSS and JS files to the views folder solves my problem</strong> How do I achieve this without copying to the views folder?</p>