robotframework-testdoc 0.2.4__py3-none-any.whl → 0.2.7__py3-none-any.whl

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testdoc
3
- Version: 0.2.4
3
+ Version: 0.2.7
4
4
  Summary: A CLI Tool to generate a Test Documentation for your RobotFramework Test Scripts.
5
5
  Author-email: Marvin Klerx <marvinklerx20@gmail.com>
6
6
  License: Apache-2.0
@@ -118,6 +118,51 @@ For using this config file, just call the following command:
118
118
  testdoc -c path/to/config.toml tests/ TestDocumentation.html
119
119
  ```
120
120
 
121
+ ### pyproject.toml vs. custom toml file
122
+
123
+ Using the ``pyproject`` requires to define the ``testdoc`` sections with the prefix ``tool.``
124
+ Example section start: ``[tool.testdoc]``
125
+
126
+ Using your own custom toml-file, does not require you to use the prefix. Here, you can just use ``[testdoc]`` as section header.
127
+
128
+
129
+ ### Example Configuration File
130
+ ```toml
131
+ [tool.testdoc]
132
+ title = "New title of HTML document"
133
+ name = "New name of root suite element"
134
+ doc = "New doc text of root suite element"
135
+ sourceprefix = "gitlab::https://gitlab.com/myrepo/repo_path"
136
+ include = ["TagA", "TagB"]
137
+ exclude = ["TagC"]
138
+ hide_tags = true
139
+ hide_test_doc = true
140
+ hide_suite_doc = true
141
+ hide_source = true
142
+ hide_keywords = true
143
+ style = "blue"
144
+ verbose_mode = false
145
+
146
+ [tool.testdoc.metadata]
147
+ Author = "Your-Name"
148
+ Version = "1.0.0"
149
+ Source = "AnySourceAsMetaData"
150
+
151
+ [tool.testdoc.colors]
152
+ # Use predefined theme:
153
+ default = "blue"
154
+ # OR
155
+ # Use custom colors:
156
+ background = "#000028"
157
+ inner_color = "#000028"
158
+ button_active_color = "#193966"
159
+ button_hover_color = "#193966"
160
+ border_color = "#CCCCCC"
161
+ text_color = "#CCCCCC"
162
+ title_color = "#00ffb9"
163
+ robot_icon = "#00ffb9"
164
+ ```
165
+
121
166
  ## HTML Template Selection
122
167
 
123
168
  You can choose between multiple HTML template for the design of your test documentation.
@@ -165,15 +210,21 @@ Therefore, please use the following syntax: for the toml file
165
210
  # Use the default theme
166
211
  default = "default"
167
212
  default = 0
168
- # Use the default theme
213
+ # Use the dark theme
169
214
  default = "dark"
170
215
  default = 1
171
- # Use the default theme
216
+ # Use the blue theme
172
217
  default = "blue"
173
218
  default = 2
174
- # Use the default theme
219
+ # Use the robot theme
175
220
  default = "robot"
176
221
  default = 3
222
+ # Use the dark robot theme
223
+ default = "robot_dark"
224
+ default = 4
225
+ # Use the green theme
226
+ default = "green"
227
+ default = 5
177
228
  ```
178
229
 
179
230
  For setting it via CLI, please use the following:
@@ -0,0 +1,28 @@
1
+ robotframework_testdoc-0.2.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
+ testdoc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ testdoc/__main__.py,sha256=09c4nsw4Vnp1LaK0CnlofJQFbKmeFexOXyTBDY9NrFk,67
4
+ testdoc/cli.py,sha256=p2Ne3Fm9CwSk2YpfQnsj_xKM_UDw2wql_GR32tn3myM,4898
5
+ testdoc/default.toml,sha256=LDSW-RFTKhx4ZOmUkNswITUy_R4F9tiLjwhJWZ8R9R0,93
6
+ testdoc/testdoc.py,sha256=XC91wnOqeXZ_wLC8NczMbyuUWkFsBB6fX2Tbo2dzh0I,666
7
+ testdoc/helper/cliargs.py,sha256=UIaKhnX_goS-hRotYUl2dR1BDTU_5HLETkWvFw5J3h8,2526
8
+ testdoc/helper/datetimeconverter.py,sha256=1IuJ_rZlKKut3pallS9WSdlQ00YNQX2Nhf2oYWt7QDc,159
9
+ testdoc/helper/logger.py,sha256=STPEEdMIGpK004xHDskj8zzW3knBWP05GllYajQMaSY,272
10
+ testdoc/helper/pathconverter.py,sha256=yVxNE5-8dQQqhwEvA35whnhBSe_xPQxK8MwDKEmJfNk,840
11
+ testdoc/helper/toml_reader.py,sha256=z1Og6HG_g-wC8m3ael7FwQGayIxnobnl2GOYkQl8kHI,1543
12
+ testdoc/html/images/robotframework.svg,sha256=w1yNL6XtuHOCCwzjGX3pZQG7ZcJghzllvc7cQ9MKKbQ,1426
13
+ testdoc/html/rendering/render.py,sha256=KjHuymhFQETQmX6vLgUTWXH4QuH0zif6UGuNAJsagGM,1952
14
+ testdoc/html/templates/v1/jinja_template_01.html,sha256=H0CVKV3HljrdQeT_4hWJq3xNw6kc5vqiJtzCXoWBtdY,18389
15
+ testdoc/html/templates/v1/jinja_template_02.html,sha256=0CFAqCHQ035hsHgxZsirHgsdZO5-jdUH9SUQmy3EHkg,5152
16
+ testdoc/html/templates/v2/jinja_template_03.html,sha256=r0PJIgDp8oATZBp2hHD30djGZRMpSJA9GKuXa0HkCFc,15886
17
+ testdoc/html/themes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ testdoc/html/themes/theme_config.py,sha256=_DkCfP_ibr4vh8ppfEMNTEJGH8NrDDy9_lBKYbSuKAo,1679
19
+ testdoc/html/themes/themes.py,sha256=GuOOvUeczm5UiLLEdrigr0-ODcJ4Q2nZneW_9XleSxk,1640
20
+ testdoc/parser/testcaseparser.py,sha256=KVUOEd3E01B5dYQuV0vdpuVxwOvCRbMyhY1CtwFjAFQ,6830
21
+ testdoc/parser/testsuiteparser.py,sha256=ANbyfgaHdzjPpioTX2SDwq3F7qBnUda1MUCM5f1SOUs,5760
22
+ testdoc/parser/modifier/sourceprefixmodifier.py,sha256=Hg0fmpK9bnQB0uIm33VIkSh0RyayZfbLoI6ZwPnpfpk,3959
23
+ testdoc/parser/modifier/suitefilemodifier.py,sha256=bKTry7StKhT_foOWQKE_oApUA6f8kBEmT7D8zWXFHPI,4860
24
+ robotframework_testdoc-0.2.7.dist-info/METADATA,sha256=VmJKDtc4p0Ht1SeBbCjhryTu0dxlUJgG_vvMUgnxZd8,8177
25
+ robotframework_testdoc-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ robotframework_testdoc-0.2.7.dist-info/entry_points.txt,sha256=BUHy23mdlGCqYOWpsvRhSb1c0tPMzIwyTwr-sHI6xUs,45
27
+ robotframework_testdoc-0.2.7.dist-info/top_level.txt,sha256=p1axpYooAmdwwXQOzFsSXF3u_-88QFKCDxPf67siv3Y,8
28
+ robotframework_testdoc-0.2.7.dist-info/RECORD,,
testdoc/cli.py CHANGED
@@ -1,5 +1,4 @@
1
1
  import click
2
- import os
3
2
 
4
3
  from .testdoc import TestDoc
5
4
  from .helper.cliargs import CommandLineArguments
@@ -47,8 +46,12 @@ def main(
47
46
  path,
48
47
  output,
49
48
  ):
50
- """
51
- Welcome to robotframework-testdoc - the new test documentation generator for your Robot Framework tests!
49
+ """Welcome to robotframework-testdoc - the new test documentation generator for your Robot Framework tests!
50
+
51
+ # Basic Usage:
52
+ $ testdoc tests/ TestDocumentation.html
53
+
54
+ See more in the README.md of the GitHub Project: https://github.com/MarvKler/robotframework-testdoc/blob/main/README.md
52
55
  """
53
56
  color = "green"
54
57
  entrypoint_msg = """
@@ -62,38 +65,36 @@ def main(
62
65
  click.echo(click.style(entrypoint_msg, fg=color)
63
66
  )
64
67
 
65
- args_instance = CommandLineArguments()
66
- if configfile:
67
- if os.path.exists(configfile):
68
- args_instance.load_from_config_file(configfile)
69
- else:
70
- click.echo(click.style(f"⚠️ Config File not found: {configfile}", fg="yellow"))
68
+ args_to_set = dict(
69
+ title=title,
70
+ name=name,
71
+ doc=doc,
72
+ metadata=dict(item.split("=", 1) for item in metadata) if metadata else None,
73
+ sourceprefix=sourceprefix,
74
+ include=list(include),
75
+ exclude=list(exclude),
76
+ hide_tags=hide_tags,
77
+ hide_test_doc=hide_test_doc,
78
+ hide_suite_doc=hide_suite_doc,
79
+ hide_source=hide_source,
80
+ hide_keywords=hide_keywords,
81
+ style=style,
82
+ html_template=html_template,
83
+ config_file=configfile,
84
+ verbose_mode=verbose,
85
+ suite_file=list(path),
86
+ output_file=output,
87
+ )
88
+
89
+ # Expose CLI args
90
+ args_to_set = {k: v for k, v in args_to_set.items() if v is not None}
91
+ CommandLineArguments().set_args(**args_to_set)
71
92
 
72
- args = args_instance.data
73
- cli_params = {
74
- "title": title or None,
75
- "name": name or None,
76
- "doc": doc or None,
77
- "metadata": dict(item.split("=", 1) for item in metadata) if metadata else None,
78
- "sourceprefix": sourceprefix,
79
- "include": list(include) if include else None,
80
- "exclude": list(exclude) if exclude else None,
81
- "hide_tags": hide_tags or None,
82
- "hide_test_doc": hide_test_doc or None,
83
- "hide_suite_doc": hide_suite_doc or None,
84
- "hide_source": hide_source or None,
85
- "hide_keywords": hide_keywords or None,
86
- "verbose_mode": verbose or None,
87
- "style": style or None,
88
- "html_template": html_template or None,
89
- "config_file": configfile or None,
90
- }
91
- args.suite_file = path
92
- args.output_file = output
93
+ # Read & expose TOML args
94
+ if configfile:
95
+ from .helper.toml_reader import TOMLReader
96
+ TOMLReader().load_from_config_file(configfile)
93
97
 
94
- for key, value in cli_params.items():
95
- if value is not None:
96
- setattr(args, key, value)
97
98
  TestDoc().main()
98
99
 
99
100
  if __name__ == "__main__":
testdoc/default.toml CHANGED
@@ -1,3 +1,3 @@
1
1
  # Find here some default settings like the used default theme
2
2
  [default]
3
- theme = "dark"
3
+ theme = "robot_dark"
testdoc/helper/cliargs.py CHANGED
@@ -1,83 +1,100 @@
1
- from dataclasses import dataclass, field
2
- from typing import Any, List
3
- from .toml_reader import TOMLReader
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
- html_template: str = "v2"
25
- output_file: str = None
26
- colors: dict = None
27
-
28
1
  class CommandLineArguments:
29
2
  _instance = None
30
3
  def __new__(cls):
31
4
  if cls._instance is None:
32
5
  cls._instance = super().__new__(cls)
33
-
34
- cls.data = CommandLineArgumentsData()
6
+ cls._instance._args = {}
35
7
  return cls._instance
36
-
37
- ###
38
- ### Load configuration file
39
- ###
40
- def load_from_config_file(self, file_path: str):
41
- config = TOMLReader()._read_toml(file_path)
42
- _is_pyproject = self._is_pyproject_config(file_path)
43
- if _is_pyproject:
44
- self._handle_pyproject_config(config)
45
- else:
46
- self._handle_custom_config(config)
47
-
48
- ###
49
- ### Read pyproject.toml
50
- ###
51
- def _handle_pyproject_config(self, config: dict[str, Any]):
52
- testdoc_config = config.get("tool", {}).get("testdoc", {})
53
-
54
- if "colors" in testdoc_config:
55
- self.data.colors = testdoc_config["colors"]
56
-
57
- if "metadata" in testdoc_config:
58
- if hasattr(self.data, "metadata"):
59
- setattr(self.data, "metadata", testdoc_config["metadata"])
60
-
61
- for key, value in testdoc_config.items():
62
- if key in ("colors", "metadata"):
63
- continue
64
- if hasattr(self.data, key):
65
- setattr(self.data, key, value)
66
-
67
- ###
68
- ### Read custom.toml
69
- ###
70
- def _handle_custom_config(self, config: dict[str, Any]):
71
- if "colors" in config:
72
- self.data.colors = config["colors"]
73
8
 
74
- for key, value in config.items():
75
- if hasattr(self.data, key):
76
- setattr(self.data, key, value)
77
-
78
- #####################################################################################
9
+ def update_args_if_not_set(self, **kwargs):
10
+ for key, value in kwargs.items():
11
+ if key not in self._args:
12
+ self._args[key] = value
13
+
14
+ def set_args(self, **kwargs):
15
+ self._args = kwargs
79
16
 
80
- def _is_pyproject_config(self, file_path) -> bool:
81
- return os.path.basename(file_path) == "pyproject.toml"
17
+ def __getattr__(self, name):
18
+ if name in self._args:
19
+ return self._args[name]
20
+ raise AttributeError(f"'CommandLineArguments' object has no attribute '{name}'")
21
+
22
+ @property
23
+ def title(self):
24
+ return self._args.get("title", "Robot Framework - Test Documentation")
25
+
26
+ @property
27
+ def name(self):
28
+ return self._args.get("name", None)
29
+
30
+ @property
31
+ def doc(self):
32
+ return self._args.get("doc", None)
33
+
34
+ @property
35
+ def metadata(self):
36
+ return self._args.get("metadata", None)
37
+
38
+ @property
39
+ def sourceprefix(self):
40
+ return self._args.get("sourceprefix", None)
41
+
42
+ @property
43
+ def include(self):
44
+ return self._args.get("include", [])
45
+
46
+ @property
47
+ def exclude(self):
48
+ return self._args.get("exclude", [])
49
+
50
+ @property
51
+ def hide_tags(self):
52
+ return self._args.get("hide_tags", False)
53
+
54
+ @property
55
+ def hide_test_doc(self):
56
+ return self._args.get("hide_test_doc", False)
57
+
58
+ @property
59
+ def hide_suite_doc(self):
60
+ return self._args.get("hide_suite_doc", False)
61
+
62
+ @property
63
+ def hide_source(self):
64
+ return self._args.get("hide_source", False)
65
+
66
+ @property
67
+ def hide_keywords(self):
68
+ return self._args.get("hide_keywords", False)
69
+
70
+ @property
71
+ def config_file(self):
72
+ return self._args.get("config_file", None)
73
+
74
+ @property
75
+ def verbose_mode(self):
76
+ return self._args.get("verbose_mode", False)
77
+
78
+ @property
79
+ def suite_file(self):
80
+ return self._args.get("suite_file", None)
81
+
82
+ @property
83
+ def style(self):
84
+ return self._args.get("style", None)
85
+
86
+ @property
87
+ def html_template(self):
88
+ return self._args.get("html_template", "v2")
89
+
90
+ @property
91
+ def output_file(self):
92
+ return self._args.get("output_file", None)
93
+
94
+ @property
95
+ def colors(self):
96
+ return self._args.get("colors", None)
82
97
 
83
- #####################################################################################
98
+ @property
99
+ def all_as_dict(self):
100
+ return self._args
@@ -6,48 +6,16 @@ from .logger import Logger
6
6
  class PathConverter():
7
7
 
8
8
  def __init__(self):
9
- self.args = CommandLineArguments().data
9
+ self.args = CommandLineArguments()
10
10
 
11
11
  def path_convertion(self) -> str:
12
-
13
- suite_path = self.args.suite_file
14
12
  output_path = self.args.output_file
15
- config_path = self.args.config_file
16
-
17
- # Convert path to suite file / directory
18
- if type(suite_path) is tuple:
19
- suite_path = list(suite_path)
20
- for idx, item in enumerate(suite_path):
21
- _mod = PathConverter().conv_generic_path(item)
22
- suite_path[idx] = _mod
23
- else:
24
- suite_path = PathConverter().conv_generic_path(path=suite_path)
25
-
26
- # Convert path to output file
27
13
  output_path = PathConverter().conv_generic_path(path=output_path)
28
-
29
- # Convert path to config file
30
- if self.args.config_file:
31
- config_path = PathConverter().conv_generic_path(path=config_path)
32
-
14
+
33
15
  # Print to console
34
16
  if self.args.verbose_mode:
35
- msg = ""
36
- if type(suite_path) is not list:
37
- suite_path = list(suite_path)
38
-
39
- for item in suite_path:
40
- if ".robot" in suite_path:
41
- msg += f'Suite File: "{str(suite_path).split("/")[-1]}"\n'
42
- else:
43
- msg += f"Suite Directory: '{suite_path}'\n"
44
-
45
- Logger().Log("=== TestDoc ===")
46
- Logger().LogKeyValue("Generating Test Documentation for: ", msg)
47
17
  Logger().LogKeyValue("Saving to output file: ", output_path)
48
- Logger().LogKeyValue("Using config file: ", config_path) if config_path else None
49
-
50
- return suite_path, output_path, config_path
18
+ return output_path
51
19
 
52
20
  def conv_generic_path(self,
53
21
  path: str
@@ -1,11 +1,50 @@
1
+ from .cliargs import CommandLineArguments
2
+
1
3
  import tomli
4
+ import os
2
5
 
3
6
  class TOMLReader():
4
7
 
8
+ ###
9
+ ### Generic function to read toml files
10
+ ###
5
11
  def _read_toml(self, file_path:str):
6
12
  try:
7
13
  with open(file_path, "rb") as f:
8
14
  config = tomli.load(f)
9
15
  return config
10
16
  except Exception as e:
11
- raise ImportError(f"Cannot read toml file in: {file_path} with error: \n{e}")
17
+ raise ImportError(f"Cannot read toml file in: {file_path} with error: \n{e}")
18
+
19
+
20
+ ###
21
+ ### Functions to handle TOML files with configuration for testdoc tool
22
+ ###
23
+ def load_from_config_file(self, file_path: str):
24
+ config = TOMLReader()._read_toml(file_path)
25
+ is_pyproject = self._is_pyproject_config(file_path)
26
+
27
+ if is_pyproject:
28
+ self._handle_pyproject_config(config)
29
+ else:
30
+ self._handle_custom_config(config)
31
+
32
+ def _handle_pyproject_config(self, config: dict):
33
+ testdoc_config = config.get("tool", {}).get("testdoc", {})
34
+ self._apply_config_to_cliargs(testdoc_config)
35
+
36
+ def _handle_custom_config(self, config: dict):
37
+ self._apply_config_to_cliargs(config)
38
+
39
+ def _apply_config_to_cliargs(self, config: dict):
40
+ args_to_set = {}
41
+
42
+ for key, value in config.items():
43
+ if isinstance(value, tuple):
44
+ value = list(value)
45
+ args_to_set[key] = value
46
+
47
+ CommandLineArguments().update_args_if_not_set(**args_to_set)
48
+
49
+ def _is_pyproject_config(self, file_path) -> bool:
50
+ return os.path.basename(file_path) == "pyproject.toml"
@@ -1,15 +1,15 @@
1
1
  from jinja2 import Environment, FileSystemLoader
2
2
  import os
3
3
 
4
- from ..html.themes.theme_config import ThemeConfig
5
- from ..helper.cliargs import CommandLineArguments
6
- from ..helper.datetimeconverter import DateTimeConverter
7
- from ..helper.logger import Logger
4
+ from ...html.themes.theme_config import ThemeConfig
5
+ from ...helper.cliargs import CommandLineArguments
6
+ from ...helper.datetimeconverter import DateTimeConverter
7
+ from ...helper.logger import Logger
8
8
 
9
9
  class TestDocHtmlRendering():
10
10
 
11
11
  def __init__(self):
12
- self.args = CommandLineArguments().data
12
+ self.args = CommandLineArguments()
13
13
  self._html_templ_selection()
14
14
 
15
15
  def _html_templ_selection(self):
@@ -17,11 +17,11 @@ class TestDocHtmlRendering():
17
17
  if self.args.html_template == "v1":
18
18
  self.HTML_TEMPLATE_VERSION = self.args.html_template
19
19
  self.HTML_TEMPLATE_NAME = "jinja_template_01.html"
20
- self.TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "html", "templates", self.HTML_TEMPLATE_VERSION)
20
+ self.TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "templates", self.HTML_TEMPLATE_VERSION)
21
21
  elif self.args.html_template == "v2":
22
22
  self.HTML_TEMPLATE_VERSION = self.args.html_template
23
23
  self.HTML_TEMPLATE_NAME = "jinja_template_03.html"
24
- self.TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "html", "templates", self.HTML_TEMPLATE_VERSION)
24
+ self.TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "templates", self.HTML_TEMPLATE_VERSION)
25
25
  else:
26
26
  raise ValueError(f"CLI Argument 'html_template' got value '{self.args.html_template}' - value not known!")
27
27
 
@@ -77,11 +77,7 @@
77
77
  <tr>
78
78
  <td style="width: 10%; font-weight: bold;">🏷 Tags:</td>
79
79
  <td style="text-align: left;">
80
- {% if test.tags and test.tags is string %}
81
- {{ test.tags }}
82
- {% else %}
83
- {{ test.tags | join(', ') }}
84
- {% endif %}
80
+ {{ test.tags | join(', ') }}
85
81
  </td>
86
82
  </tr>
87
83
  {% endif %}
@@ -1,5 +1,5 @@
1
1
  from ...helper.cliargs import CommandLineArguments
2
- from .themes import DEFAULT_THEME, ROBOT_THEME, DARK_THEME, BLUE_THEME
2
+ from .themes import DEFAULT_THEME, ROBOT_THEME, DARK_THEME, BLUE_THEME, ROBOT_THEME_DARK, GREEN_THEME
3
3
 
4
4
  import os
5
5
  import tomli
@@ -9,7 +9,7 @@ class ThemeConfig():
9
9
  default_config = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "default.toml")
10
10
 
11
11
  def __init__(self):
12
- self.args = CommandLineArguments().data
12
+ self.args = CommandLineArguments()
13
13
  with open(self.default_config, "rb") as file:
14
14
  self.config = tomli.load(file)
15
15
 
@@ -38,4 +38,8 @@ class ThemeConfig():
38
38
  return ROBOT_THEME
39
39
  if theme == "blue" or theme == 3:
40
40
  return BLUE_THEME
41
+ if theme == "robot_dark" or theme == 4:
42
+ return ROBOT_THEME_DARK
43
+ if theme == "green" or theme == 5:
44
+ return GREEN_THEME
41
45
 
@@ -13,14 +13,36 @@ DEFAULT_THEME = {
13
13
  ROBOT_THEME = {
14
14
  "background": "#f8f9fa",
15
15
  "inner_color": "#f8f9fa",
16
- "button_active_color": "#C2C2C2",
17
- "button_hover_color": "#C2C2C2",
16
+ "button_active_color": "#dcdcdc",
17
+ "button_hover_color": "#dcdcdc",
18
18
  "border_color": "black",
19
19
  "text_color": "black",
20
20
  "title_color": "black",
21
21
  "robot_icon": "#00c0b5",
22
22
  }
23
23
 
24
+ ROBOT_THEME_DARK = {
25
+ "background": "#1b1b1d",
26
+ "inner_color": "#1b1b1d",
27
+ "button_active_color": "#272729",
28
+ "button_hover_color": "#5F5F5F",
29
+ "border_color": "#e3e3e3",
30
+ "text_color": "#e3e3e3",
31
+ "title_color": "#e3e3e3",
32
+ "robot_icon": "#00c0b5",
33
+ }
34
+
35
+ GREEN_THEME = {
36
+ "background": "#1e1e1e",
37
+ "inner_color": "#1e1e1e",
38
+ "button_active_color": "#272729",
39
+ "button_hover_color": "#5F5F5F",
40
+ "border_color": "#e3e3e3",
41
+ "text_color": "#009770",
42
+ "title_color": "#009770",
43
+ "robot_icon": "#009770",
44
+ }
45
+
24
46
  DARK_THEME = {
25
47
  "background": "#303030",
26
48
  "inner_color": "#303030",
@@ -39,7 +39,7 @@ class SourcePrefixModifier():
39
39
  GITLAB_CONNECTOR = "-/blob/main/"
40
40
 
41
41
  def __init__(self):
42
- self.args = CommandLineArguments().data
42
+ self.args = CommandLineArguments()
43
43
 
44
44
  def _prefix_validation(self, prefix: str) -> list:
45
45
  if "::" not in prefix:
@@ -85,7 +85,7 @@ class GitLabModifier():
85
85
  git_root = self._get_git_root(file_path)
86
86
  git_branch = self._get_git_branch(git_root)
87
87
  if not git_root:
88
- return "GitLink error"
88
+ return "Unable to fetch GitLab URL!"
89
89
  rel_path = os.path.relpath(file_path, git_root).replace(os.sep, "/")
90
90
  return prefix.rstrip("/") + "/-/blob/" + git_branch + "/" + rel_path
91
91
 
@@ -7,7 +7,7 @@ from .sourceprefixmodifier import SourcePrefixModifier
7
7
  class SuiteFileModifier():
8
8
 
9
9
  def __init__(self):
10
- self.args = CommandLineArguments().data
10
+ self.args = CommandLineArguments()
11
11
  self.suite = None
12
12
 
13
13
  #############################################################################################################################
@@ -7,7 +7,7 @@ import textwrap
7
7
  class TestCaseParser():
8
8
 
9
9
  def __init__(self):
10
- self.args = CommandLineArguments().data
10
+ self.args = CommandLineArguments()
11
11
 
12
12
  def parse_test(self,
13
13
  suite: TestSuite,
@@ -19,7 +19,7 @@ class TestCaseParser():
19
19
  "name": test.name,
20
20
  "doc": "<br>".join(line.replace("\\n","") for line in test.doc.splitlines()
21
21
  if line.strip()) if test.doc else "No Test Case Documentation Available",
22
- "tags": test.tags if test.tags else "No Tags Configured",
22
+ "tags": test.tags if test.tags else ["No Tags Configured"],
23
23
  "source": str(test.source),
24
24
  "keywords": self._keyword_parser(test.body)
25
25
  }
@@ -47,7 +47,7 @@ class TestCaseParser():
47
47
 
48
48
  # Fallback in case of no keywords
49
49
  if len(_keyword_object) == 0:
50
- return "No Keyword Calls in Test"
50
+ return ["No Keyword Calls in Test"]
51
51
  return _keyword_object
52
52
 
53
53
  def _handle_keyword_types(self, kw: Keyword, indent: int = 0):
@@ -105,6 +105,19 @@ class TestCaseParser():
105
105
  result.extend(self._handle_keyword_types(subkw, indent=indent+1))
106
106
  result.append(f"{_indent}END")
107
107
 
108
+ # GROUP loop
109
+ elif kw_type == "GROUP":
110
+ header = f"{_indent}GROUP"
111
+ if not kw.name == "":
112
+ header += f"{_sd}{kw.name}"
113
+ if hasattr(kw, 'condition') and kw.condition:
114
+ header += f" {kw.condition}"
115
+ result.append(header)
116
+ if hasattr(kw, 'body'):
117
+ for subkw in kw.body:
118
+ result.extend(self._handle_keyword_types(subkw, indent=indent+1))
119
+ result.append(f"{_indent}END")
120
+
108
121
  # WHILE loop
109
122
  elif kw_type == "WHILE":
110
123
  header = f"{_indent}WHILE"
@@ -134,13 +147,9 @@ class TestCaseParser():
134
147
  elif kw_type in ("BREAK", "CONTINUE", "RETURN", "ERROR"):
135
148
  entry = f"{_indent}{kw_type}"
136
149
  if hasattr(kw, 'values') and kw.values:
137
- entry += f" {' '.join(kw.values)}"
150
+ entry += f" {_sd.join(kw.values)}"
138
151
  result.append(entry)
139
152
 
140
- # Other types
141
- elif kw_type in ("COMMENT", "EMPTY"):
142
- pass
143
-
144
153
  # Unknown types
145
154
  elif hasattr(kw, 'body'):
146
155
  for subkw in kw.body:
@@ -21,7 +21,7 @@ class RobotSuiteParser(SuiteVisitor):
21
21
  self.suite_counter = 0
22
22
  self.suites = []
23
23
  self.tests = []
24
- self.args = CommandLineArguments().data
24
+ self.args = CommandLineArguments()
25
25
 
26
26
  def visit_suite(self, suite):
27
27
 
@@ -95,13 +95,6 @@ class RobotSuiteParser(SuiteVisitor):
95
95
  _include = self.args.include
96
96
  _exclude = self.args.exclude
97
97
  _source = self.args.suite_file
98
- # Type Conversions
99
- if type(_include) is not list:
100
- _include = list(_include)
101
- if type(_exclude) is not list:
102
- _exclude = list(_exclude)
103
- if type(_source) is not list:
104
- _source = list(_source)
105
98
 
106
99
  # Format / Syntax Conversions
107
100
  robot_options = []
testdoc/testdoc.py CHANGED
@@ -1,14 +1,11 @@
1
1
  from .helper.pathconverter import PathConverter
2
2
  from .parser.testsuiteparser import RobotSuiteParser
3
- from .html_rendering.render import TestDocHtmlRendering
3
+ from .html.rendering.render import TestDocHtmlRendering
4
4
  from .parser.modifier.suitefilemodifier import SuiteFileModifier
5
5
 
6
6
  class TestDoc():
7
7
 
8
- def main(self):
9
- # Convert to correct pathes
10
- suite_path, output_path, config_path = PathConverter().path_convertion()
11
-
8
+ def main(self):
12
9
  # Parse suite object & return complete suite object with all information
13
10
  suite_object = RobotSuiteParser().parse_suite()
14
11
 
@@ -16,4 +13,4 @@ class TestDoc():
16
13
  suite_object = SuiteFileModifier().run(suite_object)
17
14
 
18
15
  # Render HTML file
19
- TestDocHtmlRendering().render_testdoc(suite_object, output_path)
16
+ TestDocHtmlRendering().render_testdoc(suite_object, PathConverter().path_convertion())
@@ -1,28 +0,0 @@
1
- robotframework_testdoc-0.2.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
- testdoc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- testdoc/__main__.py,sha256=09c4nsw4Vnp1LaK0CnlofJQFbKmeFexOXyTBDY9NrFk,67
4
- testdoc/cli.py,sha256=el9eqTr4MjxF91XancigF6U7nJ5ffSXw7Wnhna3OkW0,5027
5
- testdoc/default.toml,sha256=PK7O2gat8326ZYOXBC1mt6-5ceBhdbgs0BL1uo4XLjQ,87
6
- testdoc/testdoc.py,sha256=tOombA0ozz-Z0AwjWiqQRSZEQsQlauAx2Ur4TFGhSZ4,762
7
- testdoc/helper/cliargs.py,sha256=nsgxXho8QAtcxF5B0OCriLuUEByGQwagDkvR7ISAGWA,2627
8
- testdoc/helper/datetimeconverter.py,sha256=1IuJ_rZlKKut3pallS9WSdlQ00YNQX2Nhf2oYWt7QDc,159
9
- testdoc/helper/logger.py,sha256=STPEEdMIGpK004xHDskj8zzW3knBWP05GllYajQMaSY,272
10
- testdoc/helper/pathconverter.py,sha256=iY7VBofJxiQHevlLO_kek80mwmaB9gdnHWmUzHowCqk,2096
11
- testdoc/helper/toml_reader.py,sha256=JUpCdUQAwS-zImH0fU9leziM8Mc9CXAAHFUs6E0eQRA,323
12
- testdoc/html/images/robotframework.svg,sha256=w1yNL6XtuHOCCwzjGX3pZQG7ZcJghzllvc7cQ9MKKbQ,1426
13
- testdoc/html/templates/v1/jinja_template_01.html,sha256=H0CVKV3HljrdQeT_4hWJq3xNw6kc5vqiJtzCXoWBtdY,18389
14
- testdoc/html/templates/v1/jinja_template_02.html,sha256=0CFAqCHQ035hsHgxZsirHgsdZO5-jdUH9SUQmy3EHkg,5152
15
- testdoc/html/templates/v2/jinja_template_03.html,sha256=gpQj8Fso-7sdQmC6rL_ym29CVf5fQXL0l0FoT7unS7c,16136
16
- testdoc/html/themes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- testdoc/html/themes/theme_config.py,sha256=3AFUSoddhAZswcEsshbvqcnmbLOFaBYUFy-lrfNBV3Q,1495
18
- testdoc/html/themes/themes.py,sha256=6xlHW7O-XO9Z1B33_aRwzffkuWR65jM7CYXsZWUjdmY,1091
19
- testdoc/html_rendering/render.py,sha256=Ij6Jtut7oUCM-z_FIz04A0showacIAIqbkArBg7I2u8,1969
20
- testdoc/parser/testcaseparser.py,sha256=CXZRS1mvHx1O6G2FgqF8T_dWp1RcSJbeN7Le0ZInows,6405
21
- testdoc/parser/testsuiteparser.py,sha256=7-t_Kdw6527x_bQ_IWJgrvUnGC2umK9mjjJToWVWC_k,6020
22
- testdoc/parser/modifier/sourceprefixmodifier.py,sha256=Vy_keEKztF7UrjtWjmkU7usGR7E-xLvxJOWocPRu6KI,3950
23
- testdoc/parser/modifier/suitefilemodifier.py,sha256=OuDuleQj4dRjUcu0AROEPZ-2vR3lWJfWmQVuoWLkXuY,4865
24
- robotframework_testdoc-0.2.4.dist-info/METADATA,sha256=WgiWRg8dvdknyZwbEZjylKf-RwbC1uk8Ooqyhj8XzPE,6947
25
- robotframework_testdoc-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- robotframework_testdoc-0.2.4.dist-info/entry_points.txt,sha256=BUHy23mdlGCqYOWpsvRhSb1c0tPMzIwyTwr-sHI6xUs,45
27
- robotframework_testdoc-0.2.4.dist-info/top_level.txt,sha256=p1axpYooAmdwwXQOzFsSXF3u_-88QFKCDxPf67siv3Y,8
28
- robotframework_testdoc-0.2.4.dist-info/RECORD,,