Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Added the generated date and plugin version number to the HTML report.
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Jun 20, 2012
1 parent 4f254e0 commit 19f96f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytest_mozwebqa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '1.0'

from pytest_mozwebqa import *

__version__ = pytest_mozwebqa.__version__
7 changes: 7 additions & 0 deletions pytest_mozwebqa/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import base64
import cgi
import datetime
import os
import py
import time
Expand Down Expand Up @@ -194,6 +195,7 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__):
self.config.option.environment or \
self.config.option.browser

generated = datetime.datetime.now()
configuration = {
'Base URL': self.config.option.base_url,
'Build': self.config.option.build,
Expand All @@ -208,6 +210,7 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__):
'Credentials': self.config.option.credentials_file,
'Sauce Labs Credentials': self.config.option.sauce_labs_credentials_file}

import pytest_mozwebqa
doc = html.html(
html.head(
html.title('Test Report'),
Expand All @@ -231,6 +234,10 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__):
'.screenshot, .video {border: 1px solid #e6e6e6; float:right; height:240px; margin-left:5px; overflow:hidden; width:320px}\n',
'.screenshot img {width: 320px}')),
html.body(
html.p('Report generated on %s at %s by pytest-mozwebqa %s' % (
generated.strftime('%d-%b-%Y'),
generated.strftime('%H:%M:%S'),
pytest_mozwebqa.__version__)),
html.h2('Configuration'),
html.table(
[html.tr(html.td(k), html.td(v)) for k, v in sorted(configuration.items()) if v],
Expand Down
1 change: 1 addition & 0 deletions pytest_mozwebqa/pytest_mozwebqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import credentials

__version__ = '1.0'

def pytest_configure(config):
if not hasattr(config, 'slaveinput'):
Expand Down

0 comments on commit 19f96f0

Please sign in to comment.