This project automates the core e-commerce flows on the TutorialsNinja platform using Selenium WebDriver, TestNG, and Java. It includes comprehensive test cases covering:
- Login
- Registration
- Product Search
- Add to Cart
- Checkout
- Login Automation: Validates user login functionality.
- Registration Automation: Automates the registration process and email verification.
- Add to Cart Automation: Validates the add to cart process.
- Product Search Automation: Validates the product search functionality.
- Checkout Automation: Validates the checkout process after registration.
- Extent Reports Integration: Generates detailed test execution reports.
- Data-Driven Testing: Uses JSON files for managing test data.
- Html Formatting: Provides a well-structured HTML report for test results.
Component | Technology |
---|---|
Programming Language | Java |
Build Tool | Maven |
Testing Framework | TestNG |
Web Automation | Selenium WebDriver |
Reporting Tool | Extent Reports |
JSON Parsing | Jackson Library |
tutorials-ninja-automation/
├── src/
│ ├── main/
│ │ ├── java/ # Page objects, utilities, constants
│ │ └── resources/ # Test data in JSON format
│ └── test/
│ ├── java/ # Test classes, TestNG listeners
│ └── resources/ # TestNG XML configuration
- Java: JDK 17 or higher
- Maven: Installed and configured
- Browser: Microsoft Edge (used by default)
- IDE: IntelliJ IDEA (recommended)
-
Clone the repository:
git clone https://github.com/mansigarg10/tutorials-ninja-automation.git
-
Open the project in IntelliJ IDEA.
-
Use Maven to install dependencies:
mvn clean install
-
Update JSON files in
src/main/resources/
with valid test data.
-
To run all tests via Maven:
mvn test
-
To run specific tests: Use corresponding TestNG XML files located in root directory.
Test data is maintained as JSON files:
File Name | Purpose |
---|---|
Login.json |
Login credentials |
Register.json |
User registration info |
Search.json |
Product search info |
Test execution reports are generated using Extent Reports and saved at:
/docs/index.html
Make sure the screenshot paths in the reports are valid and accessible.
You can view the latest test execution report hosted via GitHub Pages:
The report includes structured HTML output and embedded screenshots. Ensure paths are properly updated post-generation for accurate rendering.
RegisterPage
– Manages user registrationAccountSuccessPage
– Displays account creation success messageLoginPage
– Handles login functionalityHomePage
– Manages navigation and common operationsSearchPage
– Manages product searchProductDisplayPage
– Displays product detailsShoppingCartPage
– Manages cart operationsCheckoutPage
– Handles checkout processOrderSuccessPage
– Displays order confirmation details
RegisterTest
– Validates user registration functionalityLoginTest
– Validates user login functionalitySearchTest
– Validates product search functionalityAddToCartTest
– Validates add to cart functionalityCheckoutTest
– Validates checkout process
TutorialsNinjaConstants
– Contains constant values used across the frameworkBaseTest
– Handles common setup/tear-down methodsHtmlFormatter
– Formats HTML files by removing leading empty lines
- Ensure that the JSON test data files are properly formatted to avoid deserialization errors.
- Screenshot paths used in Extent Reports must be accessible to render properly.
Contributions are welcome! Feel free to open issues or submit pull requests.
For major changes, please open an issue first to discuss what you'd like to change.
You can also suggest enhancements for tests, reporting, or refactoring strategies.
This project is licensed under the MIT License.
Mansi Garg