-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to pass hook typechecks after upgrading to version 5.10.7 #4104
Comments
Can you try to update all packages in your package.json? Do you have a minimal reproducible example? |
@christian-bromann @flurmbo I can confirm the issue. It is possible to pass plain function but it is not possible to pass an array of functions. |
|
Hi All, I'm facing the same issue. Is there any solution for this? |
What exactly are you facing? The solution is to upgrade to the latest versions of all wdio packages |
My code is failing when reaches resolve(), it throws Can anyone help me with this? |
Make it a functions list. Does it help? You need to update all wdio packages to the latest version. Try deleting node modules folder and package lock json file |
It was working fine for 1 window, but it was not able to open a new Window. So, I updated the selenium server version using 'java -jar -Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.5.3.jar'. After that, it started giving "Type check for option "onPrepare" failed: a hook option needs to be a list of functions' " . My onprepare method is function list only. |
It should work fine, both with functions and function list. |
Please confirm if these steps correct:
I'm not sure if I'm missing something |
It works for me |
Hey, Thank you so much. It worked for me too. |
Nice! |
We hardcode an old version of WebderiverIO beacuse of microsoft#3019. These seem to have loose dependency requirements, because the change to deuplicate packages broke this (see webdriverio/webdriverio#4104). Hardcode resolutions in E2ETest for existing versions of wdio packages in the meantime.
* Initial commit of override tooling Add a foundation for new override tooling described in #4104. This includes: - Build scripts, lint scripts, config files, etc - Logic for parsing and checking validity of an override manifest - Unit tests for override manifest logic - Abstractions to allow fetching React Native files of arbtrary versions A lot of this is foundational. The override logic has been well-tested, and the Git logic has been manually tested, but we don't have much end-to-end set up yet. * Address comments and deuplicate lockfile * Add more dependencies for WebDriverIO We hardcode an old version of WebderiverIO beacuse of #3019. These seem to have loose dependency requirements, because the change to deuplicate packages broke this (see webdriverio/webdriverio#4104). Hardcode resolutions in E2ETest for existing versions of wdio packages in the meantime.
Hi All afterTest hook throw Error: Type check for option "afterTest" failed: a hook option needs to be a list of functions let options = {
host: 'localhost', // Use localhost as chrome driver server
port: 9515, // "9515" is the port opened by chrome driver.
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: [
'--no-sandbox',
'--window-size=1920,1080',
'--disable-dev-shm-usage'
]
},
timeouts: {
script: 60000
}
},
afterTest: async (
test,
context,
{ error, result, duration, passed, retries }
) => {
await takeScreenshot();
await clearLocalStorage();
},
waitforTimeout: 5000,
maxInstances: 1,
logLevel: 'silent',
coloredLogs: true
};
global.client = await webdriverio.remote(options); I have try to change afterTest: [async (
test,
context,
{ error, result, duration, passed, retries }
) => {
await takeScreenshot();
await clearLocalStorage();
}], now the error disapers but afterTest hook is newer called. What can be the reason for this ? webdriverio -> "version": "6.4.6", |
Environment:
Config of WebdriverIO
Describe the bug
Hi! I tried to upgrade our Webdriverio test script to the latest version, 5.10.7, from 5.7.8. When I tried running the script, I got an error that onPrepare needs to be a list of functions (we currently do not use any hooks). After adding a list containing a dummy function to the config (
onPrepare: [() => {}]
), I got an error saying that config.onPrepare is not a function! Not sure if this is a bug or if I'm misunderstanding how to correctly configure my script, any help would be appreciated!To Reproduce
Steps to reproduce the behavior:
I think it's fairly clear how to reproduce, but I will make an example if requested
Expected behavior
Config should validate successfully with no hooks defined, or with dummy hooks defined
Log
After adding in a list containing 1 dummy function, I get:
The text was updated successfully, but these errors were encountered: