title: Using beforeEach in webdriver-io
body: <p>I'd like to know how to use a beforeEach in webdriver-io. I am testing a CMS and want to be able to login before every test and think a beforeEach would be good, however this doesn't work. The terminal says that there is an error and the element cannot be found. I basically want it to log me in everytime without having to write browser.login().  </p>
  
  <pre><code>browser.addCommand('login', function () {
      return this
          .url('/admin/index.php')
          .setValue('[name="username"]', 'foo')
          .setValue('[name="password"]', 'bar')
          .click('[name="login"]');
  });
  </code></pre>
  
  <p>that is my login command.</p>
  
  <pre><code>beforeEach(function(){
       browser.login();
  });
  </code></pre>
  
  <p>this is my beforeEach.</p>
  
  <p>I have also have tried to return the function call as well.</p>