@cucumberoptions中使用多个标签时,不会收集测试/场景

当我在@CucumberOptions中使用多个标签时,TestRunner不会收集任何测试,但是当我仅使用一个标签时,它运行良好:

@CucumberOptions(features =“ src / test / java / features”,胶水= {“ stepDefinitions”},标记= {“ @smoke”})

有人可以在下面的代码中建议我做错了什么吗?如果有人想查看该版本,我还附加了在pom.xml中使用的依赖项。

我已经尝试了StackOverflow上可能存在的答案,但没有一个起作用

Place.feature

Feature: Some feature

  @smoke
  Scenario: Verify AddPlaceAPI
    Given Add place payload
    When User calls "AddPlaceAPI" using HTTP "post" request
    Then API call is a success with status code 200

  @regression
  Scenario: Verify place is deleted successfully using DeletePlaceAPI
    Given DeletePlace payload
    When User calls "DeletePlaceAPI" using HTTP "post" request
    Then API call is a success with status code 200

TestRunner.java

package cucumber.Options;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/java/features",glue = {"stepDefinitions"},tags = {"@smoke,@regression"})
public class TestRunner {

}

Pom.xml

   <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-java</artifactId>
      <version>5.5.0</version>
    </dependency>

    <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-junit</artifactId>
      <version>5.5.0</version>
      <scope>test</scope>
    </dependency>

也尝试使用两个不同的cmd,但它们都不起作用:

mvn clean  test -Dcucumber.options="--tags @smoke,@regression"
or
mvn clean  test -Dcucumber.filter.tags="@smoke,@regression"
adsddn 回答:@cucumberoptions中使用多个标签时,不会收集测试/场景

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2379042.html

大家都在问