Question: I am trying this:

```
SELECT matchId FROM Matches where matchDate = CURRENT_DATE + HOUR(CURRENT_TIME) + ':00:00'

```

but cant get it to work. When I manually do this, it works:

```
SELECT matchId FROM Matches where matchDate = '2018-01-31 16:00:00'

```

I tried many variations of, containing CURDATE(), CURRENT\_DATE, etc... What am I doing wrong?

Answer: 
```
static async getAllTexts(elements: ElementArrayFinder): Promise<string[]> {
    return await elements.map(async (element: ElementFinder) => {
       await element.getText();
    }
}

```

NOTE: you should [turn off Control Flow](https://github.com/angular/protractor/blob/master/docs/control-flow.md) in your `protractor.conf.ts`:
`SELENIUM_PROMISE_MANAGER: false`
The root cause return empty array is `return data` is executed sync, but `data.push(text)` is executed async. so when `getAllTexts()` execution completed
`data.push(text)` have not start execute, so you got an empty array.

To fix your code issue, please see below **Option 3** 

**Option 1)** call `getText()` on elements directly

```
static getAllTexts(elements: ElementArrayFinder) {
   // directly return raw text
   return elements.getText();

   // or do some formater
   return elements.getText().then(function(txts){
      return txts.map(function(txt){
          return txt.replace('%', '').trim();
      });
   })
}

```

**Option 2)** use `map()`

```
static getAllTexts(elements: ElementArrayFinder) {

   return elements.map(function(item){

      // directly return raw text
      return item.getText();

      // or do some formater
      return item.getText().then(function(txt){
         return txt.replace('%', '').trim();
      });
   });
}

```

**Option 3)** user `each()`

```
static getAllTexts(elements: ElementArrayFinder) {
   var txts = [];

   return elements.each(function(item){
      return item.getText().then(function(txt){

        // directly return raw text
        txts.push(txt);

        // or do some formater
        txts.push(txt.replace('%', '').trim());
      });

   }).then(function(){
      return txts;
   });
}

```