robotframework-testdoc 0.1.7__tar.gz → 0.2.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.

Potentially problematic release.


This version of robotframework-testdoc might be problematic. Click here for more details.

Files changed (50) hide show
  1. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/.gitignore +2 -0
  2. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/PKG-INFO +38 -1
  3. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/README.md +37 -0
  4. robotframework_testdoc-0.2.0/atest/config_pyproject/example_pyproject.toml +32 -0
  5. robotframework_testdoc-0.2.0/docs/html_v1_common.png +0 -0
  6. robotframework_testdoc-0.2.0/docs/html_v2_root.png +0 -0
  7. robotframework_testdoc-0.2.0/docs/html_v2_suitefile.png +0 -0
  8. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/pyproject.toml +15 -3
  9. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/PKG-INFO +38 -1
  10. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/SOURCES.txt +8 -1
  11. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/cli.py +9 -3
  12. robotframework_testdoc-0.2.0/src/testdoc/helper/cliargs.py +83 -0
  13. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/helper/pathconverter.py +1 -1
  14. robotframework_testdoc-0.2.0/src/testdoc/helper/toml_reader.py +11 -0
  15. {robotframework_testdoc-0.1.7/src/testdoc/html/templates → robotframework_testdoc-0.2.0/src/testdoc/html/templates/v1}/jinja_template_01.html +4 -2
  16. robotframework_testdoc-0.2.0/src/testdoc/html/templates/v1/jinja_template_02.html +116 -0
  17. robotframework_testdoc-0.2.0/src/testdoc/html/templates/v2/jinja_template_03.html +316 -0
  18. robotframework_testdoc-0.2.0/src/testdoc/html_rendering/render.py +44 -0
  19. robotframework_testdoc-0.2.0/src/testdoc/parser/testcaseparser.py +167 -0
  20. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/parser/testsuiteparser.py +4 -0
  21. robotframework_testdoc-0.1.7/src/testdoc/helper/cliargs.py +0 -44
  22. robotframework_testdoc-0.1.7/src/testdoc/html_rendering/render.py +0 -31
  23. robotframework_testdoc-0.1.7/src/testdoc/parser/testcaseparser.py +0 -32
  24. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/.github/workflows/build-publish.yml +0 -0
  25. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/.github/workflows/release.yml +0 -0
  26. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/LICENSE +0 -0
  27. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/atest/config/config_with_colors.toml +0 -0
  28. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/atest/config/testdoc.toml +0 -0
  29. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/atest/test_cli.py +0 -0
  30. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/atest/test_cli.robot +0 -0
  31. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/docs/style_blue.png +0 -0
  32. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/docs/style_dark.png +0 -0
  33. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/docs/style_robot.png +0 -0
  34. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/setup.cfg +0 -0
  35. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/dependency_links.txt +0 -0
  36. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/entry_points.txt +0 -0
  37. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/requires.txt +0 -0
  38. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/robotframework_testdoc.egg-info/top_level.txt +0 -0
  39. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/__init__.py +0 -0
  40. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/__main__.py +0 -0
  41. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/default.toml +0 -0
  42. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/helper/datetimeconverter.py +0 -0
  43. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/helper/logger.py +0 -0
  44. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/html/images/robotframework.svg +0 -0
  45. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/html/themes/__init__.py +0 -0
  46. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/html/themes/theme_config.py +0 -0
  47. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/html/themes/themes.py +0 -0
  48. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/parser/modifier/sourceprefixmodifier.py +0 -0
  49. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/parser/modifier/suitefilemodifier.py +0 -0
  50. {robotframework_testdoc-0.1.7 → robotframework_testdoc-0.2.0}/src/testdoc/testdoc.py +0 -0
@@ -9,3 +9,5 @@ output_doc.html
9
9
  output.html
10
10
  src/testdoc/html/templates/jinja_template_02.html
11
11
  image.png
12
+ output_doc_robot.html
13
+ devel.html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testdoc
3
- Version: 0.1.7
3
+ Version: 0.2.0
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: MIT
@@ -15,6 +15,12 @@ Dynamic: license-file
15
15
 
16
16
  # Robot Framework TestDoc
17
17
 
18
+ ## Statistics
19
+
20
+ [![Release Pipeline](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml/badge.svg)](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml)
21
+ [![PyPI Downloads - Total](https://static.pepy.tech/badge/robotframework-testdoc)](https://pepy.tech/projects/robotframework-testdoc)
22
+ [![PyPI Downloads - Monthly](https://static.pepy.tech/badge/robotframework-testdoc/month)](https://pepy.tech/projects/robotframework-testdoc)
23
+
18
24
  ## Installation
19
25
 
20
26
  Install the tool using the following command:
@@ -98,6 +104,37 @@ For using this config file, just call the following command:
98
104
  testdoc -c path/to/config.toml tests/ TestDocumentation.html
99
105
  ```
100
106
 
107
+ ## HTML Template Selection
108
+
109
+ You can choose between multiple HTML template for the design of your test documentation.
110
+ These template can be configured via ``cli arguments`` or within a ``.toml configuration file`` with the parameter ``html_template (-ht / --html-template)``.
111
+
112
+ ### Default Design
113
+
114
+ - v2
115
+
116
+ ### Available HTML Templates
117
+
118
+ You can choose one of the following designs:
119
+ - v1
120
+ - v2
121
+
122
+ ### Version 1
123
+
124
+ #### Visit Tests
125
+
126
+ ![alt text](docs/html_v1_common.png)
127
+
128
+ ### Version 2
129
+
130
+ #### Visit Tests on Root Suite Level
131
+
132
+ ![alt text](docs/html_v2_root.png)
133
+
134
+ #### Visit Tests on Suite File Level
135
+
136
+ ![alt text](docs/html_v2_suitefile.png)
137
+
101
138
  ## Theme Selection / Color Configuration
102
139
 
103
140
  You can select between several themes (color configurations) for your HTML document to create!
@@ -1,5 +1,11 @@
1
1
  # Robot Framework TestDoc
2
2
 
3
+ ## Statistics
4
+
5
+ [![Release Pipeline](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml/badge.svg)](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml)
6
+ [![PyPI Downloads - Total](https://static.pepy.tech/badge/robotframework-testdoc)](https://pepy.tech/projects/robotframework-testdoc)
7
+ [![PyPI Downloads - Monthly](https://static.pepy.tech/badge/robotframework-testdoc/month)](https://pepy.tech/projects/robotframework-testdoc)
8
+
3
9
  ## Installation
4
10
 
5
11
  Install the tool using the following command:
@@ -83,6 +89,37 @@ For using this config file, just call the following command:
83
89
  testdoc -c path/to/config.toml tests/ TestDocumentation.html
84
90
  ```
85
91
 
92
+ ## HTML Template Selection
93
+
94
+ You can choose between multiple HTML template for the design of your test documentation.
95
+ These template can be configured via ``cli arguments`` or within a ``.toml configuration file`` with the parameter ``html_template (-ht / --html-template)``.
96
+
97
+ ### Default Design
98
+
99
+ - v2
100
+
101
+ ### Available HTML Templates
102
+
103
+ You can choose one of the following designs:
104
+ - v1
105
+ - v2
106
+
107
+ ### Version 1
108
+
109
+ #### Visit Tests
110
+
111
+ ![alt text](docs/html_v1_common.png)
112
+
113
+ ### Version 2
114
+
115
+ #### Visit Tests on Root Suite Level
116
+
117
+ ![alt text](docs/html_v2_root.png)
118
+
119
+ #### Visit Tests on Suite File Level
120
+
121
+ ![alt text](docs/html_v2_suitefile.png)
122
+
86
123
  ## Theme Selection / Color Configuration
87
124
 
88
125
  You can select between several themes (color configurations) for your HTML document to create!
@@ -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,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "robotframework-testdoc"
7
- version = "0.1.7"
7
+ version = "0.2.0"
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 = "marvinklerx20@gmail.com" }]
11
+ authors = [
12
+ { name = "Marvin Klerx", email = "marvinklerx20@gmail.com" }
13
+ ]
12
14
  license = { text = "MIT" }
13
15
 
14
16
  dependencies = [
@@ -21,8 +23,18 @@ dependencies = [
21
23
  [project.scripts]
22
24
  testdoc = "testdoc.cli:main"
23
25
 
26
+ [tool.setuptools]
27
+ include-package-data = true
28
+
29
+ [tool.setuptools.package-data]
30
+ "testdoc" = [
31
+ "html/images/*.svg",
32
+ "html/templates/**/*.html",
33
+ "default.toml"
34
+ ]
35
+
24
36
  [tool.ruff]
25
37
  line-length = 150
26
38
  lint.select = ["E", "F"] # Pyflakes & pycodestyle
27
39
  lint.ignore = ["E722"]
28
- exclude = ["build", "dist"]
40
+ exclude = ["build", "dist"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotframework-testdoc
3
- Version: 0.1.7
3
+ Version: 0.2.0
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: MIT
@@ -15,6 +15,12 @@ Dynamic: license-file
15
15
 
16
16
  # Robot Framework TestDoc
17
17
 
18
+ ## Statistics
19
+
20
+ [![Release Pipeline](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml/badge.svg)](https://github.com/MarvKler/robotframework-testdoc/actions/workflows/release.yml)
21
+ [![PyPI Downloads - Total](https://static.pepy.tech/badge/robotframework-testdoc)](https://pepy.tech/projects/robotframework-testdoc)
22
+ [![PyPI Downloads - Monthly](https://static.pepy.tech/badge/robotframework-testdoc/month)](https://pepy.tech/projects/robotframework-testdoc)
23
+
18
24
  ## Installation
19
25
 
20
26
  Install the tool using the following command:
@@ -98,6 +104,37 @@ For using this config file, just call the following command:
98
104
  testdoc -c path/to/config.toml tests/ TestDocumentation.html
99
105
  ```
100
106
 
107
+ ## HTML Template Selection
108
+
109
+ You can choose between multiple HTML template for the design of your test documentation.
110
+ These template can be configured via ``cli arguments`` or within a ``.toml configuration file`` with the parameter ``html_template (-ht / --html-template)``.
111
+
112
+ ### Default Design
113
+
114
+ - v2
115
+
116
+ ### Available HTML Templates
117
+
118
+ You can choose one of the following designs:
119
+ - v1
120
+ - v2
121
+
122
+ ### Version 1
123
+
124
+ #### Visit Tests
125
+
126
+ ![alt text](docs/html_v1_common.png)
127
+
128
+ ### Version 2
129
+
130
+ #### Visit Tests on Root Suite Level
131
+
132
+ ![alt text](docs/html_v2_root.png)
133
+
134
+ #### Visit Tests on Suite File Level
135
+
136
+ ![alt text](docs/html_v2_suitefile.png)
137
+
101
138
  ## Theme Selection / Color Configuration
102
139
 
103
140
  You can select between several themes (color configurations) for your HTML document to create!
@@ -8,6 +8,10 @@ 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
12
+ docs/html_v1_common.png
13
+ docs/html_v2_root.png
14
+ docs/html_v2_suitefile.png
11
15
  docs/style_blue.png
12
16
  docs/style_dark.png
13
17
  docs/style_robot.png
@@ -26,8 +30,11 @@ src/testdoc/helper/cliargs.py
26
30
  src/testdoc/helper/datetimeconverter.py
27
31
  src/testdoc/helper/logger.py
28
32
  src/testdoc/helper/pathconverter.py
33
+ src/testdoc/helper/toml_reader.py
29
34
  src/testdoc/html/images/robotframework.svg
30
- src/testdoc/html/templates/jinja_template_01.html
35
+ src/testdoc/html/templates/v1/jinja_template_01.html
36
+ src/testdoc/html/templates/v1/jinja_template_02.html
37
+ src/testdoc/html/templates/v2/jinja_template_03.html
31
38
  src/testdoc/html/themes/__init__.py
32
39
  src/testdoc/html/themes/theme_config.py
33
40
  src/testdoc/html/themes/themes.py
@@ -4,7 +4,8 @@ import os
4
4
  from .testdoc import TestDoc
5
5
  from .helper.cliargs import CommandLineArguments
6
6
 
7
- @click.command()
7
+ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
8
+ @click.command(context_settings=CONTEXT_SETTINGS)
8
9
  @click.option("-t","--title", required=False, help="Modify the title of the test documentation page")
9
10
  @click.option("-n","--name", required=False, help="Modify the name of the root suite element")
10
11
  @click.option("-d","--doc", required=False, help="Modify the documentation of the root suite element")
@@ -20,8 +21,10 @@ from .helper.cliargs import CommandLineArguments
20
21
  @click.option("--hide-source", is_flag=True, required=False, help="If given, test suite/ test case source is hidden")
21
22
  @click.option("--hide-keywords", is_flag=True, required=False, help="If given, keyword calls in test cases are hidden")
22
23
  @click.option("-S", "--style", required=False, help="Choose a predefined default style theme - 'default', 'robot', 'dark' or 'blue' ")
24
+ @click.option("-ht","--html-template", required=False, help="Select the HTML template - possible values: 'v1', 'v2'")
23
25
  @click.option("-c", "--configfile", required=False, help="Optional .toml configuration file (includes all cmd-args)")
24
26
  @click.option("-v", "--verbose", is_flag=True, required=False, help="More precise debugging into shell")
27
+ @click.version_option(package_name='robotframework-testdoc')
25
28
  @click.argument("PATH")
26
29
  @click.argument("OUTPUT")
27
30
  def main(
@@ -38,6 +41,7 @@ def main(
38
41
  hide_source,
39
42
  hide_keywords,
40
43
  style,
44
+ html_template,
41
45
  configfile,
42
46
  verbose,
43
47
  path,
@@ -47,14 +51,15 @@ def main(
47
51
  Welcome to robotframework-testdoc - the new test documentation generator for your Robot Framework tests!
48
52
  """
49
53
  color = "green"
50
- click.echo(click.style("""
54
+ entrypoint_msg = """
51
55
  ████████╗███████╗███████╗████████╗██████╗ ███████╗███████╗
52
56
  ╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██ ██╗██ ██║██╔════╝
53
57
  ██║ █████╗ ███████╗ ██║ ██ ██║██ ██║██║
54
58
  ██║ ██╔══╝ ╚════██║ ██║ ██ ██║██ ██║██║
55
59
  ██║ ███████╗███████║ ██║ ██████╔╝███████║███████╗
56
60
  ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝
57
- """, fg=color)
61
+ """
62
+ click.echo(click.style(entrypoint_msg, fg=color)
58
63
  )
59
64
 
60
65
  args_instance = CommandLineArguments()
@@ -80,6 +85,7 @@ def main(
80
85
  "hide_keywords": hide_keywords or None,
81
86
  "verbose_mode": verbose or None,
82
87
  "style": style or None,
88
+ "html_template": html_template or None,
83
89
  "config_file": configfile or None,
84
90
  }
85
91
  args.suite_file = path
@@ -0,0 +1,83 @@
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
+ class CommandLineArguments:
29
+ _instance = None
30
+ def __new__(cls):
31
+ if cls._instance is None:
32
+ cls._instance = super().__new__(cls)
33
+
34
+ cls.data = CommandLineArgumentsData()
35
+ 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
+
74
+ for key, value in config.items():
75
+ if hasattr(self.data, key):
76
+ setattr(self.data, key, value)
77
+
78
+ #####################################################################################
79
+
80
+ def _is_pyproject_config(self, file_path) -> bool:
81
+ return os.path.basename(file_path) == "pyproject.toml"
82
+
83
+ #####################################################################################
@@ -17,7 +17,7 @@ class PathConverter():
17
17
  # Convert path to suite file / directory
18
18
  suite_path = PathConverter().conv_generic_path(path=suite_path)
19
19
  if ".robot" in suite_path:
20
- msg = f"Suite File: '{str(suite_path).split("/")[-1]}'"
20
+ msg = f'Suite File: "{str(suite_path).split("/")[-1]}"'
21
21
  else:
22
22
  msg = f"Suite Directory: '{suite_path}'"
23
23
 
@@ -0,0 +1,11 @@
1
+ import tomli
2
+
3
+ class TOMLReader():
4
+
5
+ def _read_toml(self, file_path:str):
6
+ try:
7
+ with open(file_path, "rb") as f:
8
+ config = tomli.load(f)
9
+ return config
10
+ except Exception as e:
11
+ raise ImportError(f"Cannot read toml file in: {file_path} with error: \n{e}")
@@ -121,7 +121,9 @@
121
121
  <tr>
122
122
  <td style="width: 10%; font-weight: bold;">🏷 Tags:</td>
123
123
  <td style="text-align: left;">
124
- {% if test.tags %}
124
+ {% if test.tags and test.tags is string %}
125
+ {{ test.tags }}
126
+ {% else %}
125
127
  {{ test.tags | join(', ') }}
126
128
  {% endif %}
127
129
  </td>
@@ -132,7 +134,7 @@
132
134
  <td style="width: 10%; font-weight: bold; vertical-align: top;">🔑 Keywords:</td>
133
135
  <td style="text-align: left;">
134
136
  {% if test.keywords %}
135
- - {{ test.keywords | join('<br>- ') }}
137
+ <pre>- {{ test.keywords | join('\n- ') }}</pre>
136
138
  {% endif %}
137
139
  </td>
138
140
  </tr>
@@ -0,0 +1,116 @@
1
+ <!DOCTYPE html>
2
+ <html lang="de">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Robot Framework - Test Documentation</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
9
+ <style>
10
+ html, body, .container-fluid {
11
+ background-color: {{ colors.background }};
12
+ color: {{ colors.text_color }};
13
+ font-size: 14px;
14
+ }
15
+ a {
16
+ color: {{ colors.text_color }};
17
+ }
18
+ a:hover {
19
+ color: {{ colors.robot_icon }};
20
+ }
21
+ .sidebar {
22
+ min-width: 250px;
23
+ max-width: 250px;
24
+ background-color: {{ colors.inner_color }};
25
+ border-right: 1px solid {{ colors.border_color }};
26
+ height: 100vh;
27
+ overflow-y: auto;
28
+ }
29
+ .content {
30
+ padding: 20px;
31
+ flex-grow: 1;
32
+ }
33
+ .suite-item {
34
+ padding: 8px 16px;
35
+ cursor: pointer;
36
+ }
37
+ .suite-item:hover {
38
+ background-color: {{ colors.button_hover_color }};
39
+ }
40
+ .accordion-item, .accordion-body {
41
+ background-color: {{ colors.inner_color }};
42
+ border-color: {{ colors.border_color }};
43
+ color: {{ colors.text_color }};
44
+ }
45
+ .accordion-button {
46
+ background-color: {{ colors.inner_color }};
47
+ color: {{ colors.text_color }};
48
+ }
49
+ .accordion-button:hover {
50
+ background-color: {{ colors.button_hover_color }} !important;
51
+ }
52
+ .accordion-button:not(.collapsed),
53
+ .accordion-button:focus,
54
+ .accordion-button:active {
55
+ background-color: {{ colors.button_active_color }} !important;
56
+ box-shadow: none !important;
57
+ color: {{ colors.text_color }};
58
+ }
59
+ .generated_at {
60
+ color: {{ colors.title_color }};
61
+ }
62
+ </style>
63
+ </head>
64
+ <body class="d-flex flex-column min-vh-100">
65
+ <div class="d-flex flex-grow-1">
66
+ <div class="sidebar">
67
+ <h5 class="text-center mt-3">📁 Suites</h5>
68
+ <ul class="list-unstyled">
69
+ {% for suite in suites %}
70
+ <li class="suite-item" onclick="showSuite('{{ loop.index0 }}')">{{ suite.name }}</li>
71
+ {% endfor %}
72
+ </ul>
73
+ </div>
74
+ <div class="content">
75
+ {% for suite in suites %}
76
+ <div id="suite-{{ loop.index0 }}" class="suite-view" style="display: {% if loop.first %}block{% else %}none{% endif %};">
77
+ <h4>{{ suite.name }}</h4>
78
+ {% if suite.doc %}<p><strong>📝 Docs:</strong> {{ suite.doc }}</p>{% endif %}
79
+ {% if suite.source %}<p><strong>🔗 Source:</strong> <a href="{{ suite.source }}" target="_blank">{{ suite.source }}</a></p>{% endif %}
80
+ <p><strong>📊 Number of Tests:</strong> {{ suite.num_tests }}</p>
81
+
82
+ {% for test in suite.tests %}
83
+ <div class="accordion mb-3">
84
+ <div class="accordion-item">
85
+ <h2 class="accordion-header">
86
+ <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#test-{{ loop.index0 }}-{{ loop.index }}">
87
+ 🔍 {{ test.name }}
88
+ </button>
89
+ </h2>
90
+ <div id="test-{{ loop.index0 }}-{{ loop.index }}" class="accordion-collapse collapse">
91
+ <div class="accordion-body">
92
+ {% if test.doc %}<p><strong>📝 Docs:</strong><br>{{ test.doc }}</p>{% endif %}
93
+ {% if test.source %}<p><strong>🔗 Source:</strong> <a href="{{ test.source }}" target="_blank">{{ test.source }}</a></p>{% endif %}
94
+ {% if test.tags %}<p><strong>🏷 Tags:</strong> {{ test.tags | join(', ') }}</p>{% endif %}
95
+ {% if test.keywords %}<p><strong>🔑 Keywords:</strong><br>- {{ test.keywords | join('<br>- ') }}</p>{% endif %}
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ {% endfor %}
101
+ </div>
102
+ {% endfor %}
103
+ </div>
104
+ </div>
105
+ <p class="text-center generated_at py-1 border-top">
106
+ Generated at: {{ generated_at }}<br>robotframework-testdoc by Marvin Klerx
107
+ </p>
108
+ <script>
109
+ function showSuite(index) {
110
+ const views = document.querySelectorAll('.suite-view');
111
+ views.forEach(view => view.style.display = 'none');
112
+ document.getElementById('suite-' + index).style.display = 'block';
113
+ }
114
+ </script>
115
+ </body>
116
+ </html>