title: Protractor: The .then after the getText() isn't executing
body: <p>The following method is passing a data table through and not executing the assertion and since it doesn't assert anything it automatically passes the cucumber step. </p>
  
  <pre><code> Then(/^the following &lt;fields&gt; are displayed in the Method Information panel$/, (table) =&gt; {
      var hashes = table.hashes();
      var expectedValues: string[] = new Array();
  
      return hashes.forEach(function (hash) {
          console.log("In For Each");
          expectedValues.push(hash.fields);
          var index = expectedValues.length - 1;
          console.log(expectedValues[index])
          expectedValues[index] = expectedValues[index].replace(' ', '');
  
          return element(by.id("label" + expectedValues[index])).getText()
              .then(function (actualValues) {
                  console.log("In Then:" + actualValues);
                  report.takeScreenshot();
                  return expecting(actualValues).to.deeply.equal(expectedValues[index]);
              }, function (err) {
                  report.logError("An error occurred while comparing values." + err);
              });
      }, function (err) {
          report.logError("An error occurred while comparing values." + err);
      });
  });
  </code></pre>
  
  <p>The console log looks like:</p>
  
  <pre><code>In For Each
  Name
  In For Each
  Description
  In For Each
  Type
  In For Each
  Instrument System
    √ Then the following &lt;fields&gt; are displayed in the Method Information panel
    | fields            |
    | Name              |
    | Description       |
    | Type              |
    | Instrument System |
  </code></pre>