首页 > 解决方案 > 通过maven运行时黄瓜测试的duplicateStepDefinition错误

问题描述

当尝试通过下面的“maven install”运行我的测试时出现错误,当我删除我的目标文件夹时它工作正常。

 This typically happens when you configure cucumber to look for features in the root of your project.
    Your build tool creates a copy of these features in a 'target' or 'build'directory.
    If your features are on the class path consider using a class path URI.
    For example: 'classpath:com/example/app.feature'
    Otherwise you'll have to provide a more specific location
    Apr 30, 2020 1:48:43 PM io.cucumber.core.runtime.FeaturePathFeatureSupplier$FeatureBuilder addUnique
    SEVERE: Duplicate feature found: classpath:AppFeatures/EventLogging/gherkin/SignOn.feature was identical to classpath:Events/AppFeatures/EventLogging/gherkin/signOn.feature

标签: mavenseleniumcucumbermaven-surefire-plugincucumber-java

解决方案


就像错误消息说的那样:“这通常发生在您将 cucumber 配置为在项目的根目录中查找功能时。” 按照错误消息中的建议更改您的配置。

(您没有提供有关如何配置 Cucumber 或如何运行它的任何信息,所以我无法帮助您)


推荐阅读