title: Why must I use browser.sleep while writing protractor tests
body: <p>My first run at E2E tests.  I'm trying to digest someone else's protractor tests.  </p>
  
  <p><strong>Problem:</strong> There are a lot of <code>browser.driver.sleep</code> and this seems fragile.  </p>
  
  <p><strong>Goal:</strong> not to use <code>browser.driver.sleep</code></p>
  
  <p><strong>Question:</strong>  What is a better approach to <code>browser.driver.sleep</code>?  Something less fragile like a promise or something I dont know about lol?</p>
  
  <pre><code>var config = require('../../protractor.conf.js').config;
  describe('this Homepage Body Tests', function(){
  browser.driver.get(config.homepageUrl);
  
  it("should open find a clinic page", function(){
    // page loads :: want to fix this random wait interval 
    browser.driver.sleep(2000);
    browser.ignoreSynchronization = true;
  
    var string = 'clinic';
    var main = '.search-large-text';
    var link = element(by.cssContainingText('.submenu li a', string));
  
    link.click().then(function() {
      // page reloads :: want to fix this random wait interval
      browser.driver.sleep(3000);
      var title = element(by.cssContainingText(main, string));
      expect(title.getText()).toBe(string);
    });
  });
  });
  </code></pre>