Steps cannot reach the step definitions if they are out of feature directory.

Hey I wanted to make my directory more robust in look so can anybody can access my step definitions directly too.
so I created a folder called as Steps in Test directory which is in project.

The problem is when I write some step def in that folder the feature steps are unable to navigate to step def but if I run them they are working fine just the navigation is the problem.

But if I create step def in features->step_definitions-> *.steps.js they are navigating .

This might be the problem with configuration of IDE cause everything is working in VSCode because I set the step definitions to steps folder.So I don't find any configuration for webstorm to be done  I installed each and every plugin required for gherkin and Cucumber for JS.

Appreciate your Help.

 

0
Avatar
Permanently deleted user

I checked that out But there is no solution for this issues at that link .

It worked in my old project but I created a new one just yesterday and it stopped working .

Just  now I created some more steps with ignoring navigation and I was be able to navigate but when I restarted the Webstorm I am unable to navigate .So I don't know this is supported by webstorm or something is messed up with it.

looking for  a fix .

0

There is no solution, as it isn't supported yet. That's why I suggested following that ticket (subscribing to it). Another similar issue is https://youtrack.jetbrains.com/issue/WEB-18959.

 

Could you please show a structure of the project where the navigation works and steps folder is called Steps?

0
Avatar
Permanently deleted user

I was pretty happy with following directory and followed the same structure but dont what happened to it  after installing a newer version of webstorm on mac.

so the directory was:

Project->

      ->node_modules

      ->wdio.support

      ->mobile

         ->features

             -*.features

         ->steps

             -*.steps.js

         ->pages

              -*.page.js

      ->Web

         ->features

             -*.features

         ->steps

             -*.steps.js

         ->pages

              -*.page.js

-wdio.conf.js

-package.json

0

Does navigation work if you move step definitions to default location (features->step_definitions-> *.steps.js)? It might be a different issue, not related to project structure...

0
Avatar
Permanently deleted user

I don't know what was the issue but I found a solution for that .

The steps folder should be name as "step_definitions" and it will work for you where ever you keep it in feature file or in main directory.

 

Thanks for the support Elena!!!

3
Avatar
Permanently deleted user

Renaming the step defintion folder to "step_definitions" fixed the navigation issue for me as well. With the foldername "step-definition" I had the same issue as Tabdul-rasheed.

Thank you Elena!!

0

I fixed the issue, updating the cucumber for Kotlin plugin

0

请先登录再写评论。