Skip to content

BalamiRR/BookerApi-Testinium

Repository files navigation

🍂 🍃 Restful Booker API Test Automation 🍃 🍂

About

This project contains a fully automated test suite covering all endpoints of the Restful Booker API. Tests are written following the BDD (Behavior Driven Development) approach using Gherkin syntax, making them readable by both technical and non-technical stakeholders.

Covered API Endpoints

Method Endpoint Description
POST /auth Generate authentication token
GET /booking Get all booking IDs
GET /booking/:id Get a single booking
POST /booking Create a new booking
PUT /booking/:id Full update of a booking
PATCH /booking/:id Partial update of a booking
DELETE /booking/:id Delete a booking

Tech Stack

Technology Version Purpose
Python 3.11+ Core programming language
Robot Framework 7.0 Test automation framework
robotframework-requests 0.9.7 HTTP request library
Cucumber / Gherkin BDD Scenario definition language

Python Robot Framework oracle GitLab Bruno


Installation

Prerequisites

  • Python 3.11+
  • pip

Steps

# 1. Clone the repository
git clone https://github.com/your-username/restful-booker-robot-tests.git
cd restful-booker-robot-tests

# 2. Create a virtual environment (recommended)
python -m venv venv
venv\Scripts\activate           # Windows

# 3. Install dependencies
pip install -r requirements.txt

requirements.txt

robotframework==7.0
robotframework-requests
robotframework-seleniumlibrary
selenium
webdriver-manager

Running Tests

Run all tests

robot -d results tests/

Run a specific suite

robot -d reports tests/booking/create_booking_tests.robot

Run BDD / Cucumber scenarios

robot -d results --variable features/create_booking.feature

Test Scenarios

Example Gherkin Scenario

*** Settings ***
Resource    ../step-definition/booking.step.robot
Suite Setup    the API service is available at the configured url

*** Test Cases ***
Scenario: Create a new booking and verify the details
    [Tags]    Regression
    [Documentation]    Create a new booking and verify the details
    Given the API service is available at the configured url
    When the user creates a booking with the following details
    ...    John    Wick    500    true    2026-05-01    2026-05-10
    Then the response status code should be 200
    And the created booking should have the firstname "John"
    And the API responds with a status code "200"

Scenario: Get all bookings and verify the list
    [Tags]    Regression
    [Documentation]    Get all bookings and verify the list is not empty
    When the user requests all bookings
    Then the response status code should be 200
    And the booking list should not be empty

GitLab Pipeline Result

  • Successful pipeline execution screenshot:
  • This shows that the tests were executed successfully within the GitLab pipeline and passed the sanity frontend stage. alt text

📊 Test Reports

After running the tests, the following reports are generated in the results/ folder:

File Description
report.html High-level test summary report
log.html Detailed step-by-step execution log
output.xml XML output for CI/CD integration

License

This project is licensed under the MIT License. See the LICENSE file for details.


About

Python, RobotFramework, Cucumber(BDD), Bruno API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors