title: protractor - force getText() to resolve since element is removed during the test
body: <p>I'm writing a test for my angular app.
  I'm using protractor with jasmine.</p>
  
  <p>The process in the page is as follows:
  1) click a button|
  2) handler creates a div with content : bar|
  3) element(by.id('foo')).getText().then(function(data) { var some-var-i-declared-earlier = data });|
  4) click a button which removes this div from DOM|
  5) expect assertation for this element value.|</p>
  
  <p>the problem will this promise is resolved the element is not present and thus I get null.
  if i do expect (which resolves the promise) before I hit the button which removes the div I can see the value I need</p>
  
  <p>the problem is that the flow must remove the div before i do expect.</p>
  
  <p>how can I force the promise to resolve to get it's value? 
  of course any other solution is very welcome.</p>
  
  <p>thanks in advance!</p>