I am still very new in Cucumber-jvm/Selenium, so I am very sorry if the question sounds dumb.
My question is, if I run a feature file as a cucumber feature, do it run @before in different steps file because it search all the steps. If it does then how to make it just run the step I want? I can change the location of the glue code but is that the only solution?
Background: I'm an intern in a big company. I'm doing an automated software testing for a product. There is already an existing automated test steps. What we're going to do is to extend the project and add our own steps. I created a new simple steps class and feature file just to try it out. It doesn't work because every time I run the feature file, it triggers something which I presume @before in different steps. The @before is in every existing steps in the package. The thing work if I change package and do run configuration which I add the location of the glue code. I'm using Eclipse Photon.
Stepdefs and hook methods are global in nature ie. if they are present in the packages defined in the glue option of the runner they will be picked up for each scenario. The way out is to use tags on the hooks which match that on the scenario.
SOmething like
@Before("@TagNew")
@TagNew
Scenario:....