Gradle Tutorial
Introduction Installation Creating project using command line Simple gradle project in IntelliJ IDEA build.gradle file settings.gradle file Directory structure of Gradle project Built-in tasks User defined tasks Task dependencies Running gradle tasks Grouping tasks Repository management in Gradle Declaring dependencies in Gradle JUnit TestNG Test execution reports in Gradle Creating executable Jar using Gradle Generating project API documentation in Gradle Publishing and deployment of artifact in GradleExecuting NUnit tests in gradle
To use NUnit in your Gradle project, you will have to use below dependency.
dependencies {
testCompile group: 'org.testng', name: 'testng', version: '6.9.10'}
We can execute the NUnit tests in a Gradle project by issuing below command.
gradle test
By default, this command will execute all test classes that end with Test or Tests To use TestNG in your project, ensure that you have below configuration in build.gradle.
test {
useTestNG {
}
}
To execute tests from specific classes
test –tests=junit.SimpleSuite
To execute tests from all classes in specific package
test –tests=junit.*
To execute specific test method
test –tests=junit.SimpleSuite.test2
To execute tests from specific category
test{
useTestNG {
excludeGroups 'sanityTests'
includeGroups 'regressionTests'
}
}
Web development and Automation testing
solutions delivered!!