Welcome to the TestJeff Course Repository for mastering API Testing with Node.js and Cucumber. 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 Cucumber.js
- 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/
│ ├── support/ # Cucumber hooks (setup/teardown)
│ ├── steps/ # Step definitions (.js)
│ └── *.feature # Gherkin feature files
└── utils/ # Custom assertion helpers
.env # API keys and configuration variables
cucumber.js # Cucumber configuration
reports/ # Test output (e.g., JUnit, HTML)
- Docker
- VS Code
- Node.js 18+ (if running outside Docker)
- API keys for third-party APIs (Finnhub, etc.)
git clone https://github.com/testjeff/testjeff-course-node-cucumber-api.git
cd testjeff-course-node-cucumber-apiFINNHUB_API_KEY=your_api_key_here
ANKRETH_API_KEY=your_api_key_heredocker build -t cucumber-test .Use the preconfigured VS Code tasks:
Docker: Run Welcome from TestJeffDocker: Run Finnhub REST API TestDocker: Run TempConvert SOAP API TestDocker: Run Rick and Morty GraphQL API TestDocker: Run Bitstamp WebSocket API TestDocker: Run AnkrETH RPC API TestDocker: Run All Cucumber Tests
Or run manually:
docker run --rm --env-file .env -v ${PWD}/reports:/app/reports --entrypoint npx cucumber-test cucumber-js test/features --format json:reports/cucumber-report.json --format junit:reports/junit-report.xmlOr, outside Docker:
npm install
npm testFeature: 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
And the response should contain required quote fieldsRefer 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.
ISC License — see package.json for details.