Repository: adiralashiva8/robotframework-metrics
Branch: master
Commit: 593a0d6ab9cd
Files: 16
Total size: 57.3 KB
Directory structure:
gitextract_e0lyx8s4/
├── .gitignore
├── LICENSE
├── MANIFEST.in
├── README.md
├── robotframework_metrics/
│ ├── __init__.py
│ ├── dashboard_stats.py
│ ├── details.py
│ ├── keyword_results.py
│ ├── keyword_times.py
│ ├── robotmetrics.py
│ ├── runner.py
│ ├── suite_results.py
│ ├── templates/
│ │ └── index.html
│ ├── test_results.py
│ └── version.py
└── setup.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
### Python Patch ###
.venv/
# End of https://www.gitignore.io/api/python
*.xml
metrics.html
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2019 Shiva Prasad Adirala
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: MANIFEST.in
================================================
recursive-include robotframework_metrics/templates *
include MANIFEST.in
================================================
FILE: README.md
================================================
Dashboard
| {{test_stats['Total']}} |
{{test_stats['Pass']}} |
| Total |
Pass |
| {{test_stats['Fail']}} |
{{test_stats['Skip']}} |
| Fail |
Skip |
| Type |
Min |
Max |
Avg |
| Suite |
{{(suite_stats['Min']/60000)|round(2)}} |
{{(suite_stats['Max']/60000)|round(2)}} |
{{(suite_stats['Avg']/60000)|round(2)}} |
| Test |
{{(test_stats['Min']/60000)|round(2)}} |
{{(test_stats['Max']/60000)|round(2)}} |
{{(test_stats['Avg']/60000)|round(2)}} |
| Action |
Time |
| Start Time |
{{ execution_stats[0] }} |
| End Time |
{{ execution_stats[1] }} |
| Duration |
{{ execution_stats[2] }} |
KW Times Metrics
| Keyword Name |
Times |
Fail Count |
Min Duration(s) |
Max Duration(s) |
Average Duration(s) |
{% if not keyword_times.empty %}
{% for key, value in keyword_times.iterrows() %}
| {{ value['Name'] }} |
{{ value['times'] }} |
{{ value['fail_count'] }} |
{{ (value['time_min']/1000)|round(2) }} |
{{ (value['time_max']/1000)|round(2) }} |
{{ (value['time_mean']/1000)|round(2) }} |
{% endfor %}
{% endif %}
================================================
FILE: robotframework_metrics/test_results.py
================================================
from robot.api import ResultVisitor
from robot.utils.markuputils import html_format
class TestResults(ResultVisitor):
def __init__(self, test_list):
self.test_list = test_list
def visit_test(self, test):
suite_name = test.parent if test.parent else test.parent.name
test_json = {
"Suite Name" : suite_name,
"Test Name" : test.name,
"Test Id" : test.id,
"Status" : test.status,
"Documentation" : html_format(test.doc),
"Time" : test.elapsedtime,
# "Message" : html_format(test.message),
"Message" : str(test.message).replace("*HTML*",""),
"Tags" : test.tags,
'start_time': test.starttime,
'end_time': test.endtime,
}
self.test_list.append(test_json)
================================================
FILE: robotframework_metrics/version.py
================================================
__version__ = "3.6.0"
================================================
FILE: setup.py
================================================
from setuptools import setup, find_packages
setup(
name='robotframework-metrics',
version="3.6.0",
description='Custom report for robot framework',
long_description='Custom html report generator using robot.result api',
classifiers=[
'Framework :: Robot Framework',
'Programming Language :: Python',
'Topic :: Software Development :: Testing',
],
keywords='robotframework report',
author='Shiva Prasad Adirala',
author_email='adiralashiva8@gmail.com',
url='https://github.com/adiralashiva8/robotframework-metrics',
license='MIT',
packages=find_packages(),
include_package_data= True,
zip_safe=False,
install_requires=[
'robotframework',
'jinja2',
'pandas',
],
entry_points={
'console_scripts': [
'robotmetrics=robotframework_metrics.runner:main',
]
},
)