I am using javascript, nodejs, npm, wdio, cucumber in my testing automation framework.
In my main project root folder I have wdio.conf.js file. Suppose there is a dependency in node_modules folder with its own wdio.conf.js file. And suppose both wdio.conf.js has afterScenario() hook.
Two queries:
1)I want to ask which wdio.conf.js file will be run and which afterScenario() hook will be run?
2)Suppose I want to run afterScenario() hook in both wdio.conf.js files. How can I do this?
EDIT:
ROOT FOLDER:
|-some file
|-wdio.conf.js (contains afterScenario() hook)
|-package.json
|-nodes_module
|-dependency1
|-Some files
|-package.json
|-wdio.conf.js (also contains afterScenario() hook)
|-dependency2
I don't think I completely understood your question. So let me ask you this, would having something like this in your package.json help?
Where in wdio.conf1.js you would have 1 afterScenario() hook and in the wdio.conf2.js you would have a different afterScenario() hook. So if you rename your local wdio configuration may be enough to fix your issue? Let me know if this helps!