Welcome to the Robot Framework Template Repository! This repository provides a structured starting point for your automated testing projects using Robot Framework and Python.
Official repository: github.com/BVisagie/robot-framework-template
- Directory Structure
- Sample Test Cases
- Getting Started
- Notes and recommendations
- Customization Options
- A word on Coding Style
- Authors
The repository comes with a pre-configured directory structure to keep your project organized and to stick with reference Robot Framework Guidelines:
├── .github
│ └── workflows
│ └── ci-cd.yml
├── data
│ ├── your_project
│ ├── shared_data
├── libraries
│ ├── robot_framework
│ └── common.resource
│ └── database_library.resource
│ └── requests_library.resource
│ └── web_testing_library.resource
├── resources
│ ├── common
│ ├── common_python
│ ├── your_project
│ └── your_project_keywords.resource
├── tests
│ ├── your_project
│ └── your_test_cases.robot
├── requirements.txt
├── .gitattributes
├── .gitignore
├── README.md
- .github/workflows: GitHub Actions workflows for CI/CD.
- data: Contains items like test data files, and other static data - like Python or Yaml Variable files and are organized in subfolders in the data/ folder.
- libraries: Stores references to libraries that might be used or referenced by various
.resource
files. - resources: Stores resource files such as shared keywords and project specific keywords.
- tests: All test cases start here.
- requirements.txt: Lists all Python dependencies required for the project.
To help you get started, the repository includes example test cases. These examples demonstrate basic usage and can be modified to suit your needs. They serve as a reference for creating your own test cases.
Currently, the sample test cases cover:
- Basic user interface testing using the web testing library powered by Playwright
- This may be found in sections related to:
project_wikipedia
- This may be found in sections related to:
- Basic API testing using the RequestsLibrary for Robot Framework
- This may be found in sections related to:
project_json_placeholder
- This may be found in sections related to:
- Basic Database testing using the DatabaseLibrary for Robot Framework
- This may be found in sections related to:
project_database
- Please note that the database tests are not meant to be functional as including real database details and running real queries are beyond the scope of this template repository at this time.
- This may be found in sections related to:
- Python >=
3.13
- Node.js >=
22
- Robot Framework >=
7.1.1
- Please see
requirements.txt
for all other Python and Robot Framework dependencies
For step-by-step setup on your OS (Python 3.13+, Node 22+, venv, Playwright deps, and Browser init), follow the Quickstart Guides:
- Linux: docs/quickstart-linux.md
- Windows: docs/quickstart-windows.md
# Lint and format checks (Robocop v6+)
robocop check .
robocop format .
# Run API tests
robot --outputdir output tests/project_json_placeholder/api_tests
# Run UI tests (headless by default)
robot --outputdir output tests/project_wikipedia/ui_tests
- Linux: docs/quickstart-linux.md
- Windows: docs/quickstart-windows.md
- Docker: docs/quickstart-docker.md
Optional developer tooling:
# Install dev tools (pre-commit, Robocop v6+, Ruff)
pip install -r requirements-dev.txt
pre-commit install
See the platform-specific Quickstart Guides for creating, activating, and using a virtual environment.
- IDE and plugins
- Primary recommendation: RobotCode — multi‑IDE language server, debugger, analyzer, REPL, refactoring, profiles via
robot.toml
. - Alternative: Hyper RobotFramework Support.
- Editors: VS Code or JetBrains IDEs both work well.
- Tip: enable Robotidy/Robocop integration or use pre‑commit to keep quality consistent.
- Primary recommendation: RobotCode — multi‑IDE language server, debugger, analyzer, REPL, refactoring, profiles via
- Linting/formatting
This template is designed to be flexible and easily extendable. You can:
- Add new test cases, resources, keywords, and variables to fit your specific requirements.
- Modify the GitHub Actions workflow to include additional steps or custom scripts.
- Update the requirements.txt file to include any additional dependencies.
HEADLESS_BROWSER
(true/false) to control headless mode (defaults to true).WIKIPEDIA_BASE_URL
to override the default Wikipedia base URL.- Database-related variables (examples only):
DB_HOST
,DB_PORT
,DB_SERVICE_NAME
,DB_USER
,DB_PASSWORD
,DB_API_MODULE
.
- Regarding Tabs or Spaces: four spaces are the preferred indentation method as set out by Python PEP 8 standards.
If you are used to using TAB, just set TABBING to go four spaces in your IDE.
- Robot Framework User Guide - Space Separated Format
- Official Python style guides regarding Tabs or Spaces.
- Prefer native Robot Framework syntax, libraries, and patterns. Use Python only when a clear gap exists.
- Examples here keep Python to a minimum (e.g., a single helper function) and showcase RF v7+ features.
- DB examples are placeholders, tagged to avoid accidental execution.
- You can optionally provide DB settings through environment variables and build a
&{db}
dictionary using the provided keyword. - See the keywords in
resources/project_database/db_actions_and_verifications.resource
for details.
- Bernard Visagie