IllegalArgument Несовместимые фильтры: [@regression, @uat, 10] Можно использовать только один тип [строка, имя, тег], ошибка отображается в Jenkins - PullRequest
0 голосов
/ 20 января 2020

Получение сообщения об ошибке ниже при попытке повторно выполнить сбойные функции в Cucumber с помощью параметра перезапуска в Cucumber от Jenkins. Может кто-нибудь, пожалуйста, помогите мне, как передать команду в разделе «Выполнить windows пакетная команда» в jenkins для выполнения неудавшегося бегуна с динамическими параметрами c

Ошибка: IllegalArgument Несогласованные фильтры: [@ @ Регрессия, @uat, 8] Только один тип [строка, имя, тег] можно использовать одновременно

pom.xml

http://maven.apache.org/maven-v4_0_0.xsd "> 4.0.0 net .bolero.wi wi-test 0.0 .1-SNAPSHOT WI Selenium Test http://maven.apache.org sonar 1.7 1.7 true UTF-8 jdb c: mysql: // localhost: 3306 / sonar? UseUnicode = true & characterEncoding = utf8 root admin http://localhost: 9000 / сонар info.cukes огурец- java 1.2.5 info.cukes огурец-джунит 1.2.5 орг.селенумhq.селен селен-- java 3.8.1 - > 3.8.0 -> 3.141.59 de.openkeyword autoit 0.1.11 net .sf.jacob-project jacob 1.14.3 redis.clients jedis 2.9.0 com.jcraft jsch 0.1.54 com.opencsv opencsv 3.4 net .sourceforge.jexcelapi jxl 2.6.12 xml -apis xml -apis 1.4.01 org. apache .poi poi-ooxml 3.9 org.slf4j slf4j-api 1.7.16 ch.qos. logback logback-clas sic 1.1.5 commons-net commons-net 3.5 joda-time joda-time 2.9.9 org. apache .poi poi 3.9 commons-io commons-io 2.5 org.bouncycastle bcmail-jdk16 1.46 javax.mail javax.mail- api 1.6.1 com.github.javafaker javafaker 0.16 com.sun.mail javax.mail 1.6.0

    <!-- https://mvnrepository.com/artifact/com.vimalselvam/cucumber-extentsreport -->
    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>3.1.1</version>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.6</version>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.1.5</version>
        <!-- <version>3.1.3</version> -->
    </dependency>
    <!-- <dependency> <groupId>net.bolero.surf</groupId> <artifactId>bolero-smime</artifactId> 
        <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.bolero.surf</groupId> 
        <artifactId>bolero-smime</artifactId> <version>0.0.1-20180530.102333-1</version> 
        </dependency> -->
</dependencies>
<!-- <repositories> <repository> <snapshots> <enabled>true</enabled> </snapshots> 
    <id>bolero-central</id> <name>bolero-maven-repository</name> <url>http://repository.bolero-global.net:8081/artifactory/bolero-snapshots</url> 
    </repository> </repositories> -->
<build>
    <finalName>wi-test</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.14</version>
            <configuration>
                <properties>
                    <property>
                        <name>junit</name>
                        <value>true</value>
                    </property>
                </properties>
                <includes>
                    <include>**/WI${test.class}Test.class</include>
                    <!-- <include>**/*WIeFinanceTest.java</include> -->
                    <!--<include>**/*${test}.java</include> <include>**/WIFailedTest.class</include> -->
                </includes>
                <testFailureIgnore>false</testFailureIgnore>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <!-- get all project dependencies -->
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <!-- MainClass in mainfest make a executable jar -->
                <archive>
                    <manifest>
                        <mainClass>cucumber.api.cli.Main</mainClass>
                    </manifest>
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <!-- bind to the packaging phase -->
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Мой тестовый прогон выглядит так

@RunWith(Cucumber.class)
@CucumberOptions(//format = { "pretty", "html:target/cuke" }, 
features = {"classpath:features/XYZ feature Scenario description.feature,
                 "classpath:features/ABC feature Scenario description.feature"},
plugin = { "rerun:target/rerun.txt"},
glue = "net.abc.wi.tests")

Мой сбойный тестовый бегун выглядит следующим образом

@RunWith(Cucumber.class)
@CucumberOptions(features = {"@target/rerun.txt"},
glue = "net.abc.wi.tests")

Мой файл функций выглядит следующим образом

    Feature: XYZ Feature
@regression
  Scenario Outline: XYZ feature Scenario description
    Given I sign in into  application using username as "<username>" and password as "<password>" and token as 'Test'
    And I click on create bill and select 'Fast Bill'
Then I validate Fast bill
@uat
    Examples: 
      | username | password |
     |uatuser|uatpasswrd|

@qa 
Examples: 
      | username | password |
      |qauser|qapasswrd|

В моей работе jenkins ниже приведена windows пакетная команда, переданная

%M2_HOME%\bin\mvn clean test -Dtest.class="%TEST%" -Dbuild.env="%ENVURL%" -Dapplication="%APPL%" -Dcucumber.options="--tags @%TEST_TAG% --tags @%ENV_TAG%" 

%M2_HOME%\bin\mvn test -Dbuild.env=UAT2-URL -Dtest=WIFailedTest -Dapplication=UAT1-CE-URL

Ниже приведены параметры Dynami c, передаваемые во время запуска задания jenkins

ENVURL : "www.xyz.com"
TEST_TAG: "@regression"
ENV_TAG :"@uat"
APPL : "www.abc.com"

Ниже приведен файл rerun.txt, созданный

features/XYZfeature/XYZ feature Scenario description.feature:8
...