Skip to content

Commit

Permalink
#4
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanth-sams committed Jul 24, 2020
1 parent 99382aa commit c9bba7d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pytest_html_reporter/plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import os, time
from datetime import date
from pytest_html_reporter.template import html_template

_total = _executed = 0
Expand Down Expand Up @@ -245,6 +246,9 @@ def increment_error(self):
global _error
_error += 1

def _date(self):
return date.today().strftime("%B %d, %Y")

def renew_template_text(self, logo_url):
template_text = html_template()
template_text = template_text.replace("__custom_logo__", logo_url)
Expand All @@ -263,4 +267,5 @@ def renew_template_text(self, logo_url):
template_text = template_text.replace("__xfail__", str(_xfail))
template_text = template_text.replace("__suite_metrics_row__", str(_suite_metrics_content))
template_text = template_text.replace("__test_metrics_row__", str(_test_metrics_content))
template_text = template_text.replace("__date__", str(self._date()))
return template_text
21 changes: 20 additions & 1 deletion pytest_html_reporter/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def html_template():
</div>
</div>
<div class="card__header">
<span class="header__date">July 24, 2020</span>
<span class="header__date">__date__</span>
</div>
<div style="display: flex;">
<span class="total__count">__total__</span>
Expand Down Expand Up @@ -279,6 +279,25 @@ def html_template():
</div>
</div>
</div>
<div style="max-width: 49%; padding-left: 15%;">
<div class="card" style="width:150%;height:500px;text-align: center;">
<div class="card__content">
<div>
</div>
<div>
<div style="width: 600px;height: 350px; margin-left: 22%;margin-top: -50%;">
<canvas class="chart" id="myChart" style="margin-top: 6%; height: 290px;"></canvas>
</div>
<div style="margin-top: -5%;">
<div class="card__footer">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr/>
<div class="row">
Expand Down

0 comments on commit c9bba7d

Please sign in to comment.