Robot Framework API tests for httpbin and examples. This repository contains:
- test cases in
test/using Robot Framework - a simple CI workflow in
.github/workflows/ci.yamlthat runs tests and uploads reports - a linter workflow in
.github/workflows/linter.yamlthat enforces formatting and lint rules
- A Git repository containing the full project (this repo) — push to GitHub to enable CI.
- This README with clear instructions for local setup, running tests, and viewing reports.
- Python 3.10+ (3.12 recommended)
- Docker (optional — only needed for the Docker-based runs or if you want to run httpbin in a container)
- git
- Clone the repository and change into it:
git clone <your-repo-url>
cd api-test-using-robot-framework- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install Python dependencies:
pip install --upgrade pip
pip install -r requirements.txtOptional: if you prefer to use Docker to isolate the environment, see Dockerfile and scripts/run_ci_locally.sh.
Run all Robot tests and generate HTML reports in the reports/ folder:
# ensure virtualenv is active
robot -d reports test/test_httpbin.robotAfter the run you will have reports/log.html, reports/report.html, and reports/output.xml.
- Open
reports/log.htmlorreports/report.htmlin a browser to inspect test output and failures locally. - In CI, the
ci.yamlworkflow uploads thereportsfolder as an artifact namedrobot-reports(retained for 7 days). Download it from the workflow run page.
There is a lint workflow (.github/workflows/linter.yaml) that runs on PRs and push to main and enforces:
- Black (Python formatter) — run in
--checkmode in CI; locally you can auto-format withblack . - Flake8 — static linting for Python
- yamllint — YAML linting
- JSON validation via
python -m json.tool
Run linting locally:
# format code
black .
# run linters
flake8 .
yamllint .If you want to enforce linting before merge, enable branch protection for main and add the Lint workflow as a required status check (Settings → Branches → Add rule).
CI no longer depends on the public httpbin.org: the simple CI workflow starts a local httpbin service and tests point at it via HTTPBIN_URL=http://localhost:8080 to avoid public service 503s.
If a CI run still returns 503 or empty responses:
- Check the workflow logs and look for the "Wait for httpbin readiness" step — it should confirm the local service is ready.
- Add a quick debug step to the workflow to
curl -v http://localhost:8080/get(I can add this if you'd like).
From the GitHub UI: Actions → select Robot Tests CI - Simple → Run workflow.
From the CLI (GitHub CLI):
gh workflow run ci.yaml --ref main
gh run watchDownload artifacts after a run:
gh run list
gh run download <run-id> --name robot-reports --dir ./downloaded-reportsUse the bundled script to reproduce the CI steps locally (sets up venv, installs deps, runs tests, packages reports):
./scripts/run_ci_locally.shThis repo includes a simple RabbitMQ test that publishes and consumes a message using a local RabbitMQ server.
Start the services with Docker Compose (this will start httpbin and rabbitmq):
docker-compose up -dThen run the RabbitMQ test locally (after the services are up):
robot -d reports test/test_rabbitmq.robotTo stop the services:
docker-compose downIf httpbin container is marked unhealthy or fails to start, try the following:
- Use the pinned
kennethreitz/httpbin:0.9.2image (already configured indocker-compose.yml). - Remove or relax custom healthchecks (some images do not include
curlin the container). - Wait for the service to be ready before running tests (the
robot-testsservice includes a small wait loop).
This repository includes a GitHub Actions workflow at .github/workflows/ci.yaml that:
- starts
rabbitmqandhttpbinas service containers for the job - installs Python dependencies from
requirements.txt - runs the Robot Framework tests under
test/and writes results toreports/ - uploads the
reportsdirectory as an artifact namedrobot-reports
To inspect artifacts after a CI run open the workflow run in the GitHub Actions UI and download the robot-reports artifact. You can reproduce the CI behavior locally with Docker Compose or the ./scripts/run_ci_locally.sh helper.