robotframework-debug 4.4.0__tar.gz → 4.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotframework_debug-4.6.0/.github/workflows/pythonpublish.yml +31 -0
- robotframework_debug-4.6.0/.github/workflows/test.yml +57 -0
- robotframework_debug-4.6.0/.gitignore +22 -0
- robotframework_debug-4.6.0/CONTRIBUTION.md +112 -0
- robotframework_debug-4.6.0/PKG-INFO +206 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/RobotDebug.py +74 -3
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/__init__.py +4 -2
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/cmdcompleter.py +43 -28
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/debugcmd.py +16 -9
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/globals.py +2 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/history_app.py +8 -4
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/lexer.py +6 -34
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/prompttoolkitcmd.py +11 -1
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/robotkeyword.py +18 -18
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/robotlib.py +24 -3
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/shell.py +1 -1
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/sourcelines.py +14 -21
- robotframework_debug-4.6.0/RobotDebug/version.py +7 -0
- robotframework_debug-4.6.0/docs/compatibility_matrix.md +15 -0
- robotframework_debug-4.6.0/docs/development.md +206 -0
- robotframework_debug-4.6.0/pyproject.toml +109 -0
- robotframework_debug-4.6.0/readme.md +171 -0
- robotframework_debug-4.6.0/res/Shift_down.gif +0 -0
- robotframework_debug-4.6.0/res/docs.png +0 -0
- robotframework_debug-4.6.0/res/help_image.png +0 -0
- robotframework_debug-4.6.0/res/help_res.png +0 -0
- robotframework_debug-4.6.0/res/import.png +0 -0
- robotframework_debug-4.6.0/res/irobot.png +0 -0
- robotframework_debug-4.6.0/res/keywords_and_variables_irobot.png +0 -0
- robotframework_debug-4.6.0/res/libs_image.png +0 -0
- robotframework_debug-4.6.0/res/list_command.png +0 -0
- robotframework_debug-4.6.0/res/live_completion.gif +0 -0
- robotframework_debug-4.6.0/res/multiline_example.png +0 -0
- robotframework_debug-4.6.0/res/resource.png +0 -0
- robotframework_debug-4.6.0/res/toggle_mouse_on.gif +0 -0
- robotframework_debug-4.6.0/tasks.py +92 -0
- robotframework_debug-4.6.0/tests/atest/DebugShell.py +92 -0
- robotframework_debug-4.6.0/tests/atest/fixtures/debug_task.robot +10 -0
- robotframework_debug-4.6.0/tests/atest/fixtures/error_task.robot +13 -0
- robotframework_debug-4.6.0/tests/atest/fixtures/keywords.resource +13 -0
- robotframework_debug-4.6.0/tests/atest/fixtures/step_task.robot +11 -0
- robotframework_debug-4.6.0/tests/atest/resources/shell.resource +61 -0
- robotframework_debug-4.6.0/tests/atest/suites/01_repl_basics.robot +89 -0
- robotframework_debug-4.6.0/tests/atest/suites/02_repl_commands.robot +64 -0
- robotframework_debug-4.6.0/tests/atest/suites/03_debug_keyword.robot +54 -0
- robotframework_debug-4.6.0/tests/atest/suites/04_listener_error.robot +47 -0
- robotframework_debug-4.6.0/tests/atest/suites/05_step_debugging.robot +46 -0
- robotframework_debug-4.6.0/tests/compat/run_matrix.py +233 -0
- robotframework_debug-4.6.0/tests/debug.robot +4 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/tests/step.robot +1 -0
- robotframework-debug-4.4.0/PKG-INFO +0 -210
- robotframework-debug-4.4.0/README.rst +0 -176
- robotframework-debug-4.4.0/RobotDebug/version.py +0 -1
- robotframework-debug-4.4.0/_config.yml +0 -1
- robotframework-debug-4.4.0/pyproject.toml +0 -48
- robotframework-debug-4.4.0/robotframework_debug.egg-info/PKG-INFO +0 -210
- robotframework-debug-4.4.0/robotframework_debug.egg-info/SOURCES.txt +0 -35
- robotframework-debug-4.4.0/robotframework_debug.egg-info/dependency_links.txt +0 -1
- robotframework-debug-4.4.0/robotframework_debug.egg-info/entry_points.txt +0 -3
- robotframework-debug-4.4.0/robotframework_debug.egg-info/not-zip-safe +0 -1
- robotframework-debug-4.4.0/robotframework_debug.egg-info/requires.txt +0 -4
- robotframework-debug-4.4.0/robotframework_debug.egg-info/top_level.txt +0 -1
- robotframework-debug-4.4.0/setup.cfg +0 -12
- robotframework-debug-4.4.0/setup.py +0 -61
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/.coveragerc +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/.gitpod.yml +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/ChangeLog +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/CreateWheel.sh +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/LICENSE +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/MANIFEST.in +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/RobotDebug/styles.py +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/tests/__init__.py +0 -0
- {robotframework-debug-4.4.0 → robotframework_debug-4.6.0}/tests/test_debuglibrary.py +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This workflows will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
name: Upload Python Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
deploy:
|
|
12
|
+
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v2
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v1
|
|
19
|
+
with:
|
|
20
|
+
python-version: '3.x'
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: |
|
|
23
|
+
python -m pip install --upgrade pip
|
|
24
|
+
pip install setuptools wheel twine
|
|
25
|
+
- name: Build and publish
|
|
26
|
+
env:
|
|
27
|
+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
28
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
29
|
+
run: |
|
|
30
|
+
python setup.py sdist bdist_wheel
|
|
31
|
+
twine upload dist/*
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: test
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [ master ]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: py-${{ matrix.python-version }} rf-${{ matrix.robotframework-version }} ${{ matrix.platform }}
|
|
14
|
+
runs-on: ${{ matrix.platform }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
|
|
19
|
+
robotframework-version: [3.2, 4.1, 5.0]
|
|
20
|
+
platform: [ubuntu-latest, macOS-latest]
|
|
21
|
+
exclude:
|
|
22
|
+
- python-version: 3.6
|
|
23
|
+
platform: macOS-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v2
|
|
26
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
+
uses: actions/setup-python@v1
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
pip install flake8
|
|
34
|
+
pip install coverage
|
|
35
|
+
pip install robotframework==${{ matrix.robotframework-version }}
|
|
36
|
+
- name: Lint with flake8
|
|
37
|
+
run: |
|
|
38
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
39
|
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
|
|
40
|
+
- name: Test
|
|
41
|
+
run: |
|
|
42
|
+
python setup.py develop
|
|
43
|
+
python setup.py test
|
|
44
|
+
- name: Generate coverage report
|
|
45
|
+
run: |
|
|
46
|
+
coverage xml
|
|
47
|
+
- name: Send coverage report to codecov
|
|
48
|
+
uses: codecov/codecov-action@v1
|
|
49
|
+
with:
|
|
50
|
+
file: ./coverage.xml
|
|
51
|
+
- name: Send coverage report to codeclimate
|
|
52
|
+
uses: paambaati/codeclimate-action@v2.6.0
|
|
53
|
+
with:
|
|
54
|
+
coverageCommand: echo "Ignore rerun"
|
|
55
|
+
coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py
|
|
56
|
+
env:
|
|
57
|
+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*.egg-info
|
|
2
|
+
build
|
|
3
|
+
dist
|
|
4
|
+
*.pyc
|
|
5
|
+
*.txt
|
|
6
|
+
*.robot
|
|
7
|
+
log.html
|
|
8
|
+
output.xml
|
|
9
|
+
report.html
|
|
10
|
+
.venv
|
|
11
|
+
TODO
|
|
12
|
+
.eggs/
|
|
13
|
+
.vscode
|
|
14
|
+
.DS_Store
|
|
15
|
+
*.log
|
|
16
|
+
.coverage
|
|
17
|
+
.coverage.*
|
|
18
|
+
htmlcov
|
|
19
|
+
coverage.xml
|
|
20
|
+
coverage.json
|
|
21
|
+
results
|
|
22
|
+
.matrix
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Contributing to RobotDebug
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve `robotframework-debug`! This guide covers local
|
|
4
|
+
setup, running and debugging the tool, testing, and cutting a release.
|
|
5
|
+
|
|
6
|
+
For the design of the test suite and the cross-version compatibility work, see
|
|
7
|
+
[`docs/development.md`](docs/development.md).
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
RobotDebug uses a PEP 621 `pyproject.toml` with the [Flit](https://flit.pypa.io)
|
|
12
|
+
build backend. Install it in editable mode with the development extras:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# with uv (recommended)
|
|
16
|
+
uv venv
|
|
17
|
+
uv pip install -e ".[dev]"
|
|
18
|
+
|
|
19
|
+
# or with pip
|
|
20
|
+
python -m venv .venv && source .venv/bin/activate
|
|
21
|
+
pip install -e ".[dev]"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `dev` extra pulls in `invoke`, `ruff`, `black`, `pexpect` and `flit`.
|
|
25
|
+
The compatibility matrix additionally requires [`uv`](https://docs.astral.sh/uv/)
|
|
26
|
+
on your `PATH`.
|
|
27
|
+
|
|
28
|
+
## Running RobotDebug locally
|
|
29
|
+
|
|
30
|
+
Run the standalone shell against a sample suite:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python RobotDebug/shell.py tests/step.robot
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`shell.py` launches `robot` in a **child process**, which interrupts Python
|
|
37
|
+
debugging. To set breakpoints in tools like VS Code or `pdb`, run the suite
|
|
38
|
+
directly instead:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python -m robot tests/step.robot
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Robot Framework takes over `stdout`, so emit debugging output explicitly:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import sys
|
|
48
|
+
print("some information", file=sys.stdout)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Testing
|
|
52
|
+
|
|
53
|
+
The acceptance suite drives `irobot`/`RobotDebug` end to end (REPL, the `Debug`
|
|
54
|
+
keyword, listener-on-error and step debugging). Run it with the task runner:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
invoke test # dotted console; writes results/ (log/report/output.xml)
|
|
58
|
+
invoke test --verbose # per-test console output
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
To check compatibility across Robot Framework releases (RF 5.0 → 7.4, each in an
|
|
62
|
+
isolated `uv` venv), regenerate the matrix in
|
|
63
|
+
[`docs/compatibility_matrix.md`](docs/compatibility_matrix.md):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
invoke matrix # full sweep
|
|
67
|
+
invoke matrix --only 7.3.2,7.4.2 # a subset
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Linting and formatting
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
invoke lint # ruff check
|
|
74
|
+
invoke lint --fix # ruff check --fix
|
|
75
|
+
invoke format # ruff format + black
|
|
76
|
+
invoke format --check # verify formatting without changing files
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`invoke check` runs `lint` then the acceptance suite — the recommended check
|
|
80
|
+
before opening a pull request.
|
|
81
|
+
|
|
82
|
+
## Releasing
|
|
83
|
+
|
|
84
|
+
The version is single-sourced from `RobotDebug.__version__` in
|
|
85
|
+
[`RobotDebug/__init__.py`](RobotDebug/__init__.py); `RobotDebug/version.py`
|
|
86
|
+
re-exports it as `VERSION` for backwards compatibility.
|
|
87
|
+
|
|
88
|
+
1. Bump `__version__` in `RobotDebug/__init__.py`.
|
|
89
|
+
2. Update the `ChangeLog`.
|
|
90
|
+
3. Make sure the working tree is clean and tests pass: `invoke check`.
|
|
91
|
+
4. Build the artifacts:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
invoke build # flit build → dist/*.whl + dist/*.tar.gz
|
|
95
|
+
# or directly: flit build (uses git to pick sdist files; needs a clean tree)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
5. Publish to PyPI with Flit (needs PyPI credentials):
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
flit publish
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
6. Tag the release: `git tag v<version> && git push --tags`.
|
|
105
|
+
|
|
106
|
+
## Submitting issues
|
|
107
|
+
|
|
108
|
+
Bugs and enhancements are tracked in the
|
|
109
|
+
[issue tracker](https://github.com/imbus/robotframework-debug/issues). Before
|
|
110
|
+
opening a new issue, please check whether the same bug or enhancement has
|
|
111
|
+
already been reported and, if so, add your comments to the existing issue
|
|
112
|
+
instead of creating a new one.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robotframework-debug
|
|
3
|
+
Version: 4.6.0
|
|
4
|
+
Summary: A debug library and REPL for Robot Framework.
|
|
5
|
+
Keywords: robotframework,debug,shell,repl
|
|
6
|
+
Author-email: René Rohner <snooz@posteo.de>
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Utilities
|
|
19
|
+
Classifier: Framework :: Robot Framework
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: prompt-toolkit >= 3.0.38
|
|
22
|
+
Requires-Dist: robotframework >= 5.0, < 8.0
|
|
23
|
+
Requires-Dist: pygments >= 2.14.0
|
|
24
|
+
Requires-Dist: pyperclip >= 1.8.2
|
|
25
|
+
Requires-Dist: invoke >= 2.0 ; extra == "dev"
|
|
26
|
+
Requires-Dist: ruff >= 0.4 ; extra == "dev"
|
|
27
|
+
Requires-Dist: black >= 24.0 ; extra == "dev"
|
|
28
|
+
Requires-Dist: pexpect >= 4.8 ; extra == "dev"
|
|
29
|
+
Requires-Dist: flit >= 3.4 ; extra == "dev"
|
|
30
|
+
Project-URL: Homepage, https://github.com/imbus/robotframework-debug/
|
|
31
|
+
Project-URL: Issues, https://github.com/imbus/robotframework-debug/issues
|
|
32
|
+
Project-URL: Repository, https://github.com/imbus/robotframework-debug/
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
|
|
35
|
+
# Debug Library for Robot Framework
|
|
36
|
+
|
|
37
|
+
- [Introduction](#introduction)
|
|
38
|
+
- [Installation](#installation)
|
|
39
|
+
- [Usage](#usage)
|
|
40
|
+
- [REPL mode](#repl-mode)
|
|
41
|
+
- [Library mode](#library-mode)
|
|
42
|
+
- [Listener mode](#listener-mode)
|
|
43
|
+
- [Step debugging](#step-debugging)
|
|
44
|
+
- [Overview of commands](#overview-of-commands)
|
|
45
|
+
- [Submitting issues](#submitting-issues)
|
|
46
|
+
- [Development](#development)
|
|
47
|
+
- [License](#license)
|
|
48
|
+
|
|
49
|
+
## Introduction
|
|
50
|
+
|
|
51
|
+
This library is a fork by René Rohner from the original robotframework-debuglibrary by Xie Yanbo.
|
|
52
|
+
|
|
53
|
+
Robotframework-RobotDebug is a debug library for [RobotFramework](https://robotframework.org),
|
|
54
|
+
which can be used as an interactive shell(REPL) and listener also.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
To install using `pip`:
|
|
59
|
+
|
|
60
|
+
pip install robotframework-debug
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
You can use RobotDebug library in 3 different modes:
|
|
65
|
+
- REPL mode,
|
|
66
|
+
- Library mode,
|
|
67
|
+
- Listener mode.
|
|
68
|
+
|
|
69
|
+
### REPL mode
|
|
70
|
+
|
|
71
|
+
Just call `irobot` in the terminal with all available robot arguments. An interactive shell will open. To exit use the command `exit` or shortcut `Ctrl+D`.
|
|
72
|
+
It is possible to evaluate both single-line and multi-line expressions.
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
- you can execute keywords and define variables
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
- You can set a variable and use this variable in another keyword in one step. Use the keyboard shortcut `Shift + Down Arrow` to go to the next line without evaluating the first line. Then press the `Enter` key twice to evaluate expressions.
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
- `irobot` can evaluate multi line expressions as `FOR` and `WHILE` loops, `IF / ELSE` statements and `TRY / EXCEPT` expressions.
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
- you can import libraries, resources and variable files
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
- you can use the resource file syntax like `*** Settings *** `, `*** Variables ***` and `*** Keywords ***` and write the resource file directly into the irobot shell. Press the `Enter` key twice to import your resource.
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
### Library mode
|
|
97
|
+
|
|
98
|
+
Import `RobotDebug` as library and use the `Debug` keyword to set a breakpoint in your test cases:
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
*** Settings ***
|
|
102
|
+
Library RobotDebug
|
|
103
|
+
|
|
104
|
+
*** Test Cases ***
|
|
105
|
+
Some Test
|
|
106
|
+
# some keywords...
|
|
107
|
+
Debug
|
|
108
|
+
# some else...
|
|
109
|
+
|
|
110
|
+
The `Debug` keyword pauses test execution and opens an interactive shell. Then you can evaluate expressions, try out keywords, inspect the variables and trace and view the code step by step. See also the section [step debugging](#step-debugging).
|
|
111
|
+
|
|
112
|
+
### Listener mode
|
|
113
|
+
|
|
114
|
+
You can attach it as a listener and run your test until it fails. Just add `--listener RobotDebug.Listener` to you `robot` call.
|
|
115
|
+
|
|
116
|
+
robot --listener RobotDebug.Listener some.robot
|
|
117
|
+
|
|
118
|
+
If your test case fails, RobotDebug will stop there and the interactive shell will be opened at that point. Then you can try out keywords and analyze the issue.
|
|
119
|
+
|
|
120
|
+
https://github.com/user-attachments/assets/18c48b1c-e870-45fd-ad67-f0424e88f172
|
|
121
|
+
|
|
122
|
+
### Step debugging
|
|
123
|
+
|
|
124
|
+
RobotDebug supports step debugging in Library and Listner mode.
|
|
125
|
+
|
|
126
|
+
Use keys *F7 (INTO)*, *F8 (OVER)* and *F9 (OUT)* to trace and view the code step by step.
|
|
127
|
+
|
|
128
|
+
*F7: INTO*
|
|
129
|
+
The `F7` key allows you to go into the keyword if it contains further keywords inside. The first line within the user keyword is executed and the execution is paused again.
|
|
130
|
+
|
|
131
|
+
*F8: OVER*
|
|
132
|
+
The `F8` key allows you to execute the current line completely in one step, even if it contains other keywords inside.
|
|
133
|
+
|
|
134
|
+
*F9: OUT*
|
|
135
|
+
You can use the `F9` key to exit the keyword if you have entered it previously.
|
|
136
|
+
|
|
137
|
+
*F10: CONTINUE*
|
|
138
|
+
You can use the `F10` key or the `continue` or `c` command to continue execution until the next `Debug` keyword if you use this in library mode or the next failure of the test if you use this in listner mode.
|
|
139
|
+
|
|
140
|
+
*SHIFT TAB: DETACH*
|
|
141
|
+
`Shift Tab` allows you to run the rest of the test case to the end without opening the interactive shell.
|
|
142
|
+
|
|
143
|
+
*List*
|
|
144
|
+
The commands `list` or `l` and `ll` display the test case snippet including the line being executed:
|
|
145
|
+

|
|
146
|
+
|
|
147
|
+
### Overview of commands
|
|
148
|
+
|
|
149
|
+
Use `exit` or keys `Ctrl+D` to exit the interactive shell.
|
|
150
|
+
|
|
151
|
+
Use `clear` or `cls` to clear the screen.
|
|
152
|
+
|
|
153
|
+
The interactive shell supports auto-completion for robotframework keywords and commands. Try input BuiltIn. then hit `Control + Space` key to feel it.
|
|
154
|
+
|
|
155
|
+
You can use the `F5` key to enable or disable live completion.
|
|
156
|
+
Live completion ON:
|
|
157
|
+

|
|
158
|
+
|
|
159
|
+
You can use the `F12` key to enable or disable mouse support within the shell.
|
|
160
|
+
Mouse support ON:
|
|
161
|
+

|
|
162
|
+
To be able to scroll, disable mouse support.
|
|
163
|
+
|
|
164
|
+
You can use the command `history` or key `F4` to view the history in your irobot shell. You can see used keywords and commands on the left and imported resources on the right side.
|
|
165
|
+
Use `TAB` to switch focus from one part to another. To close history, press key `F4`.
|
|
166
|
+
|
|
167
|
+
https://github.com/user-attachments/assets/cfa2b7c7-a2eb-4063-b1c4-30bff48da850
|
|
168
|
+
|
|
169
|
+
The history will save at `~/.rfdebug_history` located in user home directory default or any path defined in the environment variable RFDEBUG_HISTORY.
|
|
170
|
+
|
|
171
|
+
Use `help` to view possible commands:
|
|
172
|
+
|
|
173
|
+

|
|
174
|
+
|
|
175
|
+
To import a library, use `Library <lib_name>`.
|
|
176
|
+
To show all imported Libraries, use `libs` and to show sources for each library, use `libs -s`.
|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+
The command `res` lists the imported resource files.
|
|
181
|
+
`res -s` lists the imported resources files with source:
|
|
182
|
+
|
|
183
|
+

|
|
184
|
+
|
|
185
|
+
The command `keywords` or `k` lists all keywords of imported libraries.
|
|
186
|
+
The command `keywords <lib_name>` lists keywords of a specified library.
|
|
187
|
+
|
|
188
|
+
To get keyword documentation for individual keywords, use `docs <keyword_name>` or `d <keyword_name>`:
|
|
189
|
+
|
|
190
|
+

|
|
191
|
+
|
|
192
|
+
## Submitting issues
|
|
193
|
+
|
|
194
|
+
Bugs and enhancements are tracked in the [issue tracker](https://github.com/imbus/robotframework-debug/issues).
|
|
195
|
+
|
|
196
|
+
Before submitting a new issue, it is always a good idea to check if the same bug or enhancement already been reported. If it is, please add your comments to the existing issue instead of creating a new one.
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
See [`CONTRIBUTION.md`](CONTRIBUTION.md) for local setup, running and debugging
|
|
201
|
+
RobotDebug, testing, and the release process.
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
This software is licensed under the `New BSD License`. See the `LICENSE` file in the top distribution directory for the full license text.
|
|
206
|
+
|
|
@@ -3,10 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
import sys
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
|
-
from robot.
|
|
6
|
+
from robot.api import logger
|
|
7
|
+
from robot.libraries.BuiltIn import BuiltIn, run_keyword_variant
|
|
7
8
|
|
|
8
9
|
from .debugcmd import DebugCmd, ReplCmd, is_step_mode
|
|
9
10
|
from .globals import StepMode
|
|
11
|
+
from .robotkeyword import run_debug_if
|
|
10
12
|
from .styles import ERROR_STYLE, LOW_VISIBILITY_STYLE, print_output
|
|
11
13
|
from .version import VERSION
|
|
12
14
|
|
|
@@ -44,7 +46,10 @@ class Listener:
|
|
|
44
46
|
|
|
45
47
|
path = attrs["source"]
|
|
46
48
|
if path and Path(path).exists() and path not in self.source_files:
|
|
47
|
-
|
|
49
|
+
if Path(path).is_dir() and (Path(path) / "__init__.robot").exists():
|
|
50
|
+
path = Path(path) / "__init__.robot"
|
|
51
|
+
with Path(path).open() as f:
|
|
52
|
+
self.source_files[path] = f.readlines()
|
|
48
53
|
lineno = attrs["lineno"]
|
|
49
54
|
self.library.current_source_path = path
|
|
50
55
|
self.library.current_source_line = lineno
|
|
@@ -58,7 +63,9 @@ class Listener:
|
|
|
58
63
|
self.last_keyword_layer = self.keyword_layer
|
|
59
64
|
|
|
60
65
|
print_output(
|
|
61
|
-
"",
|
|
66
|
+
"",
|
|
67
|
+
f"{Path(path).relative_to(Path.cwd())}:{lineno}",
|
|
68
|
+
style=LOW_VISIBILITY_STYLE,
|
|
62
69
|
)
|
|
63
70
|
line = self.source_files[path][lineno - 1]
|
|
64
71
|
print_output(f"{lineno} ->", line.rstrip())
|
|
@@ -123,12 +130,57 @@ class RobotDebug:
|
|
|
123
130
|
self.current_source_path = ""
|
|
124
131
|
|
|
125
132
|
def Library(self, name, *args): # noqa: N802
|
|
133
|
+
"""Imports a library with the given name and optional arguments.
|
|
134
|
+
|
|
135
|
+
This keyword supports importing libraries both using library
|
|
136
|
+
names and physical paths. When paths are used, they must be
|
|
137
|
+
given in absolute format or found from
|
|
138
|
+
[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#module-search-path|
|
|
139
|
+
search path]. Forward slashes can be used as path separators in all
|
|
140
|
+
operating systems.
|
|
141
|
+
|
|
142
|
+
It is possible to pass arguments to the imported library and also
|
|
143
|
+
named argument syntax works if the library supports it. ``AS``
|
|
144
|
+
syntax can be used to give a custom name to the imported library.
|
|
145
|
+
|
|
146
|
+
Examples:
|
|
147
|
+
| Import Library | MyLibrary |
|
|
148
|
+
| Import Library | path/Lib.py | arg1 | named=arg2 | AS | Custom |
|
|
149
|
+
"""
|
|
126
150
|
BuiltIn().import_library(name, *args)
|
|
127
151
|
|
|
128
152
|
def Resource(self, path): # noqa: N802
|
|
153
|
+
"""Imports a resource file with the given path.
|
|
154
|
+
|
|
155
|
+
The given path must be absolute or found from
|
|
156
|
+
[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#module-search-path|search path].
|
|
157
|
+
Forward slashes can be used as path separator regardless
|
|
158
|
+
the operating system.
|
|
159
|
+
|
|
160
|
+
Examples:
|
|
161
|
+
| Import Resource | path/resource.txt |
|
|
162
|
+
| Import Resource | path/../resources/resource.html |
|
|
163
|
+
| Import Resource | found_from_pythonpath.robot |
|
|
164
|
+
"""
|
|
165
|
+
|
|
129
166
|
BuiltIn().import_resource(path)
|
|
130
167
|
|
|
131
168
|
def Variables(self, path, *args): # noqa: N802
|
|
169
|
+
"""Imports a variable file with the given path and optional arguments.
|
|
170
|
+
|
|
171
|
+
These variables override possible existing variables with
|
|
172
|
+
the same names.
|
|
173
|
+
|
|
174
|
+
The given path must be absolute or found from
|
|
175
|
+
[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html##module-search-path|search path].
|
|
176
|
+
Forward slashes can be used as path separator regardless
|
|
177
|
+
the operating system.
|
|
178
|
+
|
|
179
|
+
Examples:
|
|
180
|
+
| Import Variables | path/variables.py | | |
|
|
181
|
+
| Import Variables | path/../vars/env.py | arg1 | arg2 |
|
|
182
|
+
| Import Variables | file_from_pythonpath.py | | |
|
|
183
|
+
"""
|
|
132
184
|
BuiltIn().import_variables(path, *args)
|
|
133
185
|
|
|
134
186
|
def debug(self):
|
|
@@ -140,6 +192,25 @@ class RobotDebug:
|
|
|
140
192
|
# support
|
|
141
193
|
return self._debug()
|
|
142
194
|
|
|
195
|
+
@run_keyword_variant(resolve=1)
|
|
196
|
+
def debug_if(self, condition, *args):
|
|
197
|
+
"""Run the `Debug` keyword if the given ``condition`` is true.
|
|
198
|
+
|
|
199
|
+
*Deprecated.* ``Debug If`` only exists for backwards compatibility with
|
|
200
|
+
``robotframework-debuglibrary`` and will be removed in a future
|
|
201
|
+
release. Use a native Robot Framework ``IF`` block around the `Debug`
|
|
202
|
+
keyword instead:
|
|
203
|
+
|
|
204
|
+
| IF ${count} < 1
|
|
205
|
+
| Debug
|
|
206
|
+
| END
|
|
207
|
+
"""
|
|
208
|
+
logger.warn(
|
|
209
|
+
"'Debug If' is deprecated and will be removed in a future release. "
|
|
210
|
+
"Use a Robot Framework 'IF' block around the 'Debug' keyword instead."
|
|
211
|
+
)
|
|
212
|
+
return run_debug_if(condition, *args)
|
|
213
|
+
|
|
143
214
|
def _debug(self, muted: bool = False):
|
|
144
215
|
if self.listener.step_mode == StepMode.STOP:
|
|
145
216
|
return
|