我的测试用例都通过了,但仍然收到构建失败错误
测试运行次数: 12,失败次数: 0,错误次数: 0,跳过次数:0
错误无法在项目of上执行目标org.apache.maven.plugins:maven-failsafe-plugin:2.18:integration-test (默认):执行目标org.apache.maven.plugins:maven-failsafe-plugin:2.18:integration-test的默认值失败:of: org.apache.maven.surefire.report.ReporterException:无法为报告创建文件: C:\Users\Nageswar\Desktop\E-Florist\qa-ui-automation\target\failsafe-reports_ java.lang.RuntimeException_StoreTestUiAutomation@123456 _ T11Z101A _新收件人_ 07470 _ Nageswar _ Rao _ 55宽街_ 8187828580 _生日_ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13内文斯rd _ Wayne _ New Jersey _ _.txt _ 07470 _ 8187828580 _.txt(文件名,目录名或卷标语法不正确) ->帮助1
这是我的pom.xml
">http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>net.serenity-bdd.demos</groupId>
<artifactId>StoreTestUiAutomation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>StoreTest</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>1.2.4</serenity.version>
<serenity.maven.version>1.2.4</serenity.maven.version>
<serenity.cucumber.version>1.1.27</serenity.cucumber.version>
</properties>
<!-- Define the Bintray repos for convenience -->
<repositories>
<repository>
<id>serenity</id>
<name>bintray</name>
<url>http://dl.bintray.com/serenity/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>serenity</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/serenity/maven</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-rest-assured</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.opencsv/opencsv -->
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<requireUpperBoundDeps />
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<configuration>
<parallel>classes</parallel>
<threadCount>1</threadCount>
<argLine>-Xmx2048m</argLine>
<forkCount>1</forkCount>
<!-- <systemPropertyVariables> <webdriver.driver>${webdriver.driver}</webdriver.driver>
</systemPropertyVariables> -->
<includes>
<include>**/cucumber/junit/**/*.java</include>
<include>**/cucumber/*.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>firefox</id>
<properties>
<webdriver.driver>firefox</webdriver.driver>
</properties>
</profile>
<profile>
<id>chrome</id>
<properties>
<webdriver.driver>chrome</webdriver.driver>
<webdriver.chrome.driver>chromedriver.exe</webdriver.chrome.driver>
</properties>
</profile>
<profile>
<id>phantomjs</id>
<properties>
<webdriver.driver>phantomjs</webdriver.driver>
</properties>
</profile>
</profiles>
请帮助我解决此问题。
发布于 2018-05-31 22:42:48
假设您使用的是windows操作系统,关键信息似乎如下所示:
文件名、目录名或卷标语法不正确。请参阅以下链接https://msdn.microsoft.com/en-us/library/ms832054.aspx,其中提供了以下说明:
The system does not accept the keyboard combination Alt+0 through Alt+32 or the following characters: \\ \\ / [ ] : | < > + ; = . ? "
User Action:
Correct the file name or volume label and try the command again.实际上,我从您的日志中看到了以下文件名:
filename:
C:\Users\Nageswar\Desktop\E-Florist\qa-ui-automation\target\failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13 nevins rd _ Wayne _ New Jersey _ United States _ 07470 _ 8187828580 _.txt我曾试图在windows机器上创建一个同名的文件,但从命令提示符来看是不可能的。我得到一个错误,如:
C:\Users\Nageswar\Desktop\E-Florist\qa-ui-automation\target>echo. 2>"failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2022 _ Nageswar _ Pattipati _ 13 nevins rd _ Wayne _ New Jersey _ United States _ 07470 _ 8187828580 _.txt"
Impossibile trovare il percorso specificato. 如果我尝试从windows资源管理器执行此操作,它不会失败,但文件名自动截断为:
failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan _ 2或者,如果我保留扩展名:
failsafe-reports_ smoketest.nageswar@qa.com _ Mine@123456 _ T11Z101A _ New Recipient _ 07470 _ Nageswar _ Rao _ 55 broad street _ 8187828580 _ Birthday _ Nageswar _ test message _ Visa _ 4111111111111111 _ 123 _ Jan.txt所以,我认为问题在于文件名太长。
希望这能有所帮助。
https://stackoverflow.com/questions/50576274
复制相似问题