title: Can Protractor wait for a localStorage change (caused by REST call)?
body: <p>I am using Protractor to test whether a value gets set in localStorage after a login submit. If I bind the localStorage value to a DOM-element, Protractor automatically waits for the REST response (after the login submit), checks the value and tests it.
  But I would like test the value of localStorage without writing it to the DOM. Before each test I clear the localStorage.</p>
  
  <p><code>browser.executeScript("window.localStorage.clear();");
  </code></p>
  
  <p>I can get the value in the test.</p>
  
  <p><code>var key = browser.executeScript("return window.localStorage.getItem('ngStorage-initKey');")
  </code></p>
  
  <p>But that happens too early.
  I also tried returning that value in a <code>browser.wait()</code> statement, but in that case, it seems like the return value is not usable by wait(). probably because it's not a promise.</p>
  
  <p>I would even consider giving protractor access to the the $localStorage instance from ngStorage if that would solve this.</p>
  
  <p>Can anyone tell me if watching localStorage values async with Protractor is possible, and if so, how to approach this?</p>