A robust test automation framework for e-commerce applications using Selenium WebDriver, TestNG, and Java with Page Object Model design pattern.
Demo Video : https://github.com/user-attachments/assets/ed38ad5d-d411-4e81-99f3-7a936a470ad5
- Page Object Model implementation for maintainable test code
- Data-Driven Testing with JSON data files
- TestNG integration for test execution and reporting
- Error Handling with dedicated validation tests
- Cross-Browser support (configurable)
- Screenshot capability for test failures
- Grouping Tests for selective execution
- Dependent Tests for order verification
e-commerce-test-framework/
├── src/
│ ├── main/
│ │ └── java/
│ │ ├── abstractComponents/
│ │ │ └── AbstractComponent.java
│ │ ├── pageObjects/
│ │ │ ├── CartPage.java
│ │ │ ├── LandingPage.java
│ │ │ ├── OrderPage.java
│ │ │ ├── PlaceOrderPage.java
│ │ │ ├── ProductCatalogue.java
│ │ │ └── SubmitPage.java
│ │ └── testComponents/
│ │ └── BaseTest.java
│ └── test/
│ ├── java/
│ │ ├── testData/
│ │ │ └── DataReader.java
│ │ └── tests/
│ │ ├── ErrorValidationsTest.java
│ │ ├── StandAloneTest.java
│ │ └── SubmitOrderTest.java
│ └── resources/
│ ├── testData/
│ │ └── purchaseOrder.json
│ └── config/
│ ├── globalData.properties
│ ├── errorHandling.xml
│ ├── purchcase.xml
│ └── testng.xml
├── target/
├── pom.xml
└── README.md- ☕ Java JDK 8+
- 🧰 Maven 3.6.3+
- 🌐 Chrome/Firefox (latest version)
- ⚙️ Selenium WebDriver 4.0.0+
- 🧪 **TestNG 7.4.
- Clone the repository:
git clone https://github.com/ibrahim3rafa/E-commerce-Application-Demo.git
Update globalData.properties with your browser preferences:
browser=chrome
[
{
"mail": "your-email@example.com",
"pass": "your-password",
"productName": "PRODUCT_NAME"
}
]Login Error Validation - Verifies incorrect login scenarios
Product Validation - Checks product presence in cart
Order Submission - Complete purchase flow
Order Verification - Confirms order appears in history
-
baseTest.java: Base class with setup/teardown and utilities
-
abstractComponent.java: Reusable WebDriver methods
-
Page Objects: Represent application pages and elements
-
Data Providers: Supply test data from JSON files
-
Follows Page Object Model pattern
-
Uses explicit waits for element interactions
-
Implements clean separation of test code and page logic
-
Supports parallel test execution
-
Includes screenshot capability for debugging
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.