title: how does Jasmine 'expect' waits for a protractor promise to resolve
body: <p>I'm working on e2e testing.
  I have a confirm pop which doesnt exist on the page till I click a button.
  Once the confirm popup is create I get the text from an element there.</p>
  
  <p>After that I click on OK button which causes the confirm popup to be delete from the DOM and also add a new element to the DOM with the value i got the text earlier.</p>
  
  <p>the problem is, because getText() returns a promise, by the time I do the comparison the first element is not present on the screen and the test fails.</p>
  
  <p>if I do expect while the confirm popup on the screen I can see the text of the confirm popup element.</p>
  
  <p>how does Jasmine expect() resolve the promise?</p>
  
  <p>thanks in advance</p>