0
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    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>com.idexx</groupId>
    <artifactId>qe-lynxx-automation</artifactId>
    <version>1.0-SNAPSHOT</version>


    <properties>
        <serenity.version>2.0.27</serenity.version>
        <lean.ft.version>14.50.0</lean.ft.version>
        <test.directory>${project.build.testSourceDirectory}/tests</test.directory>
        <tags></tags>
    </properties>

    <dependencies>
  1. 我有所有必需的依赖项,但不包括这里。
  2. 我无法使用 forkCount 或方法并行运行测试。SureFire 插件可以正常工作,但我不能使用 surefire 插件生成宁静报告。
  3. 我尝试了 forkCount 和 parallel 的组合,但也没有用。
  4. 我能够使用sureFire fork 多个Java VM。
  5. 我正在尝试在多个虚拟机中并行运行测试。我们的应用程序是基于 swing 的 java 应用程序,我们使用 LeanFt 来自动化测试过程。

    <build>
        <plugins>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                <forkCount>2</forkCount>
                <reuseForks>false</reuseForks>
    
                    <includes>
                        <!-- Run every java class in the 'tests' package -->
                        <include>${test.directory}/*.java</include>
                    </includes>
    
                    <systemPropertyVariables>
                        <tags>${tags}</tags>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    
            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${serenity.version}</version>
    
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
    
    
        </plugins>
    </build>
    

4

1 回答 1

0

我弄清楚它实际上是如何工作的。您所要做的就是在使用这两个插件时添加带有 Failsafe 插件的 Surefire 插件。它就像一个魅力。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.1</version>
            <configuration>
                <skip>false</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.22.1</version>
            <configuration>
                <includes>
                    <!-- Run every java class in the 'tests' package -->
                    <include>${test.directory}/*.java</include>
                </includes>

            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</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>
            <configuration>
                <tags>${tags}</tags>
            </configuration>
            <executions>
                <execution>
                    <id>serenity-reports</id>enter code here
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
于 2019-04-23T19:01:53.473 回答