ext.moduleName = 'ssts-selenium-test' jar { manifest { attributes 'Implementation-Title': 'SSTS Selenium Test', 'Implementation-Version': version } } test { onlyIf { project.hasProperty("seleniumTests") } // enable TestNG support (default is JUnit) useTestNG(){ //outputDirectory = file("$project.buildDir//testngOutput") //report generation delegated to TestNG library: useDefaultListeners = true //suites 'src/test/resources/test/forgon/AllTests.xml' } //reports.html.enabled = false ignoreFailures = true //use this to allow build to continue for CI purposes // set a system property for the test JVM(s) // 设置文件编码为UTF-8,基础数据准备的json文件中有中文 systemProperty "file.encoding", "utf-8" // explicitly include or exclude tests //include 'test/forgon/**' //exclude 'org/boo/**' // show standard out and standard error of the test JVM(s) on the console testLogging.showStandardStreams = true // set heap size for the test JVM(s) minHeapSize = "128m" maxHeapSize = "2048m" // set JVM arguments for the test JVM(s) jvmArgs '-XX:MaxPermSize=512m -XX:MaxNewSize=512m' // listen to events in the test execution lifecycle beforeTest { descriptor -> logger.lifecycle("Running test: " + descriptor) } // listen to standard out and standard error of the test JVM(s) onOutput { descriptor, event -> logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message ) } } dependencies { // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server compile group: 'org.seleniumhq.selenium', name: 'selenium-server', version: '3.4.0' // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.4.0' // 位于父项目的localrepo文件夹 compile group: 'org.seleniumhq.selenium', name: 'selenium-server-standalone', version: '3.4.0' // https://mvnrepository.com/artifact/net.sf.ezmorph/ezmorph compile group: 'net.sf.ezmorph', name: 'ezmorph', version: '1.0.6' // https://mvnrepository.com/artifact/com.google.guava/guava compile group: 'com.google.guava', name: 'guava', version: '21.0' }