2016-11-21 18 views
0

我使用testng框架在gradle中創建了一個項目,如何使用gradle在testng中執行測試套件,請在這裏幫助是我的build.gradle找不到項目的參數[src/test/resources/testSuite.xml]的方法套件()

build.gradle 

apply plugin: 'java' 
apply plugin: 'eclipse' 

sourceCompatibility = 1.8 
version = '1.0' 
jar { 
    manifest { 
     attributes 'Implementation-Title': 'Gradle Quickstart', 
        'Implementation-Version': version 
    } 
} 

repositories { 
    mavenCentral() 
} 

dependencies { 
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2' 
    testCompile group: 'junit', name: 'junit', version: '4.+' 
} 

test { 
    systemProperties 'property': 'value' 
} 

回答

0
test { 
    useTestNG() { 
     suites 'src/test/resources/testng.xml' 
    } 
} 
+0

嗨,我已經嘗試過,但它給了我同樣的錯誤 –

+0

你必須深入挖掘,因爲它是TestNG的是如何使用tesng(和它的工作);)HTTPS ://github.com/cbeust/testng/blob/master/build.gradle#L116-L119 – juherr

+0

非常感謝它的工作:) –

相關問題