We should reuse
```
    // switch to System app
    client.switchToFrame();
    // Wait for the keyboard pop up and switch to it
    client.waitFor(function() {
      var keyboards = client.findElement('#keyboards');
      var classes = keyboards.getAttribute('class');
      var transitionIn = keyboards.getAttribute('data-transition-in');

      return ( classes.indexOf('hide') == -1 ) && transitionIn !== 'true';
    });
    client.apps.switchToApp(KEYBOARD_ORIGIN);
```
We could do somethings like `keyboard.waitForDisplayed()` to include the above logic.