title: Protractor - getText() returns an Array instead of a String
body: <p>I've got a fairly simple Protractor test which should check the text value in a row of a ng-repeat.</p>
  
  <p>Here's my HTML:</p>
  
  <pre><code>&lt;div ng-repeat="destination in destinations"&gt;
      &lt;span&gt;{{destination.city}}, {{destination.country}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here's my JS:</p>
  
  <pre><code>lastDestination = element.all(by.repeater('destination in destinations').row(1));
  expect(lastDestination.getText()).toEqual("Madrid, Spain");
  </code></pre>
  
  <p>The <a href="http://angular.github.io/protractor/#/api?view=webdriver.WebElement.prototype.getText" rel="nofollow">documentation for getText()</a> states:</p>
  
  <blockquote>
    <p>Get the visible (i.e. not hidden by CSS) innerText of this element, including sub-elements, without any leading or trailing whitespace.</p>
  </blockquote>
  
  <p>So I'd expect the text from the row's span tag to be returned, but when running the Protractor test, I get the following error for the assertion:</p>
  
  <p><strong>Expected [ 'Madrid, Spain' ] to equal 'Madrid, Spain'.</strong></p>
  
  <p>GetText() seems to be returning an array instead of a string. </p>
  
  <p>I tried resolving getText()'s promised, but still got the same error:</p>
  
  <pre><code>lastDestination = element.all(by.repeater('destination in destinations').row(1));
  
  lastDestination.getText().then(function (text) {
     expect(text).toEqual("Madrid, Spain"); 
  });
  </code></pre>
  
  <p>I can get around the issue by targeting the first value in the array:</p>
  
  <pre><code>expect(text[0]).toEqual("Madrid, Spain");
  </code></pre>
  
  <p>But I'd still like to know why this isn't working in the first place.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Update</strong>: A <a href="https://github.com/angular/protractor/issues/1794" rel="nofollow">similar bug has been reported</a> on Protractor's Github page, so it could be that the getText() function is just not working as it should.</p>