title: Resolving cucumber promise in protractor
body: <p>I am trying to write cucumber scenarios with protractor and using <code>assert</code> to verify that elements in the dom contain what they are supposed to. This is what I have tried so far:</p>
  
  <pre><code>Then('the title should be {string}', function(expectedTitle) {
    const browserTitle=browser.getTitle().then(function(title) {
      return title;
    })
    assert.equal(browserTitle, expectedTitle);
  });
  </code></pre>
  
  <p>This is what I am getting. I read this as the promise not being resolved properly.</p>
  
  <pre><code>1) Scenario: Visit Homepage # e2e/features/homepage.feature:6
     ✔ Given I browse to "/" # e2e/definitions/navsteps.js:4
     ✖ Then the title should be "bla bla bla" # e2e/definitions/navsteps.js:9
         AssertionError [ERR_ASSERTION]: ManagedPromise {
           flow_:
            ControlFlow {
              propagateUnhandledRejections_: true,
              activeQueue_:
               TaskQueue {
              == 'bla bla bla'
             at World.&lt;anonymous&gt; (/Users/arnab/work/bla-bla/e2e/definitions/navsteps.js:13:10)
     ✔ After # node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:25
  
  1 scenario (1 failed)
  2 steps (1 failed, 1 passed)
  </code></pre>
  
  <p>Shouldn't it be enough to resolve the promise using <code>then</code>? What am I missing? I took a look at <a href="https://stackoverflow.com/questions/38503953/protractor-get-browser-title-as-string/38506595">this SO question</a>, and <a href="https://stackoverflow.com/a/38506595/528617">the accepted solution</a> resolves the title in the same way.</p>