'How to only execute the first test in a Test class with TestNG

I'm putting together a navigation test suite to exercise a little bit of functionality on each page of my company's internal application with Java / Selenium / TestNG.

Say I have a test class called ApplicationsIT in my NavigationTests directory. Within this class, I have 10 @Tests annotations so every time I run the full NavigationTests suite all 10 Tests run.

But, for the sake of time, is there a way for me to only run the first test in each test class?

I tried messing with the "(alwaysRun = false)" tags but it didn't seem to work how I'd expected.

I know this is a poorly constructed question/post so I'd be happy to clarify anything I can.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source