How to master RobotCode Extension and Command Line Tools in real-life Robot Framework projects.
This workshop covers installation, setup, project structuring, python project managers, robot.toml configuration, key features, utilizing CLI tools, integrating CI/CD processes, and collaborating with distributed teams.
This workshop offers an in-depth introduction to the RobotCode Extension and Command Line Tools, focusing on their practical application in real-life Robot Framework projects.
Participants will gain hands-on experience and learn best practices to enhance their test automation workflows.
.venv.requirements.txt with all project dependencies.
robotframework-tidy helps with linting your project.Developer: Reload Window after installing .venv for RobotCode to get the new environment.Log vs. Log To Console
Debug: Group Output helps with more debug information
"robotcode.debug.groupOutput": true,Debug: Output Timestamps shows you the execution timestamps
"robotcode.debug.outputTimestamps": true.vscode/settings.json for local settings.
"robotcode.run.openOutputAfterRun": "log" if you want to auto open the log/report after each run."robotcode.debug.attachPython": truelog.html and it does not work out of the box.#exprmode enables/disables python expression mode (toggle).LibraryName + . and scroll the keywords.Keywords Dropdown./resources directory with *.resource files for Robot Framework Keywords.
/resources to the PYTHON_PATH./lib directory with *.py files for python keywords.
/lib to the PYTHON_PATH..resource and .py keyword files without using the absolute file path.settings.json for your personal local changes and do not commit to your Git-Repo!
Changelog.md.*.robot Files and Markdown.*** Settings *** or *** Variables *** sections.pip install robotcode-repl.robotcode repl.robot.toml Configuration:
robot.toml supports all possible configurations from toml.io.robot.toml.robotcode config files shows you all the robot.toml configuration files.robot.toml files exist for the user space and project space.
pyproject.toml.robot.toml.robot.toml = .robot.toml.
robotcode config root gives you the root directory, which is dependent on the position of the robot.toml file.robotcode config info gives you information on the config files.robotcode profiles show shows you the configuration with your selected profiles.robotcode -p profile_a -p profile_b robot.[variables] at the root level of the robot.toml file are used by all profiles.
[profiles.profile_a.variables].
[variables].[profiles.profile_a.extend-variables] the root-level variables are extended, meaning:
robotcode debug.robotcode analyze is a static code analyzer for your project.
# robotcode: ignore[KeywordNotFound].
robotcode: reset[KeywordNotFound].Configure within robot.toml:
[tool.robotcode-analyze.modifiers]
ignore=[KeywordNotFound]
robotcode will give you all commands with descriptions.robotcode discover will give information about Suites, Test Cases.
robotcode discover all . to look for whole project information.include/exclude tags etc.--format Option for printing results in a wanted format e.g. json for reuse in different projects..robotignore for excluding it from robotcode discover and speed up the discovery process or exclude local files for personal usage.robotcode analyze.robot.toml profiles to run CI settings on a local machine.robot.toml profiles for both local and CI environments to ensure consistency.src/demo via Hatch to create a .wheel file:
Ensure you have Hatch installed:
pip install hatch
Navigate to your project directory:
cd /path/to/your/project
Create a pyproject.toml file in the root of your project with the following content:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "your_project_name"
version = "0.1.0"
description = "Your project description"
readme = "README.md"
requires-python = ">=3.7"
license = {text = "MIT"}
[tool.hatch.build.targets.wheel]
packages = ["src/demo"]
Build the .wheel file:
hatch build
The .wheel file will be created in the dist directory. This file can then be uploaded to any package registry or distributed to other teams in different ways.
Add the following steps to your CI configuration:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Hatch
run: pip install hatch
- name: Build wheel
run: hatch build
- name: Upload wheel to registry
run: |
twine upload dist/*.whl
Commands for participants to try the distribution with Hatch themselves:
Navigate to your project directory:
cd /path/to/your/project
pyproject.toml file as described above.Build the .wheel file:
hatch build
.wheel file as needed.The workshop combines lectures, live demonstrations, and hands-on exercises.