| Criteria | Smoke Testing | Sanity Testing |
|---|---|---|
| Goal | The goal of smoke testing is to uncover the critical or blocker issues in the application using the test cases that cover important functionalities of the application. | The goal of sanity testing is to check that the application is stable enough to proceed with further testing of the entire application. |
| Scope | The scope of smoke testing is to check the stability of the application by testing critical user journeys of the software. | The scope of sanity testing is to check only the specific functionality, verifying the bug fix or configuration or environment related changes. |
| When Performed? | Smoke testing should be performed after a new build is released after major code changes. | Sanity testing is performed after minor bug fixes, enhancements or before getting into comprehensive testing. |
| Test Cases | Test Ca |
| Criteria | JUnit 4 | JUnit 5 |
|---|---|---|
| Architecture | Everything was packaged together in a single JAR file. | Divided into 3 sub-projects: - JUnit Platform - JUnit Jupiter - JUnit Vintage |
| JDK Version Requirement | Requires Java 5 or higher | Requires Java 8 or higher |
| 3rd Party Integration | No 3rd party integration support for plugins and IDEs | Dedic |
| Feature | Description | Annotations/Methods |
|---|---|---|
| Test Suites | Test Suites are basically a group of tests, for example, Smoke, Sanity or a group of tests related to a particular feature. JUnit allows to create test suites that could be run together. | For using Test Suites, we need to add a JUnit Platform Suite dependency and use the follo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> | |
| <suite name="Sauce Demo Website Tests" parallel="tests" thread-count="4" verbose="2"> | |
| <test name="selenium 4 Tests with Chrome Browser"> | |
| <parameter name="browser" value="chrome"/> | |
| <classes> | |
| <class name="io.github.mfaisalkhatri.tests.saucedemo.SauceDemoTests"> | |
| <methods> | |
| <include name="loginSauceDemoTest"/> | |
| <include name="logOutSauceDemoTest"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> | |
| <suite name="Selenium 4 POC Tests "> | |
| <suite-files> | |
| <suite-file path="testng-saucedemo.xml"/> | |
| <suite-file path="testng-automationpractice.xml"/> | |
| <suite-file path="testng-theinternet.xml"/> | |
| <suite-file path="testng-juice-shop.xml"/> | |
| <suite-file path="testng-lambdatestecommerce.xml"/> | |
| <suite-file path="testng-seleniumgrid-theinternet.xml"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AppiumTest extends BaseTest{ | |
| @Test | |
| public void appiumServerTest () { | |
| System.out.println ("Server and Android Driver started successfully!!"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static io.github.mfaisalkhatri.drivers.DriverManager.createAndroidDriver; | |
| import static io.github.mfaisalkhatri.drivers.DriverManager.quitSession; | |
| import org.testng.annotations.AfterClass; | |
| import org.testng.annotations.BeforeClass; | |
| public class BaseTest { | |
| @BeforeClass | |
| public void testSetup() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DriverManager { | |
| private static final String APP_PATH = System.getProperty ("user.dir") + "\\src\\test\\resources\\app\\webdriverio-app.apk"; | |
| private static final ThreadLocal<AppiumDriver> DRIVER = new ThreadLocal<> (); | |
| private static final Logger LOG = LogManager.getLogger ("DriverManager.class"); | |
| private static AppiumDriverLocalService service; | |
| public static void createAndroidDriver () { | |
| startServer (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static AppiumDriverLocalService service; | |
| public static void createAndroidDriver () { | |
| startServer (); | |
| DRIVER.set (new AndroidDriver (service.getUrl (), setCapabilities ())); | |
| setupDriverTimeouts (); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static DesiredCapabilities setCapabilities () { | |
| DesiredCapabilities capabilities = new DesiredCapabilities (); | |
| capabilities.setCapability (MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID); | |
| capabilities.setCapability (MobileCapabilityType.DEVICE_NAME, "Pixel_5_API_30"); | |
| capabilities.setCapability (MobileCapabilityType.APP, APP_PATH); | |
| capabilities.setCapability ("appPackage", "com.wdiodemoapp"); | |
| capabilities.setCapability ("appActivity", "com.wdiodemoapp.MainActivity"); | |
| capabilities.setCapability ("noReset", false); | |
| capabilities.setCapability (MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2); | |
| return capabilities; |