selenium-cucumber-js
selenium-cucumber-js copied to clipboard
how to run the repo using just cucumberjs command?
Hi ,
I really like the repo but I want to follow the standard cucumber structure and run from IDE ( from Webstorm).
i followed the steps you mentioned in the intelliJ cucumber plugin section, and I am able to run the repo with command
node ./index.js -s ./features/step_definitions -p ./features/page_objects -o ./features/shared_objects -r ./features/reports
but then when I run the repo using just cucumberjs command, i get various errors. for example it says 'by is not defined'.
can you let me know how to structure the framework so that I can run from command line by just giving cucumberjs or in the intelliJ, right click on the scenario and run the scenario.
I have attached snapshots , how I would like to run. The reason I want to run like this is, its easier to debug and run in one go everything from the editor.. Appreciate your help.
The actual command the editor runs is
./node_modules/.bin/cucumberjs /Users/raja/projects/JavaScript_frameworks/selenium-cucumber-js/features/google-search.feature --format summary --require /Users/raja/projects/JavaScript_frameworks/selenium-cucumber-js/features --require /Applications/WebStorm.app/Contents/plugins/CucumberJavaScript/lib/cucumberjs_formatter_nix.js
(copy pasted from editor)
ideally if i can run with cucumberjs command, then I should be able to figure out how to run in editor.
many thanks.

Hi @shekss, I am not a WebStorm user so I would have no idea. @Temi89 can you help?
Hi @shekss what version of Node and npm are you running ? Also have tried doing and Npm update. seems like you might have missing a dependencies
@shekss , @john-doherty Just had a look at your screenshot you are using "cucumber runner" . Edit your run configuration to use "node runner" which you can download as a plugin and point to the index.js file of selenium cucumber js . Or better still just execute Npm run test on the terminal and pass arguments you need e.g. (npm run test -- -b Firefox -t@search) . That is if you haven't already done this.
Thanks @Temi89. @shekss probably does not have the "test" entry in his package.json file. Are you able to share what you use?
HI @Temi89 & @john-doherty , I wanted to run the tests using cucumberjs command actually. the reason i showed webstorm is , webstorm or any other IDE runs cucumberjs command. if i wanted to run the features using cucumberjs, what are all the changes I need to do ? cucumber loads everything in the support folder before running features , so may be you can store the index.js in there? I tried it but I was not successful. by using the cucumberjs as the runner, I can use the standard cucumber options like tags,hooks in the same way its defined in cucumber tool.