testbench2robotframework 0.9.2b6__tar.gz → 1.0.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.
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/PKG-INFO +1 -1
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/__init__.py +1 -1
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/cli.py +11 -3
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/model_utils.py +1 -1
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/result_writer.py +1 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/robotframework2testbench.py +4 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/testbench2robotframework.py +7 -1
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/utils.py +49 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/.gitignore +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/DEVELOPMENT.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/ExampleConfiguration/json_config.json +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/ExampleConfiguration/pyproject_example.toml +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/ExampleConfiguration/toml_config.toml +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/LICENSE +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/MANIFEST.in +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/README.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/README_old.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/json_config_tests/1_tfs.robot +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/libs/json_config.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/libs/pyproject_config.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/resources/file_management.resource +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/resources/testbench2robotframework_cli.resource +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/rf_tests/cli_interface/write/json_config.robot +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/rf_tests/cli_interface/write/no_config_argument.robot +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/rf_tests/cli_interface/write/toml_config.robot +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/create_json_schema.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/configuration/_category_.json +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/configuration/cli_options.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/configuration/overview.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/configuration/pyproject_config.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/getting_started/_category_.json +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/getting_started/installation.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/getting_started/quick_start.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/intro.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/_category_.json +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/fetch_results.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/generate_tests.md +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/LibrarySubdivision.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/Unbenannt.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/generated.png +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/libraries.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/resources.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/rfLibraryRootsTestBench.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/testbench_rfLibraryRegex.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/testbench_rfResourceRegex.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/testthemen.PNG +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/pyproject.toml +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/requirements.txt +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/robot.toml +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/tasks.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench-tools.zip +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/__main__.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/config.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/execution_artifacts.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/html_parser.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/json_reader.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/json_writer.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/log.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/model.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/testbench2rf.py +0 -0
- {testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/testsuite_write.py +0 -0
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/cli.py
RENAMED
|
@@ -21,10 +21,17 @@ from .config import (
|
|
|
21
21
|
)
|
|
22
22
|
from .json_reader import read_json
|
|
23
23
|
from .testbench2robotframework import testbench2robotframework
|
|
24
|
+
from .utils import ALLOWED_SERVER_VERSIONS
|
|
24
25
|
|
|
25
|
-
TESTBENCH2ROBOTFRAMEWORK_DESCRIPTION =
|
|
26
|
+
TESTBENCH2ROBOTFRAMEWORK_DESCRIPTION = (
|
|
27
|
+
"""TestBench2RobotFramework converts a TestBench JSON-report
|
|
26
28
|
to Robot Framework test suites and enhances the TestBench Report
|
|
27
|
-
|
|
29
|
+
with the execution results provided by Robot Framework. The version your TestBench report
|
|
30
|
+
was generated with must be compatible with the version of testbench2robotframework you are using.
|
|
31
|
+
Supported versions for this version of testbench2robotframework are: """
|
|
32
|
+
+ ", ".join(ALLOWED_SERVER_VERSIONS)
|
|
33
|
+
+ "."
|
|
34
|
+
)
|
|
28
35
|
GENERATE_HELP = """Command to convert a TestBench JSON-report to Robot Framework test suites."""
|
|
29
36
|
FETCH_HELP = """Command to fetch execution results from a Robot Framework result XML and
|
|
30
37
|
to write the results to a TestBench JSON-report."""
|
|
@@ -56,7 +63,8 @@ def parse_subdivision_mapping(
|
|
|
56
63
|
help="Writes the TestBench2RobotFramework, Robot Framework and Python version to console.",
|
|
57
64
|
message=(
|
|
58
65
|
f"TestBench2RobotFramework {__version__} with "
|
|
59
|
-
f"Robot Framework {robot.version.get_full_version()}"
|
|
66
|
+
f"Robot Framework {robot.version.get_full_version()}. "
|
|
67
|
+
f"Compatible with TestBench server versions: {', '.join(ALLOWED_SERVER_VERSIONS)}."
|
|
60
68
|
),
|
|
61
69
|
)
|
|
62
70
|
@click.help_option("-h", "--help")
|
|
@@ -104,4 +104,4 @@ def convert_value(value: Any, type_hint: Any) -> Any:
|
|
|
104
104
|
return convert_value_without_origin(value, type_hint)
|
|
105
105
|
if origin is Origin.UNION:
|
|
106
106
|
return convert_value_with_union_type(value, type_hint)
|
|
107
|
-
return convert_value_with_list_type(value, type_hint)
|
|
107
|
+
return convert_value_with_list_type(value, type_hint)
|
|
@@ -3,6 +3,8 @@ from pathlib import Path
|
|
|
3
3
|
|
|
4
4
|
from robot.api import ExecutionResult
|
|
5
5
|
|
|
6
|
+
from testbench2robotframework.utils import perform_version_check
|
|
7
|
+
|
|
6
8
|
from .config import Configuration
|
|
7
9
|
from .log import logger, setup_logger
|
|
8
10
|
from .result_writer import ResultWriter
|
|
@@ -18,6 +20,8 @@ def robot2testbench(
|
|
|
18
20
|
sys.exit("Could not find json directory or zip file at the given path.")
|
|
19
21
|
if not Path(robot_result_xml).exists():
|
|
20
22
|
sys.exit("Robot result xml does not exist at the given path.")
|
|
23
|
+
perform_version_check(Path(json_input_report))
|
|
24
|
+
|
|
21
25
|
configuration = Configuration.from_dict(config)
|
|
22
26
|
setup_logger(configuration)
|
|
23
27
|
logger.debug("Configuration loaded.")
|
|
@@ -7,10 +7,16 @@ from .json_reader import TestBenchJsonReader
|
|
|
7
7
|
from .log import logger, setup_logger
|
|
8
8
|
from .testbench2rf import create_test_suites
|
|
9
9
|
from .testsuite_write import write_test_suites
|
|
10
|
-
from .utils import
|
|
10
|
+
from .utils import (
|
|
11
|
+
PathResolver,
|
|
12
|
+
extract_to_working_directory,
|
|
13
|
+
is_zip_file,
|
|
14
|
+
perform_version_check,
|
|
15
|
+
)
|
|
11
16
|
|
|
12
17
|
|
|
13
18
|
def testbench2robotframework(testbench_report: str, config: dict | Configuration):
|
|
19
|
+
perform_version_check(Path(testbench_report))
|
|
14
20
|
configuration = Configuration.from_dict(config) if isinstance(config, dict) else config
|
|
15
21
|
setup_logger(configuration)
|
|
16
22
|
logger.debug("Configuration loaded.")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import re
|
|
2
3
|
import shutil
|
|
3
4
|
import sys
|
|
@@ -17,6 +18,54 @@ from testbench2robotframework.model import (
|
|
|
17
18
|
|
|
18
19
|
from .log import logger
|
|
19
20
|
|
|
21
|
+
ALLOWED_SERVER_VERSIONS = ["4.0"]
|
|
22
|
+
ERROR_COULD_NOT_READ_VERSION = (
|
|
23
|
+
"Could not read TestBench report version. The report must be generated with one of the supported versions: "
|
|
24
|
+
+ ", ".join(ALLOWED_SERVER_VERSIONS)
|
|
25
|
+
)
|
|
26
|
+
ERROR_INCOMPATIBLE_VERSION = (
|
|
27
|
+
"The version of testbench2robotframework is not compatible with the TestBench report version '{server_version}'. "
|
|
28
|
+
f"Supported versions are: {', '.join(ALLOWED_SERVER_VERSIONS)}. "
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def perform_version_check(testbench_report: Path):
|
|
33
|
+
try:
|
|
34
|
+
manifest = read_manifest_json_from_testbench_report(testbench_report)
|
|
35
|
+
except Exception as e:
|
|
36
|
+
sys.exit(ERROR_COULD_NOT_READ_VERSION)
|
|
37
|
+
server_version = manifest.get("serverVersions", {}).get("version", None)
|
|
38
|
+
if not server_version:
|
|
39
|
+
sys.exit(ERROR_COULD_NOT_READ_VERSION)
|
|
40
|
+
|
|
41
|
+
if server_version not in ALLOWED_SERVER_VERSIONS:
|
|
42
|
+
sys.exit(ERROR_INCOMPATIBLE_VERSION.format(server_version=server_version))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def read_manifest_json_from_testbench_report(testbench_report: Path) -> dict:
|
|
46
|
+
if testbench_report.is_dir():
|
|
47
|
+
manifest = testbench_report / "manifest.json"
|
|
48
|
+
if not manifest.exists():
|
|
49
|
+
raise FileNotFoundError("manifest.json not found")
|
|
50
|
+
with open(manifest, "r", encoding="utf-8") as f:
|
|
51
|
+
return json.load(f)
|
|
52
|
+
|
|
53
|
+
# ZIP archive
|
|
54
|
+
elif testbench_report.suffix == ".zip":
|
|
55
|
+
with ZipFile(testbench_report) as zf:
|
|
56
|
+
try:
|
|
57
|
+
with zf.open("manifest.json") as f:
|
|
58
|
+
return json.load(f)
|
|
59
|
+
except KeyError:
|
|
60
|
+
raise FileNotFoundError("manifest.json not found in zip")
|
|
61
|
+
|
|
62
|
+
# Direct file
|
|
63
|
+
elif testbench_report.is_file() and testbench_report.name == "manifest.json":
|
|
64
|
+
with open(testbench_report, "r", encoding="utf-8") as f:
|
|
65
|
+
return json.load(f)
|
|
66
|
+
else:
|
|
67
|
+
raise FileNotFoundError(testbench_report)
|
|
68
|
+
|
|
20
69
|
|
|
21
70
|
def robot_tag_from_udf(udf: UserDefinedField) -> str | None:
|
|
22
71
|
if (udf.udfType == UDFType.Enumeration and udf.value) or (
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/atest/robot/libs/json_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/configuration/overview.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/_category_.json
RENAMED
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/fetch_results.md
RENAMED
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/docs/usage/generate_tests.md
RENAMED
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/images/LibrarySubdivision.PNG
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testbench2robotframework-0.9.2b6 → testbench2robotframework-1.0.0}/testbench2robotframework/log.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|