所有功能文件均未执行

All feature files are not executing

Cucumber 未使用创建的步骤定义执行这两个功能

我试过使用标签,也给出了两个功能的完整路径,但仍然相同

package runners;

import com.cucumber.listener.ExtentProperties;
import com.cucumber.listener.Reporter;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import managers.Common;
import managers.FileReader;
import org.apache.log4j.PropertyConfigurator;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import java.io.File;

@RunWith(Cucumber.class)
@CucumberOptions(
        features = ".//src//test//java//FeatureList",glue = "stepDefinations",
        plugin = { "com.cucumber.listener.ExtentCucumberFormatter:",
                "junit:target/cucumber-results.xml"},
        tags={"@API"},
        monochrome = true
)
public class TestRunner {

    static String ReportName= Common.ReportName();

    @BeforeClass
    public static void setup() {

        ExtentProperties extentProperties = ExtentProperties.INSTANCE;
        extentProperties.setReportPath("target/cucumber-reports/"+ReportName+".html");
        PropertyConfigurator.configure(".//src//log4j.properties");
    }

    @AfterClass
    public static void writeExtentReport() {

        Reporter.loadXMLConfig(new File(FileReader.getInstance().getConfigReader().getReportConfigPath()));
        Reporter.setSystemInfo("User Name", System.getProperty("user.name"));
        Reporter.setSystemInfo("Time Zone", System.getProperty("user.timezone"));
        Reporter.setSystemInfo("Environment", FileReader.getInstance().getConfigReader().getEnvironment());
    }
}

不确定为什么总是 运行 错误 codes.feature 但从来没有 enums.feature

功能:枚举代码 @API 场景:xxx 枚举代码 给定 运行 get 方法 "xxxxxxxxxxx" api 获取所有类型的 xxx xxx 那么响应应该是200 和 xxxxxxxxxxxxxx

功能:错误代码

@API 场景:xx错误代码 给出 运行 "xxxx" api 得到响应 那么响应应该是200 并验证 xx 错误代码 xx 错误响应

"features" 正在寻找文件系统路径:

features = ".//src//test//java//FeatureList"

试试这个 - 1 个特征 = "src/test/java/FeatureList" 2 个特征 = "FeatureList"