Skip to content

Riverutz/demoqa-api-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demoqa-api-automation

Automated API testing framework for demoqa.com, targeting the Account and BookStore REST APIs.

🛠️ Tech Stack

  • Java 17
  • REST Assured - API request execution and response validation
  • TestNG - Test execution and assertions
  • Jackson - JSON deserialization into POJOs
  • Selenium WebDriver - UI automation for FE test scenarios
  • Lombok - Boilerplate code reduction
  • Maven - Build and dependency management

📁 Project Structure

src/test/
├── java/
│   ├── client/                   # ApiClient - base URI, content type, HTTP methods
│   ├── pages/                    # BasePage, LoginPage, ProfilePage (Selenium POM)
│   ├── requestObject/            # POJOs for request bodies
│   │   ├── GeneralObject.java    # Base class for JSON file loading
│   │   ├── RequestUser.java
│   │   ├── RequestISBN.java
│   │   ├── RequestAddBook.java
│   │   └── RequestReplaceBook.java
│   ├── responseObject/           # POJOs for response bodies
│   │   ├── BookObject.java
│   │   ├── ResponseUser.java
│   │   ├── ResponseGetUser.java
│   │   ├── ResponseGetUserFailed.java
│   │   └── ResponseToken.java
│   ├── services/                 # API service layer
│   │   ├── AccountService.java
│   │   └── BookStoreService.java
│   └── tests/                    # Test classes
│       ├── CreateUserBETest.java
│       ├── CreateUserFETest.java
│       └── BookStoreTest.java
└── resources/
    └── createUser.json

✅ Test Scenarios

Account - Back End

  • Create a new user
  • Generate authentication token
  • Validate user details
  • Delete user
  • Verify login fails after deletion

Account - Front End

  • Create user via API
  • Login via browser
  • Validate profile page
  • Delete account via UI

BookStore

  • Get all books
  • Get book by ISBN
  • Add book to user collection
  • Replace a book in user collection
  • Delete a specific book from user collection
  • Delete all books from user collection

▶️ How to Run

  1. Clone the repository git clone https://github.com/Riverutz/demoqa-api-automation.git
  2. Open in IntelliJ IDEA
  3. Run all tests via testng.xml

📋 Design Patterns

  • Service Layer Pattern - API calls encapsulated in service classes
  • Client Pattern - centralized HTTP client configuration
  • POJO Mapping - strongly typed request and response objects via Jackson
  • Page Object Model - Selenium pages separated from test logic
  • Data Driven Testing - dynamic test data via JSON files

About

REST Assured API test automation framework for DemoQA Bookstore — Java 17, TestNG, Jackson

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages