robotframework-testdoc 0.1.5__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.

Files changed (42) hide show
  1. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/PKG-INFO +2 -2
  2. robotframework_testdoc-0.1.8/atest/config_pyproject/example_pyproject.toml +32 -0
  3. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/pyproject.toml +3 -3
  4. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/PKG-INFO +2 -2
  5. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/SOURCES.txt +1 -0
  6. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/cli.py +3 -2
  7. robotframework_testdoc-0.1.8/src/testdoc/helper/cliargs.py +84 -0
  8. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testcaseparser.py +9 -5
  9. robotframework_testdoc-0.1.5/src/testdoc/helper/cliargs.py +0 -44
  10. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/.github/workflows/build-publish.yml +0 -0
  11. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/.github/workflows/release.yml +0 -0
  12. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/.gitignore +0 -0
  13. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/LICENSE +0 -0
  14. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/README.md +0 -0
  15. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/atest/config/config_with_colors.toml +0 -0
  16. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/atest/config/testdoc.toml +0 -0
  17. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/atest/test_cli.py +0 -0
  18. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/atest/test_cli.robot +0 -0
  19. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/docs/style_blue.png +0 -0
  20. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/docs/style_dark.png +0 -0
  21. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/docs/style_robot.png +0 -0
  22. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/setup.cfg +0 -0
  23. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/dependency_links.txt +0 -0
  24. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/entry_points.txt +0 -0
  25. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/requires.txt +0 -0
  26. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/robotframework_testdoc.egg-info/top_level.txt +0 -0
  27. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/__init__.py +0 -0
  28. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/__main__.py +0 -0
  29. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/default.toml +0 -0
  30. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/helper/datetimeconverter.py +0 -0
  31. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/helper/logger.py +0 -0
  32. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/helper/pathconverter.py +0 -0
  33. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html/images/robotframework.svg +0 -0
  34. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html/templates/jinja_template_01.html +0 -0
  35. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/__init__.py +0 -0
  36. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/theme_config.py +0 -0
  37. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html/themes/themes.py +0 -0
  38. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/html_rendering/render.py +0 -0
  39. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/parser/modifier/sourceprefixmodifier.py +0 -0
  40. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/parser/modifier/suitefilemodifier.py +0 -0
  41. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/parser/testsuiteparser.py +0 -0
  42. {robotframework_testdoc-0.1.5 → robotframework_testdoc-0.1.8}/src/testdoc/testdoc.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testdoc
3
- Version: 0.1.5
3
+ Version: 0.1.8
4
4
  Summary: A CLI Tool to generate a Test Documentation for your RobotFramework Test Scripts.
5
- Author-email: Marvin Klerx <marvinklerx1@gmail.com>
5
+ Author-email: Marvin Klerx <marvinklerx20@gmail.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.7
8
8
  Description-Content-Type: text/markdown
@@ -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,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "robotframework-testdoc"
7
- version = "0.1.5"
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"
11
- authors = [{ name = "Marvin Klerx", email = "marvinklerx1@gmail.com" }]
11
+ authors = [{ name = "Marvin Klerx", email = "marvinklerx20@gmail.com" }]
12
12
  license = { text = "MIT" }
13
13
 
14
14
  dependencies = [
@@ -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"]
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testdoc
3
- Version: 0.1.5
3
+ Version: 0.1.8
4
4
  Summary: A CLI Tool to generate a Test Documentation for your RobotFramework Test Scripts.
5
- Author-email: Marvin Klerx <marvinklerx1@gmail.com>
5
+ Author-email: Marvin Klerx <marvinklerx20@gmail.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.7
8
8
  Description-Content-Type: text/markdown
@@ -8,6 +8,7 @@ atest/test_cli.py
8
8
  atest/test_cli.robot
9
9
  atest/config/config_with_colors.toml
10
10
  atest/config/testdoc.toml
11
+ atest/config_pyproject/example_pyproject.toml
11
12
  docs/style_blue.png
12
13
  docs/style_dark.png
13
14
  docs/style_robot.png
@@ -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
- click.echo(click.style("""
50
+ entrypoint_msg = """
51
51
  ████████╗███████╗███████╗████████╗██████╗ ███████╗███████╗
52
52
  ╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██ ██╗██ ██║██╔════╝
53
53
  ██║ █████╗ ███████╗ ██║ ██ ██║██ ██║██║
54
54
  ██║ ██╔══╝ ╚════██║ ██║ ██ ██║██ ██║██║
55
55
  ██║ ███████╗███████║ ██║ ██████╔╝███████║███████╗
56
56
  ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝
57
- """, fg=color)
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
+ #####################################################################################
@@ -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
- if len(self.args.include) > 0:
29
- suite.configure(include_tags=self.args.include)
30
- if len(self.args.exclude) > 0:
31
- suite.configure(exclude_tags=self.args.exclude)
32
- return suite
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)