Can someone please explain to me what cause this error.
REST API Reason:Error: function uses multiple asynchronous interfaces: callback and promise to use the callback interface: do not return a promise to use the promise interface: remove the last argument to the function at Object.run
[
undefined iOS #0-0] 1) Validate logged in user search a product by a valid key word When I search for “Shirts” in the search text box
[undefined iOS #0-0] Error: function uses multiple asynchronous interfaces: callback and promise
[undefined iOS #0-0] Error: function uses multiple asynchronous interfaces: callback and promise
[undefined iOS #0-0] to use the callback interface: do not return a promise
[undefined iOS #0-0] to use the promise interface: remove the last argument to the function
Im in to Webdriver io Appium test written in typescript.
Below is my code and it failed at last step.
Given(‘I log in to the mobile app’, async () => {
await sharedScreen.AllowWhileUsingApp.click();
await WelcomeScreen.clickSignInButton();
await allowTrackingScreen.clickNextButton();
await sharedScreen.AskAppNotToTrack.click();
await beTheFirstToKnowScreen.clickNextButton();
await sharedScreen.AllowSendNotifications.click();
await memberLoginScreen.userLoginWithValidCredentials();
})
Given(‘I navigate to the product search screen’, async () => {
await bottomNavigationbar.clickShopButton();
})
When(‘I search for “Shirts” in the search text box’,async (searchText: string) => {
await searchBar.enterTextAtSearchTextBox(searchText)
})
Source: Read More