如何在jenkins的回归套件之前运行selenium webdriver测试

时间:2018-05-03 04:39:25

标签: jenkins selenium-webdriver testng

我有一个先决条件测试,需要在jenkins的回归套件之前运行。请指教 ?在回归开始之前,先决条件测试执行一些配置任务。我们正在使用的环境是与TestNG,maven的日食。使用的编码语言是java。

1 个答案:

答案 0 :(得分:1)

使用displayUsers(){ return this.state.userList.map( user => { return( <div key={user.name} className="item-card"> <div className="info"> <div className="username">Username: {user.name}</div> </div> <div className="del-wrap"> <img src={require("../../images/cancel.svg")}/> </div> </div> ); }) } 阶段运行配置设置。使用pom.xml中的pre-integration-test进行设置。请参阅此内容 - http://maven.apache.org/surefire/maven-failsafe-plugin/Maven Failsafe Plugin: how to use the pre- and post-integration-test phases

使用pom.xml示例构建部分进行更新。

Maven Failsafe plugin

在预集成测试配置中使用它

<build>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <executions>

                    <execution>
                        <id>pre-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/PreTest.class</include>
                            </includes>
                        </configuration>
                    </execution>

                    <execution>
                        <id>int-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/IntTest.class</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>