package TestNG;
import org.testng.annotations.Test;
public class LearmingTestNGPriority {
@Test(priority=1)
public void Login() {
System.out.println("Login Test");
}
@Test(priority=3)
public void Logout() {
System.out.println("Logout Test");
}
@Test(priority=2)
public void Navigate() {
System.out.println("Navigation Test");
}
@Test(priority=-1)
public void WebDriverLoad() {
System.out.println("Web Driver Load First");
}
}
---
Output
------
[RemoteTestNG] detected TestNG version 7.3.0
Web Driver Load First
Login Test
Navigation Test
Logout Test
PASSED: WebDriverLoad
PASSED: Login
PASSED: Navigate
PASSED: Logout
===============================================
Default test
Tests run: 4, Failures: 0, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 4, Passes: 4, Failures: 0, Skips: 0
===============================================
#kazacademy #kazonline
Very easy to understand, nice example
ReplyDelete