Allure支持Cucumber JVM 6.0.0吗?

huangapple go评论90阅读模式
英文:

Does Allure support Cucumber JVM 6.0.0?

问题

我有一个使用Java 8和Cucumber 6.0.0的项目。我尝试按照https://docs.qameta.io/allure/#_cucumber_jvm的说明进行操作,但是没有可用的io.qameta.allure:allure-cucumber6-jvm JAR文件。之前版本的io.qameta.allure:allure-cucumber????-jvm与Cucumber 6.0.0不兼容。

是否有一种方法将Allure集成到Cucumber 6.0.0中?

英文:

I have a project that uses Java 8 and Cucumber 6.0.0. I've tried to follow https://docs.qameta.io/allure/#_cucumber_jvm, however, there is no io.qameta.allure:allure-cucumber6-jvm JAR available. Previous versions of io.qameta.allure:allure-cucumber????-jvm don't work with Cucumber 6.0.0.

Is there a way how to integrate Allure with Cucumber 6.0.0?

答案1

得分: 0

根据我的研究和知识,根据每个版本的cucumber,Allure附带不同的依赖,比如allure-cucumber2-jvm、allure-cucumber3-jvm、allure-cucumber4-jvm、allure-cucumber5-jvm。

目前为止,你不会看到cucumber6的任何依赖。但很快你会得到它。cucumber 6发布仅仅过去了3个月。

英文:

As per my research and knowledge, Allure comes with different dependencies for each version of cucumber like allure-cucumber2-jvm, allure-cucumber3-jvm, allure-cucumber4-jvm, allure-cucumber5-jvm.

As of now you won't see any dependency for cucumber6. But you will get it soon. It's been only 3 months of releasing cucumber 6

答案2

得分: 0

是的,在 pom.xml 文件中下载以下 allure 依赖项:

<!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber6-jvm -->
<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-cucumber6-jvm</artifactId>
    <version>2.13.6</version>
</dependency>

然后在 surefire 插件配置中使用它:

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M5</version>
    <configuration>
        <suiteXmlFiles>
            <suiteXmlFile>testng.xml</suiteXmlFile>
        </suiteXmlFiles>
        <systemProperties>
            <property>
                <name>allure.results.directory</name>
                <value>${project.build.directory}/allure-results</value>
            </property>
            <property>
                <name>allure.link.issue.pattern</name>
                <value>https://example.org/issue/{}</value>
            </property>
            <property>
                <name>allure.link.tms.pattern</name>
                <value>https://example.org/tms/{}</value>
            </property>
        </systemProperties>
        <testFailureIgnore>true</testFailureIgnore>
        <argLine>
            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
            -Dcucumber.plugin="io.qameta.allure.cucumber6jvm.AllureCucumber6Jvm"
        </argLine>
    </configuration>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
    </dependencies>
</plugin>

您还需要更新 aspectj 依赖项并将其定义为属性。今天尝试了一下,效果很好。

英文:

yes, in the pom.xml download the following allure dependency:

    &lt;!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber6-jvm --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;io.qameta.allure&lt;/groupId&gt;
        &lt;artifactId&gt;allure-cucumber6-jvm&lt;/artifactId&gt;
        &lt;version&gt;2.13.6&lt;/version&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;

then in surefire plugin config to use it:

   &lt;!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin --&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
            &lt;version&gt;3.0.0-M5&lt;/version&gt;
            &lt;configuration&gt;
                &lt;suiteXmlFiles&gt;
                    &lt;suiteXmlFile&gt;testng.xml&lt;/suiteXmlFile&gt;
                &lt;/suiteXmlFiles&gt;
                &lt;systemProperties&gt;
                    &lt;property&gt;
                        &lt;name&gt;allure.results.directory&lt;/name&gt;
                        &lt;value&gt;${project.build.directory}/allure-results&lt;/value&gt;
                    &lt;/property&gt;
                    &lt;property&gt;
                        &lt;name&gt;allure.link.issue.pattern&lt;/name&gt;
                        &lt;value&gt;https://example.org/issue/{}&lt;/value&gt;
                    &lt;/property&gt;
                    &lt;property&gt;
                        &lt;name&gt;allure.link.tms.pattern&lt;/name&gt;
                        &lt;value&gt;https://example.org/tms/{}&lt;/value&gt;
                    &lt;/property&gt;
                &lt;/systemProperties&gt;
                &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt;
                &lt;argLine&gt;
                    -javaagent:&quot;${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar&quot;
                    -Dcucumber.plugin=&quot;io.qameta.allure.cucumber6jvm.AllureCucumber6Jvm&quot;
                &lt;/argLine&gt;
            &lt;/configuration&gt;
            &lt;dependencies&gt;
                &lt;!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver --&gt;
                &lt;dependency&gt;
                    &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                    &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
                    &lt;version&gt;${aspectj.version}&lt;/version&gt;
                &lt;/dependency&gt;
            &lt;/dependencies&gt;
        &lt;/plugin&gt;

you also need to update aspectj dependency and define it as a property.
tried today and it was working.

huangapple
  • 本文由 发表于 2020年9月3日 20:38:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/63723878.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定