testbench2robotframework 0.8.1a1__tar.gz → 0.9.0a2__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.
Files changed (60) hide show
  1. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/.gitignore +2 -1
  2. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/ExampleConfiguration/json_config.json +2 -2
  3. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/ExampleConfiguration/pyproject_example.toml +1 -1
  4. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/ExampleConfiguration/toml_config.toml +1 -1
  5. testbench2robotframework-0.9.0a2/PKG-INFO +158 -0
  6. testbench2robotframework-0.9.0a2/README.md +131 -0
  7. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/libs/json_config.py +2 -2
  8. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/__init__.py +1 -1
  9. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/cli.py +16 -6
  10. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/config.py +5 -3
  11. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/model.py +277 -75
  12. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/result_writer.py +80 -80
  13. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/testbench2rf.py +180 -155
  14. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/testbench2robotframework.py +2 -1
  15. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/utils.py +52 -0
  16. testbench2robotframework-0.8.1a1/PKG-INFO +0 -311
  17. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/CreatePiPWheel.bat +0 -0
  18. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/CreatePiPWheel.sh +0 -0
  19. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/DEVELOPMENT.md +0 -0
  20. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/LICENSE +0 -0
  21. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/MANIFEST.in +0 -0
  22. /testbench2robotframework-0.8.1a1/README.md → /testbench2robotframework-0.9.0a2/README_old.md +0 -0
  23. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/json_config_tests/1_tfs.robot +0 -0
  24. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/libs/pyproject_config.py +0 -0
  25. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/resources/file_management.resource +0 -0
  26. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/resources/testbench2robotframework_cli.resource +0 -0
  27. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/rf_tests/cli_interface/write/json_config.robot +0 -0
  28. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/rf_tests/cli_interface/write/no_config_argument.robot +0 -0
  29. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/atest/robot/rf_tests/cli_interface/write/toml_config.robot +0 -0
  30. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/create_json_schema.py +0 -0
  31. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/LibrarySubdivision.PNG +0 -0
  32. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/Unbenannt.PNG +0 -0
  33. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/generated.png +0 -0
  34. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/libraries.PNG +0 -0
  35. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/resources.PNG +0 -0
  36. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/rfLibraryRootsTestBench.PNG +0 -0
  37. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/testbench_rfLibraryRegex.PNG +0 -0
  38. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/testbench_rfResourceRegex.PNG +0 -0
  39. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/images/testthemen.PNG +0 -0
  40. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/oldModel.py +0 -0
  41. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/pydantic_model.py +0 -0
  42. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/pyproject.toml +0 -0
  43. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/requirements.txt +0 -0
  44. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/robot.toml +0 -0
  45. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tasks.py +0 -0
  46. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench-tools.zip +0 -0
  47. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/__main__.py +0 -0
  48. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/execution_artifacts.py +0 -0
  49. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/html_parser.py +0 -0
  50. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/json_reader.py +0 -0
  51. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/json_writer.py +0 -0
  52. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/log.py +0 -0
  53. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/model_utils.py +0 -0
  54. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/robotframework2testbench.py +0 -0
  55. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/testbench2robotframework/testsuite_write.py +0 -0
  56. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tests/test_data/configurations/invalid_config.json +0 -0
  57. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tests/test_data/configurations/valid_config.json +0 -0
  58. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tests/test_missing_files.py +0 -0
  59. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tests/test_robot_files_should_not_contain_invalid_characters.py +0 -0
  60. {testbench2robotframework-0.8.1a1 → testbench2robotframework-0.9.0a2}/tests/test_zip_file_generation.py +0 -0
@@ -164,4 +164,5 @@ robot.toml
164
164
  cli-export-config.json
165
165
  cli-import-config.json
166
166
  robot_tests/
167
- reports/
167
+ reports/
168
+ .github/
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "library-root": [
3
- "Interactions",
3
+ "Keywords",
4
4
  "RF-Library"
5
5
  ],
6
6
  "resource-root": [
@@ -11,7 +11,7 @@
11
11
  "log-suite-numbering": true,
12
12
  "resource-directory": "{root}/Resources",
13
13
  "clean": true,
14
- "compound-interaction-logging": "GROUP",
14
+ "compound-keyword-logging": "GROUP",
15
15
  "library-mapping": {
16
16
  "SeleniumLibrary": "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot",
17
17
  "SuperRemoteLibrary": "Remote http://127.0.0.1:8270 WITH NAME SuperRemoteLibrary"
@@ -7,7 +7,7 @@ fully-qualified = false
7
7
  output-directory = "{root}/Generated"
8
8
  log-suite-numbering = false
9
9
  clean = true
10
- compound-interaction-logging = true
10
+ compound-keyword-logging = true
11
11
  resource-directory = "{root}/Resources"
12
12
  testcase-split-regex = ".*StopWithRestart.*"
13
13
  phase-pattern = "{testcase} : Phase {index}/{length}"
@@ -7,7 +7,7 @@ fully-qualified = false
7
7
  output-directory = "{root}/Generated"
8
8
  log-suite-numbering = false
9
9
  clean = true
10
- compound-interaction-logging = true
10
+ compound-keyword-logging = true
11
11
  resource-directory = "{root}/Resources"
12
12
  testcase-split-regex = ".*StopWithRestart.*"
13
13
  phase-pattern = "{testcase} : Phase {index}/{length}"
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.4
2
+ Name: testbench2robotframework
3
+ Version: 0.9.0a2
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: ruff ; extra == "dev"
23
+ Requires-Dist: twine ; extra == "dev"
24
+ Project-URL: Repository, https://github.com/imbus/testbench2robotframework
25
+ Provides-Extra: dev
26
+
27
+ # TestBench2RobotFramework
28
+
29
+ **TestBench2RobotFramework** is a CLI tool used to convert a TestBench JSON report into Robot Framework test suites and to write the execution results provided by Robot Framework to the TestBench report.
30
+
31
+ ## Installation
32
+
33
+ You can install TestBench2RobotFramework via pip using the following command:
34
+
35
+ ```powershell
36
+ pip install testbench2robotframework
37
+ ```
38
+
39
+ Python 3.10 or higher is required to run this tool.
40
+
41
+ ## Remark
42
+ TestBench2RobotFramework requires TestBench version >= 4. If you're running an older version please contact the TestBench support for information on how to connect your Version of TestBench to Robot Framework. The TestBench Report can be either be exported via the TestBench Rest API with tools like the testbench-cli-reporter or directly from the client.
43
+
44
+ ## Usage
45
+
46
+ TestBench2RobotFramework supports two main use cases, which are described in more detail in the following sections:
47
+
48
+ 1. Generating Robot Framework test suites from a TestBench report.
49
+ 2. Fetching results from a Robot Framework output XML file and saving them back to a TestBench report.
50
+
51
+ ### Generating Robot Framework Test Suites
52
+ To generate Robot Framework test suites, use the `generate-tests` subcommand:
53
+
54
+ ```powershell
55
+ testbench2robotframework generate-tests TESTBENCH_REPORT
56
+ ```
57
+
58
+ This command generates a Robot Framework test suite for each test case set specified in the `TESTBENCH_REPORT`.
59
+
60
+ ![](./images/testthemen.PNG)
61
+ ![](./images/generated.PNG)
62
+
63
+ The example above demonstrates how Robot Framework test suites are generated based on the *Test Theme Tree* defined in TestBench.
64
+
65
+
66
+
67
+ #### Configuration
68
+
69
+ There are multiple configuration options available for **TestBench2RobotFramework** that can be used to customize the generated test suites. Options can be specified either via the command line, in a `pyproject.toml` file or in a `robot.toml` file.
70
+
71
+ To use options via the command line, the following syntax is used:
72
+
73
+ ```powershell
74
+ testbench2robotframework generate-tests [OPTIONS] TESTBENCH_REPORT
75
+ ```
76
+
77
+ | Option | Description |
78
+ |--------|-------------|
79
+ | `-c`, `--config PATH` | Path to a configuration file for TestBench2RobotFramework. |
80
+ | `--clean` | Deletes all files present in the output-directory before new test suites are created. |
81
+ | `-d`, `--output-directory PATH` | Directory or ZIP archive containing the generated test suites. |
82
+ | `--compound-keyword-logging` | Mode for logging compound keywords. Options: `GROUP`, `COMMENT`, or `NONE`. |
83
+ | `--fully-qualified` | Calls Robot Framework keywords by their fully qualified names in the generated test suites. |
84
+ | `--log-suite-numbering` | Enables logging of the test suite numbering. |
85
+ | `--metadata` | Add extra metadata to the settings of the generated Robot Framework test suite. Provide entries as key:value pairs, where *key* is the metadata name and *value* is the corresponding value. Values may also be Python expressions. The special variable '$tcs' gives access to the TestBench Python model of the test case set. |
86
+ | `--resource-directory PATH` | Directory containing the Robot Framework resource files. |
87
+ | `--resource-directory-regex TEXT` | 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. |
88
+ | `--library-regex TEXT` | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework libraries. |
89
+ | `--library-root TEXT` | TestBench root subdivision whose direct children correspond to Robot Framework libraries. |
90
+ | `--resource-regex TEXT` | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework resources. |
91
+ | `--resource-root TEXT` | TestBench root subdivision whose direct children correspond to Robot Framework resources. |
92
+ | `--library-mapping TEXT` | Library import statement to use when a keyword from the specified TestBench subdivision is encountered. |
93
+ | `--resource-mapping TEXT` | Resource import statement to use when a keyword from the specified TestBench subdivision is encountered. |
94
+ | `--help` | Displays the help message and exits. |
95
+ | `--version` | Writes the TestBench2RobotFramework, Robot Framework and Python version to console. |
96
+
97
+
98
+ ### Saving Robot Framework Results
99
+
100
+ Saving the results requires a Robot Framework output XML file, along with the original TestBench report from which the test suites were generated.
101
+
102
+ Use the following command:
103
+
104
+ ```powershell
105
+ testbench2robotframework fetch-results [OPTIONS] ROBOT_RESULT TESTBENCH_REPORT
106
+ ```
107
+
108
+ | Option | Description |
109
+ |--------|-------------|
110
+ | `-c`, `--config PATH` | Path to a configuration file for TestBench2RobotFramework. |
111
+ | `-d`, `--output-directory PATH` | Path to the directory or ZIP file where the updated TestBench JSON report (with results) should be saved. |
112
+ | `--help` | Displays the help message and exits. |
113
+
114
+
115
+
116
+ ### Using pyproject.toml
117
+ All CLI options available for ``testbench2robotframework`` can also 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.
118
+
119
+ #### Example
120
+ ```toml
121
+ [tool.testbench2robotframework]
122
+ library-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Library\].*']
123
+ resource-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Resource\].*']
124
+ library-root = ["RF", "RF-Library"]
125
+ resource-root = ["RF-Resource"]
126
+ fully-qualified = false
127
+ output-directory = "{root}/Generated"
128
+ log-suite-numbering = false
129
+ clean = true
130
+ compound-keyword-logging = GROUP
131
+ resource-directory = "{root}/Resources"
132
+ resource-directory-regex = ".*\\[Robot-Resources\\].*"
133
+ reference-behaviour = "ATTACHMENT"
134
+ attachment-conflict-behaviour = "USE_EXISTING"
135
+
136
+ [tool.testbench2robotframework.library-mapping]
137
+ SeleniumLibrary = "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot"
138
+ SuperRemoteLibrary = "Remote http://127.0.0.1:8270 WITH NAME SuperRemoteLibrary"
139
+
140
+ [tool.testbench2robotframework.resource-mapping]
141
+ MyKeywords = "{root}/../MyKeywords.resource"
142
+ MyOtherKeywords = "{resourceDirectory}/subdir/MyOtherKeywords.resource"
143
+
144
+ [tool.testbench2robotframework.forced-import]
145
+ libraries = ["test.py"]
146
+ resources = []
147
+ variables = []
148
+
149
+ [tool.testbench2robotframework.console-logging]
150
+ logLevel = "INFO"
151
+ logFormat = "%(levelname)s: %(message)s"
152
+
153
+ [tool.testbench2robotframework.file-logging]
154
+ logLevel = "DEBUG"
155
+ logFormat = "%(asctime)s - %(filename)s:%(lineno)d - %(levelname)8s - %(message)s"
156
+ fileName = "testbench2robotframework.log"
157
+ ```
158
+
@@ -0,0 +1,131 @@
1
+ # TestBench2RobotFramework
2
+
3
+ **TestBench2RobotFramework** is a CLI tool used to convert a TestBench JSON report into Robot Framework test suites and to write the execution results provided by Robot Framework to the TestBench report.
4
+
5
+ ## Installation
6
+
7
+ You can install TestBench2RobotFramework via pip using the following command:
8
+
9
+ ```powershell
10
+ pip install testbench2robotframework
11
+ ```
12
+
13
+ Python 3.10 or higher is required to run this tool.
14
+
15
+ ## Remark
16
+ TestBench2RobotFramework requires TestBench version >= 4. If you're running an older version please contact the TestBench support for information on how to connect your Version of TestBench to Robot Framework. The TestBench Report can be either be exported via the TestBench Rest API with tools like the testbench-cli-reporter or directly from the client.
17
+
18
+ ## Usage
19
+
20
+ TestBench2RobotFramework supports two main use cases, which are described in more detail in the following sections:
21
+
22
+ 1. Generating Robot Framework test suites from a TestBench report.
23
+ 2. Fetching results from a Robot Framework output XML file and saving them back to a TestBench report.
24
+
25
+ ### Generating Robot Framework Test Suites
26
+ To generate Robot Framework test suites, use the `generate-tests` subcommand:
27
+
28
+ ```powershell
29
+ testbench2robotframework generate-tests TESTBENCH_REPORT
30
+ ```
31
+
32
+ This command generates a Robot Framework test suite for each test case set specified in the `TESTBENCH_REPORT`.
33
+
34
+ ![](./images/testthemen.PNG)
35
+ ![](./images/generated.PNG)
36
+
37
+ The example above demonstrates how Robot Framework test suites are generated based on the *Test Theme Tree* defined in TestBench.
38
+
39
+
40
+
41
+ #### Configuration
42
+
43
+ There are multiple configuration options available for **TestBench2RobotFramework** that can be used to customize the generated test suites. Options can be specified either via the command line, in a `pyproject.toml` file or in a `robot.toml` file.
44
+
45
+ To use options via the command line, the following syntax is used:
46
+
47
+ ```powershell
48
+ testbench2robotframework generate-tests [OPTIONS] TESTBENCH_REPORT
49
+ ```
50
+
51
+ | Option | Description |
52
+ |--------|-------------|
53
+ | `-c`, `--config PATH` | Path to a configuration file for TestBench2RobotFramework. |
54
+ | `--clean` | Deletes all files present in the output-directory before new test suites are created. |
55
+ | `-d`, `--output-directory PATH` | Directory or ZIP archive containing the generated test suites. |
56
+ | `--compound-keyword-logging` | Mode for logging compound keywords. Options: `GROUP`, `COMMENT`, or `NONE`. |
57
+ | `--fully-qualified` | Calls Robot Framework keywords by their fully qualified names in the generated test suites. |
58
+ | `--log-suite-numbering` | Enables logging of the test suite numbering. |
59
+ | `--metadata` | Add extra metadata to the settings of the generated Robot Framework test suite. Provide entries as key:value pairs, where *key* is the metadata name and *value* is the corresponding value. Values may also be Python expressions. The special variable '$tcs' gives access to the TestBench Python model of the test case set. |
60
+ | `--resource-directory PATH` | Directory containing the Robot Framework resource files. |
61
+ | `--resource-directory-regex TEXT` | 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. |
62
+ | `--library-regex TEXT` | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework libraries. |
63
+ | `--library-root TEXT` | TestBench root subdivision whose direct children correspond to Robot Framework libraries. |
64
+ | `--resource-regex TEXT` | Regular expression used to identify TestBench subdivisions corresponding to Robot Framework resources. |
65
+ | `--resource-root TEXT` | TestBench root subdivision whose direct children correspond to Robot Framework resources. |
66
+ | `--library-mapping TEXT` | Library import statement to use when a keyword from the specified TestBench subdivision is encountered. |
67
+ | `--resource-mapping TEXT` | Resource import statement to use when a keyword from the specified TestBench subdivision is encountered. |
68
+ | `--help` | Displays the help message and exits. |
69
+ | `--version` | Writes the TestBench2RobotFramework, Robot Framework and Python version to console. |
70
+
71
+
72
+ ### Saving Robot Framework Results
73
+
74
+ Saving the results requires a Robot Framework output XML file, along with the original TestBench report from which the test suites were generated.
75
+
76
+ Use the following command:
77
+
78
+ ```powershell
79
+ testbench2robotframework fetch-results [OPTIONS] ROBOT_RESULT TESTBENCH_REPORT
80
+ ```
81
+
82
+ | Option | Description |
83
+ |--------|-------------|
84
+ | `-c`, `--config PATH` | Path to a configuration file for TestBench2RobotFramework. |
85
+ | `-d`, `--output-directory PATH` | Path to the directory or ZIP file where the updated TestBench JSON report (with results) should be saved. |
86
+ | `--help` | Displays the help message and exits. |
87
+
88
+
89
+
90
+ ### Using pyproject.toml
91
+ All CLI options available for ``testbench2robotframework`` can also 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.
92
+
93
+ #### Example
94
+ ```toml
95
+ [tool.testbench2robotframework]
96
+ library-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Library\].*']
97
+ resource-regex = ['(?:.*\.)?(?P<resourceName>[^.]+?)\s*\[Robot-Resource\].*']
98
+ library-root = ["RF", "RF-Library"]
99
+ resource-root = ["RF-Resource"]
100
+ fully-qualified = false
101
+ output-directory = "{root}/Generated"
102
+ log-suite-numbering = false
103
+ clean = true
104
+ compound-keyword-logging = GROUP
105
+ resource-directory = "{root}/Resources"
106
+ resource-directory-regex = ".*\\[Robot-Resources\\].*"
107
+ reference-behaviour = "ATTACHMENT"
108
+ attachment-conflict-behaviour = "USE_EXISTING"
109
+
110
+ [tool.testbench2robotframework.library-mapping]
111
+ SeleniumLibrary = "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot"
112
+ SuperRemoteLibrary = "Remote http://127.0.0.1:8270 WITH NAME SuperRemoteLibrary"
113
+
114
+ [tool.testbench2robotframework.resource-mapping]
115
+ MyKeywords = "{root}/../MyKeywords.resource"
116
+ MyOtherKeywords = "{resourceDirectory}/subdir/MyOtherKeywords.resource"
117
+
118
+ [tool.testbench2robotframework.forced-import]
119
+ libraries = ["test.py"]
120
+ resources = []
121
+ variables = []
122
+
123
+ [tool.testbench2robotframework.console-logging]
124
+ logLevel = "INFO"
125
+ logFormat = "%(levelname)s: %(message)s"
126
+
127
+ [tool.testbench2robotframework.file-logging]
128
+ logLevel = "DEBUG"
129
+ logFormat = "%(asctime)s - %(filename)s:%(lineno)d - %(levelname)8s - %(message)s"
130
+ fileName = "testbench2robotframework.log"
131
+ ```
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
 
4
4
  data = {
5
5
  # "rfLibraryRoots": [
6
- # "Interactions",
6
+ # "Keywords",
7
7
  # "RF-Library"
8
8
  # ],
9
9
  # "rfResourceRoots": [
@@ -15,7 +15,7 @@ data = {
15
15
  # "logSuiteNumbering": True,
16
16
  # "resourceDirectory": "{root}/Resources",
17
17
  # "clearGenerationDirectory": True,
18
- # "logCompoundInteractions": True,
18
+ # "logCompoundKeywords": True,
19
19
  # "subdivisionsMapping": {
20
20
  # "libraries": {
21
21
  # "SeleniumLibrary": "SeleniumLibrary timeout=10 implicit_wait=1 run_on_failure=Capture Page Screenshot",
@@ -17,4 +17,4 @@ suites and enhancing the TestBench report with execution results from Robot Fram
17
17
 
18
18
  from .testbench2robotframework import testbench2robotframework # noqa: F401
19
19
 
20
- __version__ = "0.8.1a1"
20
+ __version__ = "0.9.0a2"
@@ -85,9 +85,9 @@ def testbench2robotframework_cli():
85
85
  help="Directory or ZIP archive containing the generated test suites.",
86
86
  )
87
87
  @click.option(
88
- "--compound-interaction-logging",
88
+ "--compound-keyword-logging",
89
89
  type=click.Choice(["GROUP", "COMMENT", "NONE"], case_sensitive=False),
90
- help="Mode for logging compound interactions.",
90
+ help="Mode for logging compound keywords.",
91
91
  )
92
92
  @click.option(
93
93
  "--log-suite-numbering", is_flag=True, help="Enables logging of the test suite numbering."
@@ -119,6 +119,15 @@ def testbench2robotframework_cli():
119
119
  help="""TestBench root subdivision which's direct
120
120
  children correspond to Robot Framework libraries.""",
121
121
  )
122
+ @click.option(
123
+ "--metadata",
124
+ multiple=True,
125
+ callback=parse_subdivision_mapping,
126
+ help="""Add extra metadata to the settings of the generated Robot Framework test suite.
127
+ Provide entries as key:value pairs, where *key* is the metadata name and *value* is the corresponding value.
128
+ Values may also be Python expressions.
129
+ The special variable '$tcs' gives access to the TestBench Python model of the test case set.""",
130
+ )
122
131
  @click.option(
123
132
  "--resource-regex",
124
133
  multiple=True,
@@ -150,13 +159,14 @@ def testbench2robotframework_cli():
150
159
  @click.argument("testbench-report", type=click.Path(path_type=Path))
151
160
  def generate_tests( # noqa: PLR0913
152
161
  clean: bool,
153
- compound_interaction_logging: str,
162
+ compound_keyword_logging: str,
154
163
  config: Path,
155
164
  fully_qualified: bool,
156
165
  library_regex: tuple[str],
157
166
  resource_directory_regex: str,
158
167
  library_root: tuple[str],
159
168
  log_suite_numbering: bool,
169
+ metadata: dict[str, str],
160
170
  output_directory: Path,
161
171
  resource_directory: Path,
162
172
  resource_regex: tuple[str],
@@ -187,9 +197,9 @@ def generate_tests( # noqa: PLR0913
187
197
  configuration["log-suite-numbering"] = True
188
198
  else:
189
199
  configuration["log-suite-numbering"] = configuration.get("log-suite-numbering", False)
190
-
191
- configuration["compound-interaction-logging"] = (
192
- compound_interaction_logging or configuration.get("compound-interaction-logging", "GROUP")
200
+ configuration["metadata"] = metadata or configuration.get("metadata", {})
201
+ configuration["compound-keyword-logging"] = (
202
+ compound_keyword_logging or configuration.get("compound-keyword-logging", "GROUP")
193
203
  )
194
204
  configuration["resource-directory"] = (
195
205
  resource_directory.as_posix()
@@ -163,7 +163,7 @@ class LoggingConfig:
163
163
  )
164
164
 
165
165
 
166
- class CompoundInteractionLogging(StrEnum):
166
+ class CompoundKeywordLogging(StrEnum):
167
167
  GROUP = "GROUP"
168
168
  COMMENT = "COMMENT"
169
169
  NONE = "NONE"
@@ -186,13 +186,14 @@ class AttachmentConflictBehaviour(StrEnum):
186
186
  class Configuration:
187
187
  attachmentConflictBehaviour: AttachmentConflictBehaviour
188
188
  clean: bool
189
- compound_interaction_logging: CompoundInteractionLogging
189
+ compound_keyword_logging: CompoundKeywordLogging
190
190
  forced_import: ForcedImport
191
191
  fully_qualified: bool
192
192
  library_regex: list[str]
193
193
  library_root: list[str]
194
194
  log_suite_numbering: bool
195
195
  loggingConfiguration: LoggingConfig
196
+ metadata: dict[str, str]
196
197
  output_directory: str
197
198
  phasePattern: str
198
199
  referenceBehaviour: ReferenceBehaviour
@@ -227,7 +228,8 @@ class Configuration:
227
228
  "file":dictionary.get("file-logging", {})
228
229
  }
229
230
  ),
230
- compound_interaction_logging=CompoundInteractionLogging(dictionary.get("compound-interaction-logging", "GROUP").upper()),
231
+ metadata=dictionary.get("metadata", {}),
232
+ compound_keyword_logging=CompoundKeywordLogging(dictionary.get("compound-keyword-logging", "GROUP").upper()),
231
233
  resource_directory=dictionary.get("resource-directory", "").replace(
232
234
  "\\", "/"
233
235
  ),