A Selenium-based automated testing framework for Flipkart's e-commerce web application. This project implements the Page Object Model design pattern to create maintainable and scalable UI tests.
- Overview
- Features
- Project Structure
- Test Scenarios
- Tech Stack
- Setup Instructions
- Running Tests
- Test Reports
- Future Enhancements
This project provides end-to-end test automation for Flipkart's critical user journeys, specifically focusing on the product search and shopping cart functionality. The automated tests help ensure that users can search for products, add items to their cart, and manage product quantities without encountering issues.
- Page Object Model implementation for improved test maintenance
- Automated test scenarios for shopping cart functionality
- Cross-window interactions handling
- ExtentReports integration for detailed HTML reports
- Screenshot capture on test failure
- Robust waits and synchronization
flipkart-ui-e2e-test/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── flipkart/
│ │ │ ├── pages/
│ │ │ │ ├── HomePage.java
│ │ │ │ ├── ProductListPage.java
│ │ │ │ ├── ProductPage.java
│ │ │ │ └── Add2CartPage.java
│ │ │ └── utils/
│ │ │ └── ExtentReporterNG.java
│ ├── test/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── flipkart/
│ │ │ ├── base/
│ │ │ │ └── BaseTest.java
│ │ │ ├── testComponents/
│ │ │ │ └── Listeners.java
│ │ │ └── tests/
│ │ │ └── Add2CartTest.java
│ │ └── resources/
│ │ └── testng.xml
├── reports/
│ └── index.html
├── pom.xml
└── README.md
The framework currently tests the following scenarios:
-
Add to Cart Test
- Search for a Samsung A54 product
- Select a specific model
- Add product to cart
- Verify the correct product is added
- Increase quantity to 3
- Verify cart price calculation
-
Add Multiple Items to Cart Test
- Search for a Samsung A54 product
- Add a specific model to cart
- Add another different model to cart
- Verify cart price calculation for multiple items
-
Maximum Quantity Test
- Search for a Samsung A54 product
- Select a specific model
- Add product to cart
- Attempt to increase quantity beyond the allowed limit (5)
- Verify the quantity error message
- Java 11
- Selenium WebDriver 4.17.0
- TestNG 7.9.0
- ExtentReports 5.0.9
- Maven
- Chrome WebDriver
-
Prerequisites
- Java 11 or higher
- Maven
- Chrome browser
-
Clone the repository
git clone https://github.com/yourusername/flipkart-ui-e2e-test.git cd flipkart-ui-e2e-test -
Install dependencies
mvn clean install
mvn testmvn test -Dtest=Add2CartTestmvn test -DsuiteXmlFile=testng.xmlAfter running the tests, detailed HTML reports are generated in the reports directory. Open reports/index.html in a browser to view:
- Test execution summary
- Individual test results
- Execution timeline
- System information
- Screenshots of failures (if any)
- M. Mohammed Lukmanudhin
Mohammed Lukmanudin M - GitHub Profile