- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
问题:我使用 allure reporting 在运行一些测试后生成一些报告,当我从 eclipse 中手动运行测试时,allure-results 目录已在/target/allure- 内成功创建结果目录。
但是,当我从命令行调用 maven 后传入一些参数时,如下所示:
call mvn clean
call mvn test -Dbrowser=Chrome -DseleniumEnvironment=local -Dreporttogenerate=censoredconfigsetting -Dcucumber.options="--tags @censoredTag
注意:mvn clean test 确实从命令行生成 allure-reports,为什么我的参数会破坏这个?
相反,这是在/target 中创建/cucumber/results/目录,我很困惑为什么会有所不同,看起来这些标签应该不会有太多问题,我怀疑它可能是我的 pom.xml引起问题。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.kore</groupId>
<artifactId>kore-automation</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>kore-automation</name>
<properties>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<build.number>${maven.build.timestamp}/${platform}/${platformVersion}/${browser}/${browserVersion}</build.number>
<reports.directory>${project.build.directory}/../reports/${build.number}</reports.directory>
<cucumber.tags>~@ignore</cucumber.tags>
<!-- Needed for allure-maven-plugin to specify report version -->
<aspectj.version>1.8.4</aspectj.version>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.8.0-alpha2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.8.0-alpha2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>2.0.0.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-cucumber-jvm-adaptor</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>16.0.1</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>read-properties</id>
<activation>
<file>
<exists>src/test/resources/config.properties</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>src\test\resources\config.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>4.1.0</version>
<executions>
<execution>
<id>generateRunners</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generateRunners</goal>
</goals>
<configuration>
<!-- Mandatory -->
<!-- comma separated list of package names to scan for glue code -->
<glue>
<package>webDriver</package>
<package>censored</package>
<package>censored</package>
<package>testRunner</package>
</glue>
<outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
<!-- The directory, which must be in the root of the runtime classpath, containing your feature files. -->
<featuresDirectory>src/test/java/</featuresDirectory>
<!-- Directory where the cucumber report files shall be written -->
<!-- cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir-->
<!-- comma separated list of output formats json,html,rerun.txt -->
<!-- format>json</format-->
<!-- CucumberOptions.strict property -->
<!-- strict>true</strict>-->
<!-- CucumberOptions.monochrome property -->
<monochrome>true</monochrome>
<!-- The tags to run, maps to CucumberOptions.tags property you can pass ANDed tags like "@tag1","@tag2" and ORed tags like "@tag1,@tag2,@tag3" -->
<tags />
<!-- If set to true, only feature files containing the required tags shall be generated. -->
<filterFeaturesByTags>false</filterFeaturesByTags>
<!-- Generate TestNG runners instead of default JUnit ones. -->
<useTestNG>false</useTestNG>
<!-- The naming scheme to use for the generated test classes. One of 'simple' or 'feature-title' -->
<namingScheme>simple</namingScheme>
<!-- The class naming pattern to use. Only required/used if naming scheme is 'pattern'.-->
<namingPattern>Parallel{c}IT</namingPattern>
<!-- One of [SCENARIO, FEATURE]. SCENARIO generates one runner per scenario. FEATURE generates a runner per feature. -->
<parallelScheme>FEATURE</parallelScheme>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
</plugin>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
-Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter"</argLine>
<properties>
<property>
<name>listener2</name>
<value>/core-automation/src/test/java/testRunner/CustomAllureListener</value>
</property>
</properties>
<forkCount>10</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/*IT.class</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<versionRange>[1.0-alpha-2,)</versionRange>
<goals>
<goal>read-project-properties</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<versionRange>[4.1.0,)</versionRange>
<goals>
<goal>generateRunners</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
我注意到,当生成并行 .IT 文件以并行运行我的测试时,它们各自引用:
plugin = {"json:C:/Users/sy/git/censor/censor/target/cucumber-parallel/1.json"}
仍然有点困惑,因为在 eclipse 中运行时 -> 运行为:Maven Build... -> clean test 我没有创建这些 json 文件,只有在传递像 mvn args 这样的命令时我才能得到它们
仔细观察,特别是当我在 mvn 调用中传入 -Dcucumber.Options 标签时,似乎会覆盖 -Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm .AllureReporter”
位于 pom.xml 中我的 Surefire 插件
感谢您的宝贵时间,非常感谢您的帮助。
最佳答案
经过一个漫长的上午,我发现了问题,这只是我传递带有标签的 -Dcucumber.options 覆盖了 allurereporter 的 maven Surefire argLine 。
通过运行以下命令修复:
call mvn clean test -Dbrowser=Chrome -DseleniumEnvironment=local -Dcucumber.Options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter --tags @censoredtag"
call mvn allure:report
并从我的 Maven Surefire 插件中删除 -Dcucumber.Options argLine。
关于java - Allure 报告不会使用 mvn test -Darguments 生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45779771/
我正在为我的项目使用 Maven。如果我的项目不使用某些本地资源,这不是问题。 以便我遵循本指南 https://stackoverflow.com/a/61576687/6720896 将我的本地
今天我尝试通过 Maven 使用 site 命令生成报告,在编译阶段遇到了问题。 错误: ParseException in /Users/rajesh/Documents/workspace/mob
这个问题已经有答案了: Mvn install or Mvn package (8 个回答) 已关闭 6 年前。 我是一名新开发人员,一生中从未使用过 eclipse 或 java,我正在尝试做一些事
我知道mvn:package可以用来生成JAR或WAR,mvn:assemble有什么区别吗? 最佳答案 他们是完全不同的。 “package”是一个简单的命令,用于简单/单个项目,您只需创建一个 j
我正在使用 Maven 运行单个测试。 以这两种方式运行它的区别是: mvn -Dtest=DatabaseTest test mvn -Dtest=DatabaseTest surefire:tes
我已经从 svn checkout 了一个项目。我正在尝试使用 Maven 构建项目。 使用 mvn 编译可以很好地构建。 当我尝试命令 mvn package 时,出现以下错误。 [INFO] --
当我使用 Maven 故障安全插件运行集成测试时遇到问题。我有两个类,一个是 TestUnitTest.java,另一个是 TestIntegrationIT.java。在pom.xml中,我配置如下
我有一个测试用例: import org.graph.*; import org.junit.*; public class TestCase_1 { @Test public voi
大家好,我有这两个问题 mvn clean 我收到此警告消息 Some problems were encountered while building the effective model for
Maven的mvn install和mvn verify命令有什么区别? 关键字clean如何修改这些命令? 最佳答案 mvn verify - 如前所述 - 执行 maven 在项目中找到的任何集成
我正在关注 Scala, Eclipse and Maven Integration tutorial . 这真的很有用。 但是有一件事情让我觉得很烦: 我总是需要从 Eclipse 运行两个命令作为
虽然我知道 mvn install -U 用于 update-snapshots 并且它更新了从构建日志中看到的远程存储库中的所有内容,但我无法了解它会强制更新哪一部分。因为据我了解,即使是 mvn
我已经阅读了@ codehaus exec-maven-plugin usage 的文档.我知道 exec:java 允许用户在他们声明的同一个 VM 中执行 java 程序。我是 Maven 的新手
我正在使用树脂服务器开发一个 Java 项目(其中 maven 是构建工具)。我找到了一些不错的 plugins对于 Tomcat,如果我发出 'mvn compile'然后编译文件转到/webapp
我有一个打包为 war 文件(包括几个 jar 文件)的 Web 应用程序。我注意到当我运行 mvn install 时——唯一被编译的项目是那些已经改变的——然后它替换了 war 文件中的这些 ja
这个问题在这里已经有了答案: IDEA JetBrains IntelliJ - Compile error on 'make' but fine when compiled using Maven
mvn clean install和mvn install有什么区别? 最佳答案 clean 在 Maven 中是它自己的构建生命周期阶段(可以被认为是一个 Action 或任务)。 mvn clea
我的团队使用内部团队 Maven 存储库,该存储库是使用 Apache 从开发服务器共享的。我们还在同一台机器上运行 Continuum CI 服务器。 Continuum 中的 Maven 构建以“
我正在尝试执行“mvn install”以从 Dockerfile 创建 war 文件。波纹管是Dockerfile FROM scratch FROM ubuntu:16.04 RUN mkdir
mvn 验证失败并抛出依赖错误。 Dependency convergence error for com.company.concepts:patients:2.4.14-SNAPSHOT path
我是一名优秀的程序员,十分优秀!