Espresso WebdriverIO setImplicitTimeout not working

I have Appium v1.16.0 , EspressoDriver (v1.18.0) , “webdriverio”: “^5.18.4”

Trying to add Implicit time out.

const driver = await wdio.remote(opts);
await driver.setImplicitTimeout(30000);
const logIn = await driver.$("//*[@text='LOG IN']");
await logIn.touchAction('tap');

on login button tap I am making API call and expected to see error field to be displayed.

await driver.setImplicitTimeout(40000);
const ErrorUserserNameField = await driver.$("~ErrorUserserNameField");
expect(await ErrorUserserNameField.isDisplayed()).toBe(true);

After tap next command to find ErrorUserserNameField is getting fire immediately and no such element error shown. Ideally it should wait until error label to be shown up on screen.


"value":{"error":"no such element","message":"Could not find element with strategy ACCESSIBILITY_ID and selector ErrorUserserNameField","stacktrace":"io.appium.espressoserver.lib.handlers.exceptions.NoSuchElementException: Could not find element with strategy ACCESSIBILITY_ID and selector ErrorUserserNameField\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleInternal(Fin ....

I have tried in multiple devices and emulators but same error. Tried with UiAutomator2 working fine.