From 5e08f69e84a2029cb3a37b8b2e0dde4385c7b222 Mon Sep 17 00:00:00 2001 From: dadgam3er Date: Sun, 22 Sep 2024 16:48:44 -0400 Subject: [PATCH] Grouped --- .idea/inspectionProfiles/Project_Default.xml | 14 +++++++ src/test/java/zacksolutions/TestHomePage.java | 40 +++++++++--------- .../java/zacksolutions/TestLoginPage.java | 40 +++++++++--------- src/test/java/zacksolutions/TestNGClass.java | 41 ++++++++++--------- .../java/zacksolutions/TestNGDiffClass.java | 41 ++++++++++--------- testngGroups.xml | 21 ++++++++++ 6 files changed, 117 insertions(+), 80 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 testngGroups.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..5fb655c --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/src/test/java/zacksolutions/TestHomePage.java b/src/test/java/zacksolutions/TestHomePage.java index 2dc5b16..742343f 100644 --- a/src/test/java/zacksolutions/TestHomePage.java +++ b/src/test/java/zacksolutions/TestHomePage.java @@ -5,28 +5,28 @@ import org.testng.annotations.Test; public class TestHomePage { - @Test - public static void testCaseSixteen() { - System.out.println("Debug the sixteenth case"); - } + @Test(groups = { "Smoke" }) + public static void testCaseSixteen() { + System.out.println("Debug the sixteenth case"); + } - @Test - public static void testCaseSeventeen() { - System.out.println("Debug the seventeenth case"); - } + @Test + public static void testCaseSeventeen() { + System.out.println("Debug the seventeenth case"); + } - @Test - public static void testCaseEighteen() { - System.out.println("Debug the eighteenth case"); - } + @Test + public static void testCaseEighteen() { + System.out.println("Debug the eighteenth case"); + } - @Test - public static void testCaseNineteen() { - System.out.println("Debug the nineteenth case"); - } + @Test + public static void testCaseNineteen() { + System.out.println("Debug the nineteenth case"); + } - @BeforeTest - public static void testCaseTwenty() { - System.out.println("Debug the twentieth case ### BEFORE TEST"); - } + @BeforeTest + public static void testCaseTwenty() { + System.out.println("Debug the twentieth case ### BEFORE TEST"); + } } diff --git a/src/test/java/zacksolutions/TestLoginPage.java b/src/test/java/zacksolutions/TestLoginPage.java index b76a30b..12271d3 100644 --- a/src/test/java/zacksolutions/TestLoginPage.java +++ b/src/test/java/zacksolutions/TestLoginPage.java @@ -3,28 +3,28 @@ package zacksolutions; import org.testng.annotations.Test; public class TestLoginPage { - @Test - public static void testCaseEleven() { - System.out.println("Debug the eleventh case"); - } + @Test + public static void testCaseEleven() { + System.out.println("Debug the eleventh case"); + } - @Test - public static void testCaseTwelve() { - System.out.println("Debug the twelfth case"); - } + @Test(groups = { "Smoke" }) + public static void testCaseTwelve() { + System.out.println("Debug the twelfth case"); + } - @Test - public static void testCaseThirteen() { - System.out.println("Debug the thirteenth case"); - } + @Test + public static void testCaseThirteen() { + System.out.println("Debug the thirteenth case"); + } - @Test - public static void testCaseFourteen() { - System.out.println("Debug the fourteenth case"); - } + @Test + public static void testCaseFourteen() { + System.out.println("Debug the fourteenth case"); + } - @Test - public static void testCaseFifteen() { - System.out.println("Debug the fifteenth case"); - } + @Test + public static void testCaseFifteen() { + System.out.println("Debug the fifteenth case"); + } } diff --git a/src/test/java/zacksolutions/TestNGClass.java b/src/test/java/zacksolutions/TestNGClass.java index bc0a08a..b1d0aa8 100644 --- a/src/test/java/zacksolutions/TestNGClass.java +++ b/src/test/java/zacksolutions/TestNGClass.java @@ -4,27 +4,28 @@ import org.testng.annotations.AfterTest; import org.testng.annotations.Test; public class TestNGClass { - @AfterTest - public static void testCaseOne(){ - System.out.println("Debug the firtst case ### AFTER TEST ###"); - } + @AfterTest + public static void testCaseOne() { + System.out.println("Debug the firtst case ### AFTER TEST ###"); + } - @Test - public void testCaseTwo(){ - System.out.println("Debugging the second case"); - } - @Test - public static void testCaseThree() { - System.out.println("Debug the third case"); - } + @Test(groups = { "Smoke" }) + public void testCaseTwo() { + System.out.println("Debugging the second case"); + } - @Test - public static void testCaseFour() { - System.out.println("Debug the fourth case"); - } + @Test + public static void testCaseThree() { + System.out.println("Debug the third case"); + } - @Test - public static void testCaseFive() { - System.out.println("Debug the fifth case"); - } + @Test + public static void testCaseFour() { + System.out.println("Debug the fourth case"); + } + + @Test + public static void testCaseFive() { + System.out.println("Debug the fifth case"); + } } diff --git a/src/test/java/zacksolutions/TestNGDiffClass.java b/src/test/java/zacksolutions/TestNGDiffClass.java index 9cda989..9a8235f 100644 --- a/src/test/java/zacksolutions/TestNGDiffClass.java +++ b/src/test/java/zacksolutions/TestNGDiffClass.java @@ -3,27 +3,28 @@ package zacksolutions; import org.testng.annotations.Test; public class TestNGDiffClass { - @Test - public void testCaseSix(){ - System.out.println("Debug the sixteenth case"); - } - @Test - public static void testCaseSeven() { - System.out.println("Debug the seventh case"); - } + @Test + public void testCaseSix() { + System.out.println("Debug the sixteenth case"); + } - @Test - public static void testCaseEight() { - System.out.println("Debug the eighth case"); - } + @Test + public static void testCaseSeven() { + System.out.println("Debug the seventh case"); + } - @Test - public static void testCaseNine() { - System.out.println("Debug the ninth case"); - } + @Test + public static void testCaseEight() { + System.out.println("Debug the eighth case"); + } - @Test - public static void testCaseTen() { - System.out.println("Debug the tenth case"); - } + @Test + public static void testCaseNine() { + System.out.println("Debug the ninth case"); + } + + @Test(groups = { "Smoke" }) + public static void testCaseTen() { + System.out.println("Debug the tenth case"); + } } diff --git a/testngGroups.xml b/testngGroups.xml new file mode 100644 index 0000000..37cad3e --- /dev/null +++ b/testngGroups.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +