robotframework-testdoc 0.1.7__tar.gz → 0.1.8__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.
Potentially problematic release.
This version of robotframework-testdoc might be problematic. Click here for more details.
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/PKG-INFO +1 -1
- robotframework_testdoc-0.1.8/atest/config_pyproject/example_pyproject.toml +32 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/pyproject.toml +2 -2
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/PKG-INFO +1 -1
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/SOURCES.txt +1 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/cli.py +3 -2
- robotframework_testdoc-0.1.8/src/testdoc/helper/cliargs.py +84 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testcaseparser.py +9 -5
- robotframework_testdoc-0.1.7/src/testdoc/helper/cliargs.py +0 -44
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/.github/workflows/build-publish.yml +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/.github/workflows/release.yml +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/.gitignore +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/LICENSE +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/README.md +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/atest/config/config_with_colors.toml +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/atest/config/testdoc.toml +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/atest/test_cli.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/atest/test_cli.robot +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/docs/style_blue.png +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/docs/style_dark.png +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/docs/style_robot.png +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/setup.cfg +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/dependency_links.txt +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/entry_points.txt +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/requires.txt +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/top_level.txt +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/__init__.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/__main__.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/default.toml +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/helper/datetimeconverter.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/helper/logger.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/helper/pathconverter.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/images/robotframework.svg +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/templates/jinja_template_01.html +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/__init__.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/theme_config.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/themes.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html_rendering/render.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/modifier/sourceprefixmodifier.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/modifier/suitefilemodifier.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testsuiteparser.py +0 -0
- {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/testdoc.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[tool.testdoc]
|
|
2
|
+
title = "New title of HTML document"
|
|
3
|
+
name = "New name of root suite element"
|
|
4
|
+
doc = "New doc text of root suite element"
|
|
5
|
+
sourceprefix = "gitlab::https://gitlab.com/myrepo/repo_path"
|
|
6
|
+
include = ["TagA", "TagB"]
|
|
7
|
+
exclude = ["TagC"]
|
|
8
|
+
hide_tags = true
|
|
9
|
+
hide_test_doc = true
|
|
10
|
+
hide_suite_doc = true
|
|
11
|
+
hide_source = true
|
|
12
|
+
hide_keywords = true
|
|
13
|
+
style = "blue"
|
|
14
|
+
verbose_mode = false
|
|
15
|
+
|
|
16
|
+
[tool.testdoc.metadata]
|
|
17
|
+
Author = "Your-Name"
|
|
18
|
+
Version = "1.0.0"
|
|
19
|
+
Source = "AnySourceAsMetaData"
|
|
20
|
+
|
|
21
|
+
[tool.testdoc.colors]
|
|
22
|
+
# Use predefined theme:
|
|
23
|
+
default = "blue"
|
|
24
|
+
# or custom colors:
|
|
25
|
+
background = "#000028"
|
|
26
|
+
inner_color = "#000028"
|
|
27
|
+
button_active_color = "#193966"
|
|
28
|
+
button_hover_color = "#193966"
|
|
29
|
+
border_color = "#CCCCCC"
|
|
30
|
+
text_color = "#CCCCCC"
|
|
31
|
+
title_color = "#00ffb9"
|
|
32
|
+
robot_icon = "#00ffb9"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "robotframework-testdoc"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.8"
|
|
8
8
|
description = "A CLI Tool to generate a Test Documentation for your RobotFramework Test Scripts."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.7"
|
|
@@ -25,4 +25,4 @@ testdoc = "testdoc.cli:main"
|
|
|
25
25
|
line-length = 150
|
|
26
26
|
lint.select = ["E", "F"] # Pyflakes & pycodestyle
|
|
27
27
|
lint.ignore = ["E722"]
|
|
28
|
-
exclude = ["build", "dist"]
|
|
28
|
+
exclude = ["build", "dist"]
|
|
@@ -47,14 +47,15 @@ def main(
|
|
|
47
47
|
Welcome to robotframework-testdoc - the new test documentation generator for your Robot Framework tests!
|
|
48
48
|
"""
|
|
49
49
|
color = "green"
|
|
50
|
-
|
|
50
|
+
entrypoint_msg = """
|
|
51
51
|
████████╗███████╗███████╗████████╗██████╗ ███████╗███████╗
|
|
52
52
|
╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██ ██╗██ ██║██╔════╝
|
|
53
53
|
██║ █████╗ ███████╗ ██║ ██ ██║██ ██║██║
|
|
54
54
|
██║ ██╔══╝ ╚════██║ ██║ ██ ██║██ ██║██║
|
|
55
55
|
██║ ███████╗███████║ ██║ ██████╔╝███████║███████╗
|
|
56
56
|
╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝
|
|
57
|
-
"""
|
|
57
|
+
"""
|
|
58
|
+
click.echo(click.style(entrypoint_msg, fg=color)
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
args_instance = CommandLineArguments()
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from typing import Any, List
|
|
3
|
+
import tomli
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class CommandLineArgumentsData:
|
|
8
|
+
title: str = "Robot Framework - Test Documentation"
|
|
9
|
+
name: str = None
|
|
10
|
+
doc: str = None
|
|
11
|
+
metadata: dict = None
|
|
12
|
+
sourceprefix: str = None
|
|
13
|
+
include: List[str] = field(default_factory=list)
|
|
14
|
+
exclude: List[str] = field(default_factory=list)
|
|
15
|
+
hide_tags: bool = False
|
|
16
|
+
hide_test_doc: bool = False
|
|
17
|
+
hide_suite_doc: bool = False
|
|
18
|
+
hide_source: bool = False
|
|
19
|
+
hide_keywords: bool = False
|
|
20
|
+
config_file: str = None
|
|
21
|
+
verbose_mode: bool = False
|
|
22
|
+
suite_file: str = None
|
|
23
|
+
style: str = None
|
|
24
|
+
output_file: str = None
|
|
25
|
+
colors: dict = None
|
|
26
|
+
|
|
27
|
+
class CommandLineArguments:
|
|
28
|
+
_instance = None
|
|
29
|
+
def __new__(cls):
|
|
30
|
+
if cls._instance is None:
|
|
31
|
+
cls._instance = super().__new__(cls)
|
|
32
|
+
|
|
33
|
+
cls.data = CommandLineArgumentsData()
|
|
34
|
+
return cls._instance
|
|
35
|
+
|
|
36
|
+
###
|
|
37
|
+
### Load configuration file
|
|
38
|
+
###
|
|
39
|
+
def load_from_config_file(self, file_path: str):
|
|
40
|
+
with open(file_path, "rb") as f:
|
|
41
|
+
config = tomli.load(f)
|
|
42
|
+
|
|
43
|
+
_is_pyproject = self._is_pyproject_config(file_path)
|
|
44
|
+
if _is_pyproject:
|
|
45
|
+
self._handle_pyproject_config(config)
|
|
46
|
+
else:
|
|
47
|
+
self._handle_custom_config(config)
|
|
48
|
+
|
|
49
|
+
###
|
|
50
|
+
### Read pyproject.toml
|
|
51
|
+
###
|
|
52
|
+
def _handle_pyproject_config(self, config: dict[str, Any]):
|
|
53
|
+
testdoc_config = config.get("tool", {}).get("testdoc", {})
|
|
54
|
+
|
|
55
|
+
if "colors" in testdoc_config:
|
|
56
|
+
self.data.colors = testdoc_config["colors"]
|
|
57
|
+
|
|
58
|
+
if "metadata" in testdoc_config:
|
|
59
|
+
if hasattr(self.data, "metadata"):
|
|
60
|
+
setattr(self.data, "metadata", testdoc_config["metadata"])
|
|
61
|
+
|
|
62
|
+
for key, value in testdoc_config.items():
|
|
63
|
+
if key in ("colors", "metadata"):
|
|
64
|
+
continue
|
|
65
|
+
if hasattr(self.data, key):
|
|
66
|
+
setattr(self.data, key, value)
|
|
67
|
+
|
|
68
|
+
###
|
|
69
|
+
### Read custom.toml
|
|
70
|
+
###
|
|
71
|
+
def _handle_custom_config(self, config: dict[str, Any]):
|
|
72
|
+
if "colors" in config:
|
|
73
|
+
self.data.colors = config["colors"]
|
|
74
|
+
|
|
75
|
+
for key, value in config.items():
|
|
76
|
+
if hasattr(self.data, key):
|
|
77
|
+
setattr(self.data, key, value)
|
|
78
|
+
|
|
79
|
+
#####################################################################################
|
|
80
|
+
|
|
81
|
+
def _is_pyproject_config(self, file_path) -> bool:
|
|
82
|
+
return os.path.basename(file_path) == "pyproject.toml"
|
|
83
|
+
|
|
84
|
+
#####################################################################################
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testcaseparser.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from robot.api import TestSuite
|
|
2
|
+
from robot.errors import DataError
|
|
2
3
|
from ..helper.cliargs import CommandLineArguments
|
|
3
4
|
|
|
4
5
|
class TestCaseParser():
|
|
@@ -25,8 +26,11 @@ class TestCaseParser():
|
|
|
25
26
|
|
|
26
27
|
# Consider tags via officially provided robot api
|
|
27
28
|
def consider_tags(self, suite: TestSuite) -> TestSuite:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
try:
|
|
30
|
+
if len(self.args.include) > 0:
|
|
31
|
+
suite.configure(include_tags=self.args.include)
|
|
32
|
+
if len(self.args.exclude) > 0:
|
|
33
|
+
suite.configure(exclude_tags=self.args.exclude)
|
|
34
|
+
return suite
|
|
35
|
+
except DataError as e:
|
|
36
|
+
raise DataError(e.message)
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass, field
|
|
2
|
-
from typing import List
|
|
3
|
-
import tomli
|
|
4
|
-
|
|
5
|
-
@dataclass
|
|
6
|
-
class CommandLineArgumentsData:
|
|
7
|
-
title: str = "Robot Framework - Test Documentation"
|
|
8
|
-
name: str = None
|
|
9
|
-
doc: str = None
|
|
10
|
-
metadata: dict = None
|
|
11
|
-
sourceprefix: str = None
|
|
12
|
-
include: List[str] = field(default_factory=list)
|
|
13
|
-
exclude: List[str] = field(default_factory=list)
|
|
14
|
-
hide_tags: bool = False
|
|
15
|
-
hide_test_doc: bool = False
|
|
16
|
-
hide_suite_doc: bool = False
|
|
17
|
-
hide_source: bool = False
|
|
18
|
-
hide_keywords: bool = False
|
|
19
|
-
config_file: str = None
|
|
20
|
-
verbose_mode: bool = False
|
|
21
|
-
suite_file: str = None
|
|
22
|
-
style: str = None
|
|
23
|
-
output_file: str = None
|
|
24
|
-
colors: dict = None
|
|
25
|
-
|
|
26
|
-
class CommandLineArguments:
|
|
27
|
-
_instance = None
|
|
28
|
-
def __new__(cls):
|
|
29
|
-
if cls._instance is None:
|
|
30
|
-
cls._instance = super().__new__(cls)
|
|
31
|
-
|
|
32
|
-
cls.data = CommandLineArgumentsData()
|
|
33
|
-
return cls._instance
|
|
34
|
-
|
|
35
|
-
def load_from_config_file(self, file_path: str):
|
|
36
|
-
with open(file_path, "rb") as f:
|
|
37
|
-
config = tomli.load(f)
|
|
38
|
-
|
|
39
|
-
if "colors" in config:
|
|
40
|
-
self.data.colors = config["colors"]
|
|
41
|
-
|
|
42
|
-
for key, value in config.items():
|
|
43
|
-
if hasattr(self.data, key):
|
|
44
|
-
setattr(self.data, key, value)
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/.github/workflows/build-publish.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/atest/config/config_with_colors.toml
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
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/helper/pathconverter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/themes.py
RENAMED
|
File without changes
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/html_rendering/render.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_testdoc-0.1.7 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testsuiteparser.py
RENAMED
|
File without changes
|
|
File without changes
|