-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from adiralashiva8/show_suite_test_keyword_met…
…rics_in_email Show suite, test and keyword metrics in email
- Loading branch information
Showing
5 changed files
with
91 additions
and
73 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,11 +444,11 @@ def start_keyword(self,kw): | |
executeDataTable('#tm',5); | ||
executeDataTable('#km',5); | ||
createPieChart(%s,%s,'suiteChartID','Suite Status:'); | ||
createBarGraph('#sm',0,4,10,'suiteBarID','Top 10 Suite Performance:'); | ||
createBarGraph('#sm',0,4,10,'suiteBarID','Top 10 Suite Performance:','Suite'); | ||
createPieChart(%s,%s,'testChartID','Tests Status:'); | ||
createBarGraph('#tm',1,5,10,'testsBarID','Top 10 Tests Performance:'); | ||
createBarGraph('#tm',1,5,10,'testsBarID','Top 10 Tests Performance:','Test'); | ||
createPieChart(%s,%s,'keywordChartID','Keywords Status:'); | ||
createBarGraph('#km',1,5,10,'keywordsBarID','Top 10 Keywords Performance:') | ||
createBarGraph('#km',1,5,10,'keywordsBarID','Top 10 Keywords Performance:','Keyword') | ||
}; | ||
</script> | ||
</div> | ||
|
@@ -771,9 +771,22 @@ def start_keyword(self,kw): | |
emailStatistics=""" | ||
<h4><b><i class="fa fa-envelope-o"></i> Email Statistics</b></h4> | ||
<hr> | ||
<h6><ul><li>Click 'Generate Statistics Email' button to get generate statistics email</li><li>Click 'Click Here To Download Email' link to download generated email</ul></h6> | ||
<button id="create" class="btn btn-primary active" role="button" ><i class="fa fa-cogs"></i> Generate Statistics Email</button><br><br> | ||
<a download="message.eml" class="btn btn-secondary active" role="button" id="downloadlink" style="display: none; width: 300px;font-weight: bold;"><i class="fa fa-download"></i> Click Here To Download Email</a> | ||
<button id="create" class="btn btn-primary active" role="button" onclick="updateTextArea();this.style.visibility= 'hidden';"><i class="fa fa-cogs"></i> Generate Statistics Email</button> | ||
<a download="message.eml" class="btn btn-primary active" role="button" id="downloadlink" style="display: none; width: 300px;font-weight: bold;"><i class="fa fa-download"></i> Click Here To Download Email</a> | ||
<script> | ||
function updateTextArea() { | ||
var suite = "<b>Top 10 Suite Performance:</b><br><br>" + $("#suiteBarID table")[0].outerHTML; | ||
var test = "<b>Top 10 Test Performance:</b><br><br>" + $("#testsBarID table")[0].outerHTML; | ||
var keyword ="<b>Top 10 Keyword Performance:</b><br><br>" + $("#keywordsBarID table")[0].outerHTML; | ||
var saluation="<pre><br>Please refer RF Metrics Report for detailed statistics.<br><br>Regards,<br>QA Team</pre></body></html>"; | ||
document.getElementById("textbox").value += "<br>" + suite + "<br>" + test + "<br>" + keyword + saluation; | ||
$("#create").click(function(){ | ||
$(this).remove(); | ||
}); | ||
} | ||
</script> | ||
<textarea id="textbox" class="col-md-12" style="height: 400px; padding:1em;"> | ||
To: [email protected] | ||
Subject: Automation Execution Status | ||
|
@@ -783,7 +796,7 @@ def start_keyword(self,kw): | |
<html> | ||
<head> | ||
<style> | ||
body, html, table,pre { | ||
body, html, table,pre,b { | ||
font-family: Calibri, Arial, sans-serif; | ||
font-size: 1em; | ||
} | ||
|
@@ -792,6 +805,7 @@ def start_keyword(self,kw): | |
border: 1px solid silver; | ||
padding: 6px; | ||
margin-left: 30px; | ||
width: 600px; | ||
} | ||
thead { | ||
text-align: center; | ||
|
@@ -800,17 +814,23 @@ def start_keyword(self,kw): | |
font-weight: bold; | ||
color: #2D2C2C; | ||
} | ||
tbody td { | ||
tbody { | ||
text-align: center; | ||
} | ||
th { | ||
width: 25%%; | ||
word-wrap:break-word; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<pre>Hi Team, | ||
Following are the last build execution statistics. | ||
<b>Metrics:<b> | ||
</pre> | ||
<table style="width: 600px;"> | ||
<table> | ||
<thead> | ||
<th style="width: 25%%;">Statistics</th> | ||
<th style="width: 25%%;">Total</th> | ||
|
@@ -819,33 +839,29 @@ def start_keyword(self,kw): | |
</thead> | ||
<tbody> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left: 40px;"> SUITE </td> | ||
<td style="background-color: #F5DEB3;">%s</td> | ||
<td style="background-color: #90EE90;">%s</td> | ||
<td style="background-color: #F08080;">%s</td> | ||
<td style="text-align: left;font-weight: bold;"> SUITE </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">%s</td> | ||
<td style="background-color: #90EE90;text-align: center;">%s</td> | ||
<td style="background-color: #F08080;text-align: center;">%s</td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left:40px;"> TESTS </td> | ||
<td style="background-color: #F5DEB3;">%s</td> | ||
<td style="background-color: #90EE90;">%s</td> | ||
<td style="background-color: #F08080;">%s</td> | ||
<td style="text-align: left;font-weight: bold;"> TESTS </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">%s</td> | ||
<td style="background-color: #90EE90;text-align: center;">%s</td> | ||
<td style="background-color: #F08080;text-align: center;">%s</td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left: 40px;"> KEYWORDS </td> | ||
<td style="background-color: #F5DEB3;">%s</td> | ||
<td style="background-color: #90EE90;">%s</td> | ||
<td style="background-color: #F08080;">%s</td> | ||
<td style="text-align: left;font-weight: bold;"> KEYWORDS </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">%s</td> | ||
<td style="background-color: #90EE90;text-align: center;">%s</td> | ||
<td style="background-color: #F08080;text-align: center;">%s</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<pre> | ||
Please refer RF Metrics Report for detailed statistics. | ||
Regards, | ||
QA Team</pre> | ||
</body> | ||
</html> | ||
</textarea> | ||
""" % (total_suite,passed_suite,failed_suite,total,passed,failed,total_keywords,passed_keywords,failed_keywords) | ||
statisitcs_div.append(BeautifulSoup(emailStatistics, 'html.parser')) | ||
|
||
|
@@ -912,7 +928,7 @@ def start_keyword(self,kw): | |
} | ||
</script> | ||
<script> | ||
function createBarGraph(tableID,keyword_column,time_column,limit,ChartID,ChartName){ | ||
function createBarGraph(tableID,keyword_column,time_column,limit,ChartID,ChartName,type){ | ||
var status = []; | ||
css_selector_locator = tableID + ' tbody >tr' | ||
var rows = $(css_selector_locator); | ||
|
@@ -929,7 +945,7 @@ def start_keyword(self,kw): | |
'#76A032', | ||
'#34558B' | ||
]; | ||
status.push(['Year', 'Elaspsed Time(s)',{ role: 'annotation'}, {role: 'style'}]); | ||
status.push([type, 'Elapsed Time(s)',{ role: 'annotation'}, {role: 'style'}]); | ||
for (var i = 0; i < rows.length; i++) { | ||
if (i == Number(limit)){ | ||
break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -974,28 +974,28 @@ <h4> | |
</b> | ||
</h4> | ||
<hr/> | ||
<h6> | ||
<ul> | ||
<li> | ||
Click 'Generate Statistics Email' button to get generate statistics email | ||
</li> | ||
<li> | ||
Click 'Click Here To Download Email' link to download generated email | ||
</li> | ||
</ul> | ||
</h6> | ||
<button class="btn btn-primary active" id="create" role="button"> | ||
<button class="btn btn-primary active" id="create" onclick="updateTextArea();this.style.visibility= 'hidden';" role="button"> | ||
<i class="fa fa-cogs"> | ||
</i> | ||
Generate Statistics Email | ||
</button> | ||
<br/> | ||
<br/> | ||
<a class="btn btn-secondary active" download="message.eml" id="downloadlink" role="button" style="display: none; width: 300px;font-weight: bold;"> | ||
<a class="btn btn-primary active" download="message.eml" id="downloadlink" role="button" style="display: none; width: 300px;font-weight: bold;"> | ||
<i class="fa fa-download"> | ||
</i> | ||
Click Here To Download Email | ||
</a> | ||
<script> | ||
function updateTextArea() { | ||
var suite = "<b>Top 10 Suite Performance:</b><br><br>" + $("#suiteBarID table")[0].outerHTML; | ||
var test = "<b>Top 10 Test Performance:</b><br><br>" + $("#testsBarID table")[0].outerHTML; | ||
var keyword ="<b>Top 10 Keyword Performance:</b><br><br>" + $("#keywordsBarID table")[0].outerHTML; | ||
var saluation="<pre><br>Please refer RF Metrics Report for detailed statistics.<br><br>Regards,<br>QA Team</pre></body></html>"; | ||
document.getElementById("textbox").value += "<br>" + suite + "<br>" + test + "<br>" + keyword + saluation; | ||
$("#create").click(function(){ | ||
$(this).remove(); | ||
}); | ||
} | ||
</script> | ||
<textarea class="col-md-12" id="textbox" style="height: 400px; padding:1em;"> | ||
To: [email protected] | ||
Subject: Automation Execution Status | ||
|
@@ -1005,7 +1005,7 @@ <h6> | |
<html> | ||
<head> | ||
<style> | ||
body, html, table,pre { | ||
body, html, table,pre,b { | ||
font-family: Calibri, Arial, sans-serif; | ||
font-size: 1em; | ||
} | ||
|
@@ -1014,6 +1014,7 @@ <h6> | |
border: 1px solid silver; | ||
padding: 6px; | ||
margin-left: 30px; | ||
width: 600px; | ||
} | ||
thead { | ||
text-align: center; | ||
|
@@ -1022,17 +1023,23 @@ <h6> | |
font-weight: bold; | ||
color: #2D2C2C; | ||
} | ||
tbody td { | ||
tbody { | ||
text-align: center; | ||
} | ||
th { | ||
width: 25%; | ||
word-wrap:break-word; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<pre>Hi Team, | ||
Following are the last build execution statistics. | ||
|
||
</pre> | ||
<table style="width: 600px;"> | ||
<b>Metrics:<b> | ||
|
||
</b></b></pre> | ||
<table> | ||
<thead> | ||
<th style="width: 25%;">Statistics</th> | ||
<th style="width: 25%;">Total</th> | ||
|
@@ -1041,33 +1048,28 @@ <h6> | |
</thead> | ||
<tbody> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left: 40px;"> SUITE </td> | ||
<td style="background-color: #F5DEB3;">2</td> | ||
<td style="background-color: #90EE90;">2</td> | ||
<td style="background-color: #F08080;">0</td> | ||
<td style="text-align: left;font-weight: bold;"> SUITE </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">2</td> | ||
<td style="background-color: #90EE90;text-align: center;">2</td> | ||
<td style="background-color: #F08080;text-align: center;">0</td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left:40px;"> TESTS </td> | ||
<td style="background-color: #F5DEB3;">6</td> | ||
<td style="background-color: #90EE90;">6</td> | ||
<td style="background-color: #F08080;">0</td> | ||
<td style="text-align: left;font-weight: bold;"> TESTS </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">6</td> | ||
<td style="background-color: #90EE90;text-align: center;">6</td> | ||
<td style="background-color: #F08080;text-align: center;">0</td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: left;font-weight: bold;padding-left: 40px;"> KEYWORDS </td> | ||
<td style="background-color: #F5DEB3;">24</td> | ||
<td style="background-color: #90EE90;">24</td> | ||
<td style="background-color: #F08080;">0</td> | ||
<td style="text-align: left;font-weight: bold;"> KEYWORDS </td> | ||
<td style="background-color: #F5DEB3;text-align: center;">24</td> | ||
<td style="background-color: #90EE90;text-align: center;">24</td> | ||
<td style="background-color: #F08080;text-align: center;">0</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<pre> | ||
Please refer RF Metrics Report for detailed statistics. | ||
|
||
Regards, | ||
QA Team</pre> | ||
</body> | ||
</html> | ||
</textarea> | ||
|
||
</body></html></textarea> | ||
</div> | ||
<div class="tabcontent" id="dashboard"> | ||
<h4> | ||
|
@@ -1295,11 +1297,11 @@ <h4 class="text-center" style="font-size:13px"> | |
executeDataTable('#tm',5); | ||
executeDataTable('#km',5); | ||
createPieChart(2,0,'suiteChartID','Suite Status:'); | ||
createBarGraph('#sm',0,4,10,'suiteBarID','Top 10 Suite Performance:'); | ||
createBarGraph('#sm',0,4,10,'suiteBarID','Top 10 Suite Performance:','Suite'); | ||
createPieChart(6,0,'testChartID','Tests Status:'); | ||
createBarGraph('#tm',1,5,10,'testsBarID','Top 10 Tests Performance:'); | ||
createBarGraph('#tm',1,5,10,'testsBarID','Top 10 Tests Performance:','Test'); | ||
createPieChart(24,0,'keywordChartID','Keywords Status:'); | ||
createBarGraph('#km',1,5,10,'keywordsBarID','Top 10 Keywords Performance:') | ||
createBarGraph('#km',1,5,10,'keywordsBarID','Top 10 Keywords Performance:','Keyword') | ||
}; | ||
</script> | ||
</div> | ||
|
@@ -1360,7 +1362,7 @@ <h4 class="text-center" style="font-size:13px"> | |
} | ||
</script> | ||
<script> | ||
function createBarGraph(tableID,keyword_column,time_column,limit,ChartID,ChartName){ | ||
function createBarGraph(tableID,keyword_column,time_column,limit,ChartID,ChartName,type){ | ||
var status = []; | ||
css_selector_locator = tableID + ' tbody >tr' | ||
var rows = $(css_selector_locator); | ||
|
@@ -1377,7 +1379,7 @@ <h4 class="text-center" style="font-size:13px"> | |
'#76A032', | ||
'#34558B' | ||
]; | ||
status.push(['Year', 'Elaspsed Time(s)',{ role: 'annotation'}, {role: 'style'}]); | ||
status.push([type, 'Elapsed Time(s)',{ role: 'annotation'}, {role: 'style'}]); | ||
for (var i = 0; i < rows.length; i++) { | ||
if (i == Number(limit)){ | ||
break; | ||
|