gpt4 book ai didi

selenium - 来自Testng Selenium 的Gradle测试

转载 作者:行者123 更新时间:2023-12-03 06:08:11 32 4
gpt4 key购买 nike

我有一个gradle脚本,应该从命令行运行testng xml文件。但是每当我尝试通过grald test运行时,都会得到以下输出。没有测试运行,甚至没有打开浏览器

C:\Users\Steve\Documents\Projects\automation>gradle test
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE

BUILD SUCCESSFUL

我的gradle脚本如下
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'

group = 'automation'
version = '1.1-SNAPSHOT'

description = ""

repositories {

maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version:'2.52.0'
compile group: 'org.uncommons', name: 'reportng', version:'1.1.4'
compile group: 'org.apache.velocity', name: 'velocity', version:'1.7'
compile group: 'com.google.inject', name: 'guice', version:'4.0'
testCompile group: 'junit', name: 'junit', version:'3.8.1'
testCompile group: 'org.testng', name: 'testng', version:'6.9.4'
}
test{
useTestNG{

include '/src/test/resources/BasicTestXML/**'}
}

最佳答案

include用于包括(或不包括)测试类:
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html

您正在寻找的是
suites
请参见the TestNG build file的示例。

关于selenium - 来自Testng Selenium 的Gradle测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37055644/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com