如何按顺序运行多个黄瓜标签?

问题描述 投票:0回答:1

我需要运行 3 个功能文件,其中包括登录、任何功能文件、注销。我列出的标签是:@login、@feature、@logout。当我运行自动化时,@logout 在@feature 之前运行。我该怎么做才能按照 li

的顺序完成

由于标签是有序的,','表示 OR,我认为它会按顺序完成,因为有 2 个功能 - @login,@feature,它按顺序运行但是当添加第三个标签时它在第二个标签之前运行

automation cucumber
1个回答
-1
投票

如果您使用的是 java,那么尝试通过传递命令参数来像下面这样运行它们

mvn test -Dcucumber.options="--tags @login,@feature,@logout --order defined"

您可以在 Cucumber jvm 插件中定义如下,只需运行 mvn test 命令——命令 https://github.com/cucumber/cucumber-js/blob/main/CHANGELOG.md#420---2018-04- 03 https://mvnrepository.com/artifact/io.cucumber/cucumber-plugin/7.11.2

<build>
  <plugins>
    <plugin>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-plugin</artifactId>
      <version>6.11.0</version>
      <executions>
        <execution>
          <id>run-cucumber</id>
          <goals>
            <goal>generate</goal>
          </goals>
          <configuration>
            <tags>@login,@feature,@logout</tags>
            <order>defined</order>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
© www.soinside.com 2019 - 2024. All rights reserved.