When step times out, onError hook nor the step retries work. The time is happening because of selenium not able to find the element. Below is the error captured, but we want to capture screenshots and also do a step retry
Error: function timed out, ensure the promise resolves within 90000 milliseconds
at Timeout._onTimeout (/build/node_modules/wdio-cucumber-framework/node_modules/cucumber/src/user_code_runner.js:61:18)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)