title: Does Cucumber with Protractor need the callback?
body: <p>I'm trying to understand how <a href="https://github.com/angular/protractor/blob/master/docs/control-flow.md" rel="nofollow">The WebDriver Control Flow</a> works exactly.</p>
  
  <p>According to the linked documentation (<a href="https://github.com/angular/protractor/blob/master/docs/control-flow.md" rel="nofollow">https://github.com/angular/protractor/blob/master/docs/control-flow.md</a>) no callback method / call is needed in jasmine:</p>
  
  <blockquote>
    <p>Protractor adapts Jasmine so that each spec automatically waits until the control flow is empty before exiting.</p>
  </blockquote>
  
  <p>However, I have to use cucumber. I'm using the library <code>protractor-cucumber-framework</code> as described here: <a href="https://github.com/angular/protractor/blob/master/docs/frameworks.md#using-cucumber" rel="nofollow">https://github.com/angular/protractor/blob/master/docs/frameworks.md#using-cucumber</a></p>
  
  <p>It works well, but for some reason it works better when I skip the callback variable then when I try using it. For instance, this code fails:</p>
  
  <pre><code>this.Given(/^the login page is active$/, function (callback) {
    browser.get('/').then(callback);
  });
  </code></pre>
  
  <p>With the error ...</p>
  
  <blockquote>
    <p>TypeError: text.split is not a function</p>
    
    <p>[launcher] Process exited with error code 1</p>
  </blockquote>
  
  <p>On the other hand, this codes works as I want it to work and cucumber / protractor seems to be waiting until the page is loaded, before executing further functions:</p>
  
  <pre><code>me.Given(/^the login page is active$/, function () {
    browser.get('/');
  });
  </code></pre>
  
  <p>But I couldn't find any documentation confirming that I really can omit the callback function.</p>
  
  <p>Currently the page I tried to test doesn't use Angular and therefore I have the following code in my config file:</p>
  
  <pre><code>onPrepare: function() {
    browser.ignoreSynchronization = true;
  }
  </code></pre>