0
我與詹金斯工作,並試圖調用具有與配置的gradle Java項目運行的build.gradle 版本「1.0快照」詹金斯如何從詹金斯gradle這個運行指定的testng.xml
測試遠程機器apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
version = '1.0'
sourceSets {
jars
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile fileTree(dir: "src/jars/resources", include: ['*.jar'])
compile group: 'org.testng', name: 'testng', version: '6.9.10'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.+'
compile group: 'io.appium', name: 'java-client', version: '4.1.2'
compile 'com.testdroid:testdroid-api:2.9'
compile group: 'org.json', name: 'json', version: '20141113'
}
compileJava {
options.encoding = "UTF-8"
}
test {
useTestNG {
suites 'src/main/resources/testng.xml'
}
}
但我想運行一個自定義testng2.xml!所以我在詹金斯定義參數測試,並定義它們testng2.xml,但它會在控制檯
/Users/jenkins/Home/workspace/AutomationGradle/gradlew -Dtest=testng2.xml clean test -i
顯示,但我不明白如何讓gradle這個得到動態參數
這是正確的答案。理想情況下,請添加命令行使用,請 –
仍然因爲某種原因無法正常工作,總是轉到「testng.xml」,什麼是「ext」?我需要更多的信息 – shaharnakash
ext.testFile = System.getProperty( 'Test_Plan')? '的testng.xml' 測試{ useTestNG { 套房 「的src /主/資源/ $ {} TESTFILE」 }} – shaharnakash