testbench2robotframework 0.9.2a2__tar.gz → 0.9.2b4__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.
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/.gitignore +2 -1
- testbench2robotframework-0.9.2b4/DEVELOPMENT.md +35 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/ExampleConfiguration/json_config.json +11 -10
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/ExampleConfiguration/pyproject_example.toml +3 -2
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/ExampleConfiguration/toml_config.toml +3 -2
- testbench2robotframework-0.9.2b4/PKG-INFO +46 -0
- testbench2robotframework-0.9.2b4/README.md +18 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/libs/json_config.py +0 -1
- testbench2robotframework-0.9.2b4/atest/robot/libs/pyproject_config.py +8 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/create_json_schema.py +8 -4
- testbench2robotframework-0.9.2b4/docs/configuration/_category_.json +4 -0
- testbench2robotframework-0.9.2b4/docs/configuration/cli_options.md +112 -0
- testbench2robotframework-0.9.2b4/docs/configuration/overview.md +93 -0
- testbench2robotframework-0.9.2b4/docs/configuration/pyproject_config.md +171 -0
- testbench2robotframework-0.9.2b4/docs/getting_started/_category_.json +4 -0
- testbench2robotframework-0.9.2b4/docs/getting_started/installation.md +31 -0
- testbench2robotframework-0.9.2b4/docs/getting_started/quick_start.md +54 -0
- testbench2robotframework-0.9.2b4/docs/intro.md +36 -0
- testbench2robotframework-0.9.2b4/docs/usage/_category_.json +4 -0
- testbench2robotframework-0.9.2b4/docs/usage/fetch_results.md +77 -0
- testbench2robotframework-0.9.2b4/docs/usage/generate_tests.md +78 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/pyproject.toml +9 -1
- testbench2robotframework-0.9.2b4/tasks.py +69 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/__init__.py +1 -1
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/cli.py +5 -5
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/config.py +4 -2
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/execution_artifacts.py +8 -9
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/json_reader.py +4 -5
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/json_writer.py +1 -2
- testbench2robotframework-0.9.2b4/testbench2robotframework/model.py +1924 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/model_utils.py +26 -5
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/result_writer.py +37 -34
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/robotframework2testbench.py +2 -3
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/testbench2rf.py +61 -19
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/testbench2robotframework.py +2 -2
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/testsuite_write.py +2 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/utils.py +4 -5
- testbench2robotframework-0.9.2a2/CreatePiPWheel.bat +0 -7
- testbench2robotframework-0.9.2a2/CreatePiPWheel.sh +0 -5
- testbench2robotframework-0.9.2a2/DEVELOPMENT.md +0 -25
- testbench2robotframework-0.9.2a2/PKG-INFO +0 -158
- testbench2robotframework-0.9.2a2/README.md +0 -131
- testbench2robotframework-0.9.2a2/atest/robot/libs/pyproject_config.py +0 -13
- testbench2robotframework-0.9.2a2/oldModel.py +0 -1153
- testbench2robotframework-0.9.2a2/pydantic_model.py +0 -469
- testbench2robotframework-0.9.2a2/tasks.py +0 -29
- testbench2robotframework-0.9.2a2/testbench2robotframework/model.py +0 -1886
- testbench2robotframework-0.9.2a2/tests/test_data/configurations/invalid_config.json +0 -46
- testbench2robotframework-0.9.2a2/tests/test_data/configurations/valid_config.json +0 -45
- testbench2robotframework-0.9.2a2/tests/test_missing_files.py +0 -9
- testbench2robotframework-0.9.2a2/tests/test_robot_files_should_not_contain_invalid_characters.py +0 -11
- testbench2robotframework-0.9.2a2/tests/test_zip_file_generation.py +0 -29
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/LICENSE +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/MANIFEST.in +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/README_old.md +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/json_config_tests/1_tfs.robot +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/resources/file_management.resource +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/resources/testbench2robotframework_cli.resource +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/rf_tests/cli_interface/write/json_config.robot +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/rf_tests/cli_interface/write/no_config_argument.robot +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/atest/robot/rf_tests/cli_interface/write/toml_config.robot +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/LibrarySubdivision.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/Unbenannt.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/generated.png +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/libraries.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/resources.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/rfLibraryRootsTestBench.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/testbench_rfLibraryRegex.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/testbench_rfResourceRegex.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/images/testthemen.PNG +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/requirements.txt +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/robot.toml +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench-tools.zip +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/__main__.py +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/html_parser.py +0 -0
- {testbench2robotframework-0.9.2a2 → testbench2robotframework-0.9.2b4}/testbench2robotframework/log.py +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setting up project for the first time
|
|
4
|
+
|
|
5
|
+
1. Create venv and activate it:
|
|
6
|
+
```bash
|
|
7
|
+
python -m venv .venv
|
|
8
|
+
source .venv/bin/activate # Linux/macOS
|
|
9
|
+
.venv\scripts\activate # Windows
|
|
10
|
+
```
|
|
11
|
+
2. Install project with dev dependencies:
|
|
12
|
+
```bash
|
|
13
|
+
pip install -e .[dev]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Building and publishing
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
check-manifest --update
|
|
20
|
+
python -m build
|
|
21
|
+
twine check dist/*
|
|
22
|
+
twine upload dist/*
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Updating the data model
|
|
26
|
+
|
|
27
|
+
`testbench2robotframework/model.py` is generated from the TestBench OpenAPI spec using [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator).
|
|
28
|
+
|
|
29
|
+
1. Download the OpenAPI YAML from the TestBench Swagger documentation (e.g. `openapi.yml`).
|
|
30
|
+
2. Generate the model (settings are in `pyproject.toml` under `[tool.datamodel-codegen]`):
|
|
31
|
+
```bash
|
|
32
|
+
invoke generate-model --input openapi.yml
|
|
33
|
+
```
|
|
34
|
+
This runs `datamodel-codegen` and injects `__VERSION__` from the spec's `info.version` field into `model.py`.
|
|
35
|
+
3. Review the generated file
|
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
"output-directory": "{root}/Generated",
|
|
11
11
|
"log-suite-numbering": true,
|
|
12
12
|
"resource-directory": "{root}/Resources",
|
|
13
|
+
"resource-directory-regex": ".*\\[Robot-Resources\\].*",
|
|
13
14
|
"clean": true,
|
|
14
15
|
"compound-keyword-logging": "GROUP",
|
|
16
|
+
"reference-behaviour": "ATTACHMENT",
|
|
17
|
+
"attachment-conflict-behaviour": "USE_EXISTING",
|
|
18
|
+
"testcase-splitting-regex": "^StopWithRestart\\..*",
|
|
19
|
+
"phase-pattern": "{testcase} : Phase {index}/{length}",
|
|
20
|
+
"metadata": {},
|
|
15
21
|
"library-mapping": {
|
|
16
22
|
"SeleniumLibrary": "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot",
|
|
17
23
|
"SuperRemoteLibrary": "Remote http://127.0.0.1:8270 WITH NAME SuperRemoteLibrary"
|
|
@@ -20,20 +26,15 @@
|
|
|
20
26
|
"MyKeywords": "{root}/../MyKeywords.resource",
|
|
21
27
|
"MyOtherKeywords": "{resourceDirectory}/subdir/MyOtherKeywords.resource"
|
|
22
28
|
},
|
|
23
|
-
"
|
|
24
|
-
"libraries": [
|
|
25
|
-
],
|
|
26
|
-
"
|
|
27
|
-
[
|
|
28
|
-
],
|
|
29
|
-
"variables": [
|
|
30
|
-
]
|
|
29
|
+
"forced-import": {
|
|
30
|
+
"libraries": [],
|
|
31
|
+
"resources": [],
|
|
32
|
+
"variables": []
|
|
31
33
|
},
|
|
32
|
-
"testCaseSplitPathRegEx": "^StopWithRestart\\..*",
|
|
33
34
|
"console-logging": {
|
|
34
35
|
"logLevel": "debug"
|
|
35
36
|
},
|
|
36
37
|
"file-logging": {
|
|
37
38
|
"logLevel": "info"
|
|
38
|
-
|
|
39
|
+
}
|
|
39
40
|
}
|
|
@@ -7,9 +7,10 @@ fully-qualified = false
|
|
|
7
7
|
output-directory = "{root}/Generated"
|
|
8
8
|
log-suite-numbering = false
|
|
9
9
|
clean = true
|
|
10
|
-
compound-keyword-logging =
|
|
10
|
+
compound-keyword-logging = "GROUP"
|
|
11
11
|
resource-directory = "{root}/Resources"
|
|
12
|
-
|
|
12
|
+
resource-directory-regex = ".*\\[Robot-Resources\\].*"
|
|
13
|
+
testcase-splitting-regex = ".*StopWithRestart.*"
|
|
13
14
|
phase-pattern = "{testcase} : Phase {index}/{length}"
|
|
14
15
|
reference-behaviour = "ATTACHMENT"
|
|
15
16
|
attachment-conflict-behaviour = "USE_EXISTING"
|
|
@@ -7,9 +7,10 @@ fully-qualified = false
|
|
|
7
7
|
output-directory = "{root}/Generated"
|
|
8
8
|
log-suite-numbering = false
|
|
9
9
|
clean = true
|
|
10
|
-
compound-keyword-logging =
|
|
10
|
+
compound-keyword-logging = "GROUP"
|
|
11
11
|
resource-directory = "{root}/Resources"
|
|
12
|
-
|
|
12
|
+
resource-directory-regex = ".*\\[Robot-Resources\\].*"
|
|
13
|
+
testcase-splitting-regex = ".*StopWithRestart.*"
|
|
13
14
|
phase-pattern = "{testcase} : Phase {index}/{length}"
|
|
14
15
|
reference-behaviour = "ATTACHMENT"
|
|
15
16
|
attachment-conflict-behaviour = "USE_EXISTING"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: testbench2robotframework
|
|
3
|
+
Version: 0.9.2b4
|
|
4
|
+
Summary: Robot Framework Code Generator from Keyword-Driven Tests in imbus TestBench 3.0 and newer
|
|
5
|
+
Author-email: imbus AG <support@imbus.de>
|
|
6
|
+
Requires-Python: >= 3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: click >= 8.0
|
|
10
|
+
Requires-Dist: robotframework >= 5.0
|
|
11
|
+
Requires-Dist: tomli; python_version < '3.11'
|
|
12
|
+
Requires-Dist: build ; extra == "dev"
|
|
13
|
+
Requires-Dist: check-manifest ; extra == "dev"
|
|
14
|
+
Requires-Dist: flit ; extra == "dev"
|
|
15
|
+
Requires-Dist: invoke ; extra == "dev"
|
|
16
|
+
Requires-Dist: mypy ; extra == "dev"
|
|
17
|
+
Requires-Dist: pylint ; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest ; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest-cov ; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-spec ; extra == "dev"
|
|
21
|
+
Requires-Dist: robotframework-tidy ; extra == "dev"
|
|
22
|
+
Requires-Dist: datamodel-code-generator ; extra == "dev"
|
|
23
|
+
Requires-Dist: ruff ; extra == "dev"
|
|
24
|
+
Requires-Dist: twine ; extra == "dev"
|
|
25
|
+
Project-URL: Repository, https://github.com/imbus/testbench2robotframework
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
|
|
28
|
+
# TestBench2RobotFramework
|
|
29
|
+
|
|
30
|
+
testbench2robotframework is a CLI tool to convert a TestBench JSON report into Robot Framework test suites and to write the execution results provided by Robot Framework back to the TestBench report.
|
|
31
|
+
|
|
32
|
+
This can be used for automated test execution with Robot Framework, triggered by a CI/CD pipeline.
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
The documentation is available in the [docs](./docs) folder of this repository.
|
|
37
|
+
|
|
38
|
+
## Releases
|
|
39
|
+
|
|
40
|
+
Releases are published on GitHub and available via [PyPI](https://pypi.org/project/testbench2robotframework/).
|
|
41
|
+
|
|
42
|
+
## Requirements
|
|
43
|
+
|
|
44
|
+
- Python 3.10 or higher
|
|
45
|
+
- TestBench version >= 4
|
|
46
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# TestBench2RobotFramework
|
|
2
|
+
|
|
3
|
+
testbench2robotframework is a CLI tool to convert a TestBench JSON report into Robot Framework test suites and to write the execution results provided by Robot Framework back to the TestBench report.
|
|
4
|
+
|
|
5
|
+
This can be used for automated test execution with Robot Framework, triggered by a CI/CD pipeline.
|
|
6
|
+
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
The documentation is available in the [docs](./docs) folder of this repository.
|
|
10
|
+
|
|
11
|
+
## Releases
|
|
12
|
+
|
|
13
|
+
Releases are published on GitHub and available via [PyPI](https://pypi.org/project/testbench2robotframework/).
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Python 3.10 or higher
|
|
18
|
+
- TestBench version >= 4
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
with open("testbench2robotframework/model.py", "r", encoding="utf8") as model_py:
|
|
4
|
+
with open("testbench2robotframework/model.py", encoding="utf8") as model_py:
|
|
6
5
|
model_str = model_py.read()
|
|
7
6
|
|
|
8
7
|
pydantic_model = re.sub(r"(@dataclass\n)(class .*?)(:)", r"\2(BaseModel)\3", model_str)
|
|
9
8
|
pydantic_model = re.sub(r"( {4}@classmethod.*?)(\nclass|$)", r"\2", pydantic_model, flags=re.DOTALL)
|
|
10
|
-
pydantic_model = re.sub(
|
|
9
|
+
pydantic_model = re.sub(
|
|
10
|
+
r"from dataclasses import dataclass",
|
|
11
|
+
r"from pydantic import BaseModel",
|
|
12
|
+
pydantic_model,
|
|
13
|
+
flags=re.DOTALL,
|
|
14
|
+
)
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
with open("pydantic_model.py", "w", encoding="utf8") as pydantic_model_py:
|
|
14
18
|
pydantic_model_py.write(pydantic_model)
|
|
15
19
|
|
|
16
20
|
from pydantic_model import *
|
|
17
|
-
from yaml import
|
|
21
|
+
from yaml import Dumper, dump
|
|
18
22
|
|
|
19
23
|
with open("model.json", "w") as schema:
|
|
20
24
|
schema.write(json.dumps(AllModels.model_json_schema(), indent=2))
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# CLI Options Reference
|
|
6
|
+
|
|
7
|
+
Complete reference for all command-line options available in TestBench2RobotFramework.
|
|
8
|
+
|
|
9
|
+
## Global Options
|
|
10
|
+
|
|
11
|
+
These options are available for all commands:
|
|
12
|
+
|
|
13
|
+
| Option | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| `--help` | Displays the help message and exits. |
|
|
16
|
+
| `--version` | Writes the TestBench2RobotFramework, Robot Framework and Python version to console. |
|
|
17
|
+
| `-c`, `--config PATH` | Path to a configuration file for TestBench2RobotFramework. |
|
|
18
|
+
|
|
19
|
+
## generate-tests Options
|
|
20
|
+
|
|
21
|
+
Options specific to the `generate-tests` subcommand:
|
|
22
|
+
|
|
23
|
+
### Output Options
|
|
24
|
+
|
|
25
|
+
| Option | Type | Description |
|
|
26
|
+
|--------|------|-------------|
|
|
27
|
+
| `-d`, `--output-directory PATH` | Path | Directory or ZIP archive containing the generated test suites. |
|
|
28
|
+
| `--clean` | Flag | Deletes all files present in the output-directory before new test suites are created. |
|
|
29
|
+
|
|
30
|
+
### Keyword & Logging Options
|
|
31
|
+
|
|
32
|
+
| Option | Type | Description |
|
|
33
|
+
|--------|------|-------------|
|
|
34
|
+
| `--compound-keyword-logging` | Choice | Mode for logging compound keywords. Options: `GROUP`, `COMMENT`, or `NONE`. |
|
|
35
|
+
| `--fully-qualified` | Flag | Calls Robot Framework keywords by their fully qualified names in the generated test suites. |
|
|
36
|
+
| `--log-suite-numbering` | Flag | Enables logging of the test suite numbering. |
|
|
37
|
+
| `--metadata TEXT` | Text | Add extra metadata to the settings of the generated Robot Framework test suite. Provide entries as `key:value` pairs. |
|
|
38
|
+
|
|
39
|
+
### Resource & Library Options
|
|
40
|
+
|
|
41
|
+
| Option | Type | Description |
|
|
42
|
+
|--------|------|-------------|
|
|
43
|
+
| `--resource-directory PATH` | Path | Directory containing the Robot Framework resource files. |
|
|
44
|
+
| `--resource-directory-regex TEXT` | Regex | Regex that can be used to identify the TestBench Subdivision that corresponds to the resource-directory. Resources will be imported relative to this subdivision based on the test elements structure in TestBench. |
|
|
45
|
+
| `--library-regex TEXT` | Regex | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework libraries. |
|
|
46
|
+
| `--library-root TEXT` | Text | TestBench root subdivision whose direct children correspond to Robot Framework libraries. |
|
|
47
|
+
| `--resource-regex TEXT` | Regex | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework resources. |
|
|
48
|
+
| `--resource-root TEXT` | Text | TestBench root subdivision whose direct children correspond to Robot Framework resources. |
|
|
49
|
+
| `--library-mapping TEXT` | Text | Library import statement to use when a keyword from the specified TestBench subdivision is encountered. |
|
|
50
|
+
| `--resource-mapping TEXT` | Text | Resource import statement to use when a keyword from the specified TestBench subdivision is encountered. |
|
|
51
|
+
|
|
52
|
+
## fetch-results Options
|
|
53
|
+
|
|
54
|
+
Options specific to the `fetch-results` subcommand:
|
|
55
|
+
|
|
56
|
+
| Option | Type | Description |
|
|
57
|
+
|--------|------|-------------|
|
|
58
|
+
| `-d`, `--output-directory PATH` | Path | Path to the directory or ZIP file where the updated TestBench JSON report (with results) should be saved. |
|
|
59
|
+
|
|
60
|
+
## Usage Examples
|
|
61
|
+
|
|
62
|
+
### Display Help
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
testbench2robotframework --help
|
|
66
|
+
testbench2robotframework generate-tests --help
|
|
67
|
+
testbench2robotframework fetch-results --help
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Check Version
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
testbench2robotframework --version
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Generate Tests with Multiple Options
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
testbench2robotframework generate-tests \
|
|
80
|
+
--clean \
|
|
81
|
+
-d ./Generated \
|
|
82
|
+
--compound-keyword-logging GROUP \
|
|
83
|
+
--fully-qualified \
|
|
84
|
+
--log-suite-numbering \
|
|
85
|
+
my_report.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Fetch Results with Custom Output
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
testbench2robotframework fetch-results \
|
|
92
|
+
-d ./updated_reports \
|
|
93
|
+
output.xml \
|
|
94
|
+
testbench_report.json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Using Configuration File
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
testbench2robotframework generate-tests -c config.toml my_report.json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Option Priority
|
|
104
|
+
|
|
105
|
+
When the same option is specified in multiple places, the priority order is:
|
|
106
|
+
|
|
107
|
+
1. **Command-line options** (highest priority)
|
|
108
|
+
2. **Workspace-local `.robot.toml`**
|
|
109
|
+
3. **Project `robot.toml` or `pyproject.toml`**
|
|
110
|
+
4. **Default values** (lowest priority)
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Configuration Overview
|
|
6
|
+
|
|
7
|
+
TestBench2RobotFramework offers flexible configuration options to customize the behavior of test generation and result fetching.
|
|
8
|
+
|
|
9
|
+
## Configuration Methods
|
|
10
|
+
|
|
11
|
+
You can configure TestBench2RobotFramework using three different methods:
|
|
12
|
+
|
|
13
|
+
### 1. Command-Line Options
|
|
14
|
+
|
|
15
|
+
Pass options directly when running commands:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
testbench2robotframework generate-tests --clean -d ./Generated my_report.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
✅ **Best for:** Quick, one-time runs and overriding specific settings
|
|
22
|
+
|
|
23
|
+
### 2. Configuration Files
|
|
24
|
+
|
|
25
|
+
Store settings in configuration files for reusable configurations:
|
|
26
|
+
|
|
27
|
+
- `pyproject.toml` - Python project configuration
|
|
28
|
+
- `robot.toml` - Robot Framework specific configuration
|
|
29
|
+
- `.robot.toml` - Workspace-local configuration
|
|
30
|
+
|
|
31
|
+
✅ **Best for:** Team projects, consistent settings, complex configurations
|
|
32
|
+
|
|
33
|
+
TestBench2RobotFramework will automatically detect and apply settings from these files when present.
|
|
34
|
+
|
|
35
|
+
### 3. Mixed Approach
|
|
36
|
+
|
|
37
|
+
Combine both methods - command-line options override configuration file settings:
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
testbench2robotframework generate-tests -c config.toml --clean my_report.json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Configuration Hierarchy
|
|
44
|
+
|
|
45
|
+
When multiple configuration methods are used, settings are applied in the following order (later overrides earlier):
|
|
46
|
+
|
|
47
|
+
1. Default values
|
|
48
|
+
2. `pyproject.toml` or `robot.toml`
|
|
49
|
+
3. `.robot.toml` (workspace-local)
|
|
50
|
+
4. Command-line options
|
|
51
|
+
|
|
52
|
+
## Common Configuration Options
|
|
53
|
+
|
|
54
|
+
### Output Settings
|
|
55
|
+
|
|
56
|
+
- `output-directory` - Where to save generated files or results
|
|
57
|
+
- `clean` - Delete existing files before generating new ones
|
|
58
|
+
- `fully-qualified` - Enable/disable fully qualified keyword names in generated test suites
|
|
59
|
+
- `compound-keyword-logging` - Control compound TestBench keyword logging (`GROUP`, `COMMENT`, `NONE`)
|
|
60
|
+
- `log-suite-numbering` - Enable/disable suite numbering in generated file names
|
|
61
|
+
- `testcase-splitting-regex` - Regular expression to split test cases at matching interactions
|
|
62
|
+
- `phase-pattern` - Pattern for naming test case phases when splitting
|
|
63
|
+
|
|
64
|
+
### Library & Resource Mapping
|
|
65
|
+
|
|
66
|
+
- `library-regex` - Pattern to identify TestBench subdivisions as libraries
|
|
67
|
+
- `resource-regex` - Pattern to identify TestBench subdivisions as resources
|
|
68
|
+
- `library-root` - Root subdivision for libraries
|
|
69
|
+
- `resource-root` - Root subdivision for resources
|
|
70
|
+
- `library-mapping` - Custom library import statements
|
|
71
|
+
- `resource-mapping` - Custom resource import statements
|
|
72
|
+
- `resource-directory` - Directory containing Robot Framework resource files
|
|
73
|
+
- `resource-directory-regex` - Regex to identify the TestBench subdivision corresponding to the resource directory
|
|
74
|
+
|
|
75
|
+
### Metadata
|
|
76
|
+
|
|
77
|
+
- `metadata` - Extra metadata key-value pairs added to generated test suite settings
|
|
78
|
+
|
|
79
|
+
### Forced Imports
|
|
80
|
+
|
|
81
|
+
- `forced-import` - Force import of specific libraries, resources, or variables in every generated suite
|
|
82
|
+
|
|
83
|
+
### Attachment & Reference Handling
|
|
84
|
+
|
|
85
|
+
- `reference-behaviour` - How to handle references (`ATTACHMENT`, `REFERENCE`, `NONE`)
|
|
86
|
+
- `attachment-conflict-behaviour` - How to handle attachment conflicts (`ERROR`, `USE_NEW`, `USE_EXISTING`, `RENAME_NEW`)
|
|
87
|
+
|
|
88
|
+
### Logging
|
|
89
|
+
|
|
90
|
+
- `console-logging` - Console output log level and format
|
|
91
|
+
- `file-logging` - File-based log level, format, and file name
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# pyproject.toml Configuration
|
|
6
|
+
|
|
7
|
+
All CLI options available for `testbench2robotframework` can be defined in your `pyproject.toml` file, `robot.toml`, or a workspace-local `.robot.toml`. This offers a convenient way to store and reuse configuration settings, particularly in larger projects or automated environments.
|
|
8
|
+
|
|
9
|
+
## Basic Structure
|
|
10
|
+
|
|
11
|
+
Add a `[tool.testbench2robotframework]` section to your `pyproject.toml`:
|
|
12
|
+
|
|
13
|
+
```toml
|
|
14
|
+
[tool.testbench2robotframework]
|
|
15
|
+
# Your configuration options here
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Complete Configuration Example
|
|
19
|
+
|
|
20
|
+
Here's a comprehensive example with all available options:
|
|
21
|
+
|
|
22
|
+
```toml
|
|
23
|
+
[tool.testbench2robotframework]
|
|
24
|
+
library-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Library\].*']
|
|
25
|
+
resource-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Resource\].*']
|
|
26
|
+
library-root = ["RF", "RF-Library"]
|
|
27
|
+
resource-root = ["RF-Resource"]
|
|
28
|
+
fully-qualified = false
|
|
29
|
+
output-directory = "{root}/Generated"
|
|
30
|
+
log-suite-numbering = false
|
|
31
|
+
clean = true
|
|
32
|
+
compound-keyword-logging = "GROUP"
|
|
33
|
+
resource-directory = "{root}/Resources"
|
|
34
|
+
resource-directory-regex = ".*\\[Robot-Resources\\].*"
|
|
35
|
+
reference-behaviour = "ATTACHMENT"
|
|
36
|
+
attachment-conflict-behaviour = "USE_EXISTING"
|
|
37
|
+
testcase-splitting-regex = ".*StopWithRestart.*"
|
|
38
|
+
phase-pattern = "{testcase} : Phase {index}/{length}"
|
|
39
|
+
|
|
40
|
+
[tool.testbench2robotframework.metadata]
|
|
41
|
+
# Example: MyKey = "my value"
|
|
42
|
+
|
|
43
|
+
[tool.testbench2robotframework.library-mapping]
|
|
44
|
+
SeleniumLibrary = "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot"
|
|
45
|
+
SuperRemoteLibrary = "Remote http://127.0.0.1:8270 WITH NAME SuperRemoteLibrary"
|
|
46
|
+
|
|
47
|
+
[tool.testbench2robotframework.resource-mapping]
|
|
48
|
+
MyKeywords = "{root}/../MyKeywords.resource"
|
|
49
|
+
MyOtherKeywords = "{resourceDirectory}/subdir/MyOtherKeywords.resource"
|
|
50
|
+
|
|
51
|
+
[tool.testbench2robotframework.forced-import]
|
|
52
|
+
libraries = ["test.py"]
|
|
53
|
+
resources = []
|
|
54
|
+
variables = []
|
|
55
|
+
|
|
56
|
+
[tool.testbench2robotframework.console-logging]
|
|
57
|
+
logLevel = "INFO"
|
|
58
|
+
logFormat = "%(levelname)s: %(message)s"
|
|
59
|
+
|
|
60
|
+
[tool.testbench2robotframework.file-logging]
|
|
61
|
+
logLevel = "DEBUG"
|
|
62
|
+
logFormat = "%(asctime)s - %(filename)s:%(lineno)d - %(levelname)8s - %(message)s"
|
|
63
|
+
fileName = "testbench2robotframework.log"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration Sections
|
|
67
|
+
|
|
68
|
+
### Main Configuration
|
|
69
|
+
|
|
70
|
+
The main `[tool.testbench2robotframework]` section contains general settings:
|
|
71
|
+
|
|
72
|
+
```toml
|
|
73
|
+
[tool.testbench2robotframework]
|
|
74
|
+
output-directory = "{root}/Generated"
|
|
75
|
+
clean = true
|
|
76
|
+
fully-qualified = false
|
|
77
|
+
log-suite-numbering = false
|
|
78
|
+
compound-keyword-logging = "GROUP"
|
|
79
|
+
testcase-splitting-regex = ".*StopWithRestart.*"
|
|
80
|
+
phase-pattern = "{testcase} : Phase {index}/{length}"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Metadata
|
|
84
|
+
|
|
85
|
+
Add custom metadata to the settings of generated Robot Framework test suites:
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
[tool.testbench2robotframework.metadata]
|
|
89
|
+
MyMetadata = "some value"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Library Mapping
|
|
93
|
+
|
|
94
|
+
Define custom import statements for libraries:
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
[tool.testbench2robotframework.library-mapping]
|
|
98
|
+
SeleniumLibrary = "SeleniumLibrary timeout=10 implicit_wait=1"
|
|
99
|
+
MyLibrary = "MyLibrary arg1=value1 arg2=value2"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Resource Mapping
|
|
103
|
+
|
|
104
|
+
Define custom import statements for resources:
|
|
105
|
+
|
|
106
|
+
```toml
|
|
107
|
+
[tool.testbench2robotframework.resource-mapping]
|
|
108
|
+
MyKeywords = "{root}/../MyKeywords.resource"
|
|
109
|
+
CommonKeywords = "{resourceDirectory}/common/keywords.resource"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Forced Imports
|
|
113
|
+
|
|
114
|
+
Force specific libraries, resources, or variables to be imported:
|
|
115
|
+
|
|
116
|
+
```toml
|
|
117
|
+
[tool.testbench2robotframework.forced-import]
|
|
118
|
+
libraries = ["BuiltIn", "Collections"]
|
|
119
|
+
resources = ["common.resource"]
|
|
120
|
+
variables = ["variables.py"]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Console Logging
|
|
124
|
+
|
|
125
|
+
Configure console output:
|
|
126
|
+
|
|
127
|
+
```toml
|
|
128
|
+
[tool.testbench2robotframework.console-logging]
|
|
129
|
+
logLevel = "INFO"
|
|
130
|
+
logFormat = "%(levelname)s: %(message)s"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### File Logging
|
|
134
|
+
|
|
135
|
+
Configure file-based logging:
|
|
136
|
+
|
|
137
|
+
```toml
|
|
138
|
+
[tool.testbench2robotframework.file-logging]
|
|
139
|
+
logLevel = "DEBUG"
|
|
140
|
+
logFormat = "%(asctime)s - %(filename)s:%(lineno)d - %(levelname)8s - %(message)s"
|
|
141
|
+
fileName = "testbench2robotframework.log"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Variable Placeholders
|
|
145
|
+
|
|
146
|
+
You can use the following placeholders in configuration values:
|
|
147
|
+
|
|
148
|
+
- `{root}` - Project root directory
|
|
149
|
+
- `{resourceDirectory}` - Configured resource directory path
|
|
150
|
+
|
|
151
|
+
**Example:**
|
|
152
|
+
```toml
|
|
153
|
+
output-directory = "{root}/Generated"
|
|
154
|
+
resource-directory = "{root}/Resources"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Using robot.toml
|
|
158
|
+
|
|
159
|
+
Instead of `pyproject.toml`, you can use `robot.toml` with the same structure:
|
|
160
|
+
|
|
161
|
+
```toml
|
|
162
|
+
[tool.testbench2robotframework]
|
|
163
|
+
output-directory = "./Generated"
|
|
164
|
+
clean = true
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Workspace-Local Configuration
|
|
168
|
+
|
|
169
|
+
Create a `.robot.toml` file in your workspace for project-specific settings that override the global configuration.
|
|
170
|
+
|
|
171
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Before installing TestBench2RobotFramework, ensure you have:
|
|
10
|
+
|
|
11
|
+
- **Python 3.10 or higher** installed on your system
|
|
12
|
+
- **pip** package manager (usually comes with Python)
|
|
13
|
+
|
|
14
|
+
## Install via pip
|
|
15
|
+
|
|
16
|
+
You can install TestBench2RobotFramework via pip using the following command:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
pip install testbench2robotframework
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Verify Installation
|
|
23
|
+
|
|
24
|
+
After installation, verify that the tool is correctly installed by checking the version:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
testbench2robotframework --version
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This command will display the TestBench2RobotFramework, Robot Framework, and Python versions.
|
|
31
|
+
|