A comprehensive automation framework for testing a Todo application, covering both UI workflows and API endpoints with robust test cases and reporting capabilities.
Hybrid Testing: UI tests with Selenium WebDriver + API tests with RestAssured
Multi‑Environment: Easily switch between local, staging, and production via properties
Page Object Model: Separation of page logic from test logic for maintainability
Allure Reporting: Interactive test reports and failure screenshots
Parallel Execution: Thread‑safe WebDriver via ThreadLocal
Data‑Driven: Dynamic test data generation with JavaFaker
├── src/
│ ├── main/
│ │ └── java/com/omarelsheikh/todo/
│ │ ├── api/
│ │ │ ├── config/ # API endpoints
│ │ │ └── models/ # API POJOs
│ │ ├── drivers/ # WebDriver factory
│ │ ├── models/ # Domain models (Todo, User)
│ │ ├── pages/ # Page Object classes
│ │ └── utils/ # Config + properties management
│ └── test/
│ └── java/com/omarelsheikh/todo/
│ ├── api/
│ │ ├── requests/ # API call wrappers
│ │ ├── testcases/ # API test cases
│ │ └── utils/ # API helper utilities
│ ├── base/ # Shared BaseTest class
│ ├── ui/
│ │ └── testcases/ # UI test cases
│ └── utils/ # Test data utilities
├── resources/
│ └── config/
│ ├── local.properties
│ └── production.properties
- Languages: Java 17+
- Testing Frameworks: TestNG, RestAssured
- Web Automation: Selenium WebDriver 4.0+
- Reporting: Allure Framework
- Dependency Management: Maven
- Test Data: JavaFaker
- ✅ Authentication (Login/Logout)
- ✅ Todo CRUD operations
- ✅ Error handling (400/401/404 responses)
- ✅ Data validation
- ✅ Authorization checks
- ✅ User registration and login
- ✅ Todo management (add/complete/delete)
- ✅ Form validation
- ✅ Session management
- ✅ Error message verification
-
Java 17 JDK
-
Maven 3.8+
-
Chrome, Firefox or Edge installed
- Clone the repository
git clone https://github.com/your-username/todo-test-automation.git
- Navigate to the project directory
cd todo-test-automation
- Install dependencies
mvn clean install
- Configure environments Edit the file based on the target environment:
src/test/resources/config/local.properties or production.properties
Example:
baseUrl = https://todo.qacart.com
email = [email protected]
password = Test1234
By default, tests run on Chrome using the production environment:
mvn clean test
You can also customize:
Change browser:
mvn clean test -Dbrowser=firefox
mvn clean test -Dbrowser=edge
Change environment:
mvn clean test -Denv=local
Use both:
mvn clean test -Dbrowser=firefox -Denv=production
After running the tests:
allure serve allure-results
This will open an interactive test report in your browser.
Copy
Edit
// Register via API
RegisterApi registerApi = new RegisterApi();
registerApi.register();
// Inject cookies into the browser session
injectCookiesToBrowser(registerApi.getCookies());
// Continue with UI tests
TodoPage todoPage = new TodoPage(driver);
todoPage.load();
String env = System.getProperty("env", "PRODUCTION").toUpperCase();
switch (env) {
case "PRODUCTION":
properties = load("production.properties");
break;
case "LOCAL":
properties = load("local.properties");
break;
default:
throw new RuntimeException("Environment not supported");
}
Separation of Concerns: API, UI, and test layers cleanly divided
Singleton Config: Centralized environment config loading
Thread Safety: ThreadLocal for parallel runs
Fluent Interfaces: Chainable page object methods
Robust Reporting: Allure annotations, steps, and screenshots
Data Generation: Randomized test data with JavaFaker
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add: brief description"
- Push and open a Pull Request
If you have any questions, suggestions, or want to collaborate, feel free to reach out.