maven命令運行testng測試

1.官網介紹:
添加鏈接描述
2.配置好了testng的xml文件後,在maven項目中添加一下build,

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <suiteXmlFiles>
                    <!--你的testng.xml文件路徑
                        <suiteXmlFile>src/test/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
<!--                    <properties>-->
<!--                        <property>-->
<!--                            <name>listen</name>-->
<!--                            <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>-->
<!--                        </property>-->
<!--                    </properties>-->
                </configuration>
            </plugin>

3.直接運行mvn test即可測試

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章