小编Kom*_*mal的帖子

依赖 jars 中的 Cucumber Step 定义

我有多个项目在不同的项目中使用类似的步骤定义。因此在单个项目中使用所有步骤定义并在 maven 中作为依赖 jar 添加。当我使用 maven 命令运行时,它说:

您可以使用以下代码段实现缺失的步骤:

@When("^Import a canvas from \"(.*?)\" to project \"(.*?)\"$")
public void import_a_canvas_from_to_project(String arg1, String arg2) throws Throwable {
 // Write code here that turns the phrase above into concrete actions
  throw new PendingException();
  }
Run Code Online (Sandbox Code Playgroud)

但是当我在同一个项目中添加包时它工作正常。(即使在来自不同项目的 eclipse 中也有效)。有没有办法从 maven 和 jenkins 运行这样的场景?

我正在使用 Eclipse IDE。我使用的 maven 命令是: mvn -DprofileTest=cucumberID clean -PucumberID test

CucumberID 是我的个人资料名称。

以下配置文件我在 pom.xml 中添加

<profile>
<id>cucumberID</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <version>2.11</version>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <includes>
                                <include>step_definitions/LoginTest.java</include>
                    </includes>
                    <parallel>classes</parallel>
                    <threadCount>3</threadCount>
                    <useFile>true</useFile>
                </configuration> …
Run Code Online (Sandbox Code Playgroud)

java eclipse cucumber maven cucumber-junit

2
推荐指数
1
解决办法
3482
查看次数

标签 统计

cucumber ×1

cucumber-junit ×1

eclipse ×1

java ×1

maven ×1