In Cucumber, How to pass the location of the file path such that it works for both Windows and MAC

Karthikeyan :

In Cucumber(mvn based java project) we need to specify the location of files (e.g) feature file location in the TestRunner as below

@CucumberOptions(features=("src\\test\\resources\\features"),
                 glue= {"com.testing.stepdefinitions"},
                 strict = true,
                 plugin= {"pretty","html:target/cucumber",
                         "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"}
                 )

public class MyRunner extends BaseClass{
}

How to specific the file path such that it works properly in Windows and MAC ?

Yosuva A :

Please try the following instead of src\\test\\resources\\features. This will work in both windows and Mac.

@CucumberOptions(features=("./src/test/resources/features"),

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=323535&siteId=1