Welcome to the TestJeff Course Repository for mastering API Testing with Python and Behave. This repo contains hands-on examples, Docker integration, and complete test automation pipelines for REST, SOAP, GraphQL, WebSocket, and RPC APIs.
This repository supports the TestJeff API Testing Course. You'll learn how to:
- Structure and write Gherkin feature files
- Create step definitions using Behave
- Test various API protocols: REST, SOAP, GraphQL, WebSocket, and JSON-RPC
- Run tests in Dockerized environments
- Integrate with CI and generate test reports
test/
└── features/
├── environment/ # Global setup and teardown logic
├── steps/ # Step definitions (.py)
├── support/ # Utility modules
└── *.feature # Gherkin feature files
.env # API keys and configuration variables
docker-compose.yml # Optional Docker services
reports/ # Test output (e.g., JUnit, HTML)
- Docker
- VS Code
- Python 3.10+ (if running outside Docker)
- API keys for third-party APIs (Finnhub, etc.)
git clone https://github.com/testjeff/testjeff-course-python-behave-api.git
cd testjeff-course-python-behave-api
FINNHUB_API_KEY=your_api_key_here
NEWS_API_KEY=your_api_key_here
WEATHER_API_KEY=your_api_key_here
docker build -t behave-test .
Use the preconfigured VS Code tasks:
Docker: Run Welcome Feature Only
Docker: Run Finnhub REST API Test
Docker: Run All Behave Tests
Or run manually:
docker run --rm --env-file .env -v ${PWD}/reports:/app/reports behave-test behave test/features
Feature: Get stock quote from Finnhub API
Scenario: Successful stock quote fetch for AAPL
Given I have a valid API key
When I request a stock quote for "AAPL"
Then the response status should be 200
And the current price should be a positive number
Refer to the Module Guide included with the course to follow along lesson by lesson and get the most out of the provided examples.
Try using Copilot to:
- Auto-generate step definitions from feature files
- Extend test coverage for edge cases
- Refactor and improve test logic
Pull requests are welcome! If you have ideas for extending this project or submitting test cases, feel free to fork and contribute.
MIT License — see LICENSE
file for details.
This repo is part of the TestJeff API Testing Course on Udemy.
Follow along with hands-on lessons, module guides, and real automation projects:
- 🚀 Join the Course on Udemy
- 🧑💻 Get step-by-step guidance while working directly with this repo.
- 📂 Build a portfolio-ready test automation project.
Be part of the growing Test Automation Community of Practice (CoP) — a place to connect, learn, and share with other testers and automation engineers:
- 🌐 Join the Community on Skool
- 🤝 Network with software testers and automation professionals.
- 📚 Access bonus resources, discussions, and live Q&A sessions.
- 🚀 Stay ahead with the latest in AI-powered test automation.