title: Protractor returning a value from a promise
body: <p>I'm writing a test to see if my code is removing a level by looking at a text value on the screen which holds the count of levels.</p>
  
  <pre><code>  it 'allows deleting level versions', -&gt;
      browser.get('/api#/costings')
      element(By.id("edit")).click()
      startCount = element(By.id("versions_count")).getText().then( (count) -&gt;
        return count
      )
  
      element(By.id("versions")).click()
      first=element.all(By.id("listing")).first()
      first.element(By.id("delete")).click()
      helper.accept_dialog()
  
      element(By.id("back")).click()
      expect(element(By.id("versions_count")).getText()).toEqual(startCount - 1)
  </code></pre>
  
  <p>Problem here is startCount results in a function. I cannot seem to get startCount into an integer so that I can see if the count has gone down by 1 item.</p>
  
  <p>It gives me the error;</p>
  
  <pre><code>  1) edit an existing costing allows deleting level versions
     Message:
       Expected '1' to equal NaN.
  </code></pre>
  
  <p>If I try parseInt(startCount) I get the same error.</p>