Reputation: 1316
I have defined wdio.conf.js file (main file) and environment specific dev-chrome.conf.js file. I can't get get cucumber to recognize my step definitions folder.
This is my structure:
And this is what I have in dev-chrome.config.js file:
const wdioConfig = require('../../../../../wdio.conf.js');
const commands = require('../../../../../src/commands/commands');
wdioConfig.config.cucumberOpts = [{
// other stuff here
require:
[
'./src/step_definitions/**/*.js',
// Or search a (sub)folder for JS files with a wildcard
// works since version 1.1 of the wdio-cucumber-framework
//'./src/**/*.js',
],
// other stuff here
}];
exports.config = wdioConfig.config;
I am getting an error:
"Step "When I add the product to a cart" is not defined. You can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true."
When I have same path for step definitions defined on main wdio.conf.js file then it works.
My main wdio.conf.js file is located in the root folder of the project.
Do you know how could I make it work in the environment specific conf.js file? I am using @wdio/cucumber-framework": "^5.13.2"
Upvotes: 0
Views: 3973
Reputation: 2509
As per the below example config, the cucumberopts should be an object and I think you are trying to set it as an array.
Maybe you should follow this example which will help to understand config setup.
Cheers!
Upvotes: 1