title: Error: function timed out, ensure the callback is executed within 5000 milliseconds
body: <p>I'm using Protractor 5.1.2, npm 5.6.0
  It's failing when It tries to click on Login button.
  I'm getting  "Error: function timed out, ensure the callback is executed within 5000 milliseconds" I cannot find where can I change these 5000 milliseconds</p>
  
  <p><strong>homepage.step.ts</strong></p>
  
  <pre><code>import { AppPage } from '../../pageobjects/app';
  import { Homepage } from '../../pageobjects/homepage';
  import { browser, element, by } from 'protractor';
  const { Before } = require('cucumber');
  const { Given } = require("cucumber");
  const { When } = require("cucumber");
  const { Then } = require("cucumber");
  const { setDefaultTimeout } = require ("cucumber");
  const chai = require("chai").use(require("chai-as-promised"));
  const expect = chai.expect;
  let page: AppPage;
  let homepage: Homepage;
  
  Before(() =&gt; {
  page = new AppPage();
  homepage = new Homepage();
  });
  
  Given('I am on the login page', function () {
        page.navigateTo();
  });
  
  When('I fill in teller with {string}', function (string) {
  
  homepage.teller.sendKeys(string);
  
  });
  
  When('I fill in pin with {string}', function (string) {
  
  homepage.pin.sendKeys(string);
  
  });
  
  When('I press Login', function (string) {
  
  homepage.loginButton.click();
  
  });
  
  Then('I should see the {string}', function (string) {
  
  expect(homepage.sideBar).to.eventually.equal(string);
  
  });
  </code></pre>
  
  <p><strong>protractor.conf.js</strong></p>
  
  <pre><code>exports.config = {
  allScriptsTimeout: 11000,
  
  specs: [
      './e2e/features/*.feature'
  ],
  
  capabilities: {
      browserName: 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  cucumberOpts: {
      require: 'e2e/features/step_definitions/*.step.ts',
      tags: [], // &lt;string[]&gt; (expression) only execute the features or scenarios with tags matching the expression
      strict: true, // &lt;boolean&gt; fail if there are any undefined or pending steps
      //format: ["pretty"],            // &lt;string[]&gt; (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
      'dry-run': false, // &lt;boolean&gt; invoke formatters without executing steps
      compiler: [] // &lt;string[]&gt; ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
  },
  
  onPrepare() {
      require('ts-node').register({
          project: 'e2e/tsconfig.e2e.json',
      });
  },
  </code></pre>
  
  <p>};</p>
  
  <p><strong>PO</strong> </p>
  
  <pre><code>import { by,ProtractorBy, element } from "protractor";
  export class Homepage {
  
  sideMenu = element(by.css('.sidebar-nav'));
  statusBar = element(by.css('.status-bar-content'));
  container = element(by.css('.container-fluid'));
  teller = element (by.css('[formcontrolname=user_id]'));
  pin= element (by.css('[formcontrolname=pin]'));
  loginButton = element(by.buttonText('Login'));
  sideBar= element(by.className('.sidebar'));
  activeNav = element (by.css('.nav-link active'));
  }
  </code></pre>
  
  <p><strong>I'm getting the following error:</strong></p>
  
  <pre><code>Failures:
  
  1) Scenario: login with valid credentials # e2e\features\login.feature:12
  √ Before # e2e\features\step_definitions\homepage.step.ts:15
  √ Before # e2e\features\step_definitions\login.step.ts:15
  √ Given I am on the login page # 
  e2e\features\step_definitions\login.step.ts:35
  √ When I fill in teller with "1" # 
  e2e\features\step_definitions\login.step.ts:41
  √ When I fill in pin with "1" # 
  e2e\features\step_definitions\login.step.ts:47
  × When I press Login # e2e\features\step_definitions\login.step.ts:53
     Error: function timed out, ensure the callback is executed within 5000 
     milliseconds
     at Timeout._onTimeout (C:\ui- 
     terminal\node_modules\cucumber\src\user_code_runner.js:61:18)
     at ontimeout (timers.js:482:11)
     at tryOnTimeout (timers.js:317:5)
     at Timer.listOnTimeout (timers.js:277:5)
  - When I should see the "sidebar" # 
  e2e\features\step_definitions\login.step.ts:61
  - Then I should see the home menue option active # 
  e2e\features\step_definitions\login.step.ts:74
  </code></pre>