Enable TestNG in IntelliJ IDE
TestNG is bundled with there IntelliJ installation. In-case if its disabled in the IDE, we can enable the plugin using the below steps.
Steps to Enable
File >> Settings… >> Plugins
Click on the Installed tab.
Search for TestNG plugin.
Adding TestNG to project
We can add the TestNG dependency to the Maven project. Its a one time step to configure the TestNG in the project.
Just add @Test annotation, click on the red bulb icon and click on the drop down.
Choose Add Maven dependency…
<dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.1.0</version> <scope>test</scope> </dependency> </dependencies>
Maven would automatically download the latest TestNG jar artifact to the local repository ( .m2 directory).