Running a single test with TestNG in Intellij IDEA

How do you guys run single tests with the IDEA TestNG plugin? I tried to create a focus group, but it seems that the TestNG plugin does not automatically detect dependencies for other tests. Even when I comment on dependsOnMethods , it seems that @BeforeMethod does not start.

Advice is welcome

Robin

+6
source share
2 answers

If you mean one test method inside the test class, there is a right-click option called Run "testMethod" , where testMethod is the actual name of the method.

The shortcut is Ctrl + Shift + F10.

If you place the cursor between methods (even outside of javadoc) or outside the whole class, it will check all the methods in this file.

+8
source

Bring the class into focus in the editor, and then just right-click, select run?

+1
source

Source: https://habr.com/ru/post/901691/


All Articles