Skip to content

UI + API test framework for QACart Todo App using Java, Selenium, REST Assured & TestNG. Uses POM with fluent chaining. Covers login, task creation/deletion (UI + API). Built with DriverFactory, shared base classes, and CI/CD-ready structure.

Notifications You must be signed in to change notification settings

OmarElsheikh1/todo-app-qa-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ Todo Application Test Automation Framework

GitHub Actions

Java Selenium RestAssured TestNG Maven Allure

A comprehensive automation framework for testing a Todo application, covering both UI workflows and API endpoints with robust test cases and reporting capabilities.


🚀 Features

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

📁 Framework Structure

├── 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

🛠 Technologies Used

  • Languages: Java 17+
  • Testing Frameworks: TestNG, RestAssured
  • Web Automation: Selenium WebDriver 4.0+
  • Reporting: Allure Framework
  • Dependency Management: Maven
  • Test Data: JavaFaker

Test Coverage

API Tests

  • ✅ Authentication (Login/Logout)
  • ✅ Todo CRUD operations
  • ✅ Error handling (400/401/404 responses)
  • ✅ Data validation
  • ✅ Authorization checks

UI Tests

  • ✅ User registration and login
  • ✅ Todo management (add/complete/delete)
  • ✅ Form validation
  • ✅ Session management
  • ✅ Error message verification

▶️ Getting Started

✅ Prerequisites

  • Java 17 JDK

  • Maven 3.8+

  • Chrome, Firefox or Edge installed

🛠️ Installation

  1. Clone the repository
git clone https://github.com/your-username/todo-test-automation.git
  1. Navigate to the project directory
cd todo-test-automation
  1. Install dependencies
mvn clean install
  1. 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

▶️ Run Your Tests

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

📊 View the Allure Report

After running the tests:

allure serve allure-results

This will open an interactive test report in your browser.


💡 Key Snippets

Hybrid Flow: API → UI

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();

Environment Configuration

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");
}

🚦 Best Practices Implemented

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


🤝 Contributing

  1. Fork the repository

  2. Create a feature branch:

git checkout -b feature/your-feature
  1. Commit your changes:
git commit -m "Add: brief description"
  1. Push and open a Pull Request

🤝 Contact

If you have any questions, suggestions, or want to collaborate, feel free to reach out.

📧 [email protected]
🔗 LinkedIn

About

UI + API test framework for QACart Todo App using Java, Selenium, REST Assured & TestNG. Uses POM with fluent chaining. Covers login, task creation/deletion (UI + API). Built with DriverFactory, shared base classes, and CI/CD-ready structure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages