340 lines
9.1 KiB
HTML
340 lines
9.1 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>Web自动化测试</title>
|
|
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
|
|
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
|
|
<script src="http://apps.bdimg.com/libs/Chart.js/0.2.0/Chart.min.js"></script>
|
|
<!-- <link href="https://cdn.bootcss.com/echarts/3.8.5/echarts.common.min.js" rel="stylesheet"> -->
|
|
|
|
|
|
<style type="text/css" media="screen">
|
|
body { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
|
|
table { font-size: 100%; }
|
|
pre { }
|
|
/* -- heading ---------------------------------------------------------------------- */
|
|
h1 {
|
|
font-size: 16pt;
|
|
color: gray;
|
|
}
|
|
.heading {
|
|
font-size: 12px;
|
|
margin-top: 0ex;
|
|
margin-bottom: 1ex;
|
|
margin-left: 10px;
|
|
}
|
|
.heading .attribute {
|
|
font-size: 12px;
|
|
margin-top: 1ex;
|
|
margin-bottom: 0;
|
|
}
|
|
.heading .description {
|
|
font-size: 12px;
|
|
margin-top: 4ex;
|
|
margin-bottom: 6ex;
|
|
}
|
|
/* -- css div popup ------------------------------------------------------------------------ */
|
|
a.popup_link {
|
|
}
|
|
a.popup_link:hover {
|
|
color: red;
|
|
}
|
|
.popup_window {
|
|
display: none;
|
|
position: relative;
|
|
left: 0px;
|
|
top: 0px;
|
|
/*border: solid #627173 1px; */
|
|
font-family: "Lucida Console", "Courier New", Courier, monospace;
|
|
text-align: left;
|
|
font-size: 12pt;
|
|
width: 500px;
|
|
}
|
|
}
|
|
/* -- report ------------------------------------------------------------------------ */
|
|
#show_detail_line {
|
|
margin-top: 3ex;
|
|
margin-bottom: 1ex;
|
|
margin-left: 10px;
|
|
}
|
|
#result_table {
|
|
width: 80%;
|
|
border-collapse: collapse;
|
|
border: 1px solid #777;
|
|
margin-left: 10px;
|
|
}
|
|
#header_row {
|
|
font-weight: bold;T
|
|
color: #606060;
|
|
background-color: #f5f5f5;
|
|
border-top-width: 10px;
|
|
border-color: #d6e9c6;
|
|
font-size: 12px;
|
|
}
|
|
#result_table td {
|
|
font-size:10px
|
|
border: 1px solid #f5f5f5;
|
|
padding: 2px;
|
|
}
|
|
#total_row { font-weight: bold; }
|
|
.passClass { background-color: #d6e9c6; }
|
|
.failClass { background-color: #faebcc; }
|
|
.errorClass { background-color: #ebccd1; }
|
|
.passCase { color: #6c6; }
|
|
.failCase { color: #c60; font-weight: bold; }
|
|
.errorCase { color: #c00; font-weight: bold; }
|
|
.hiddenRow { display: none; }
|
|
.testcase { margin-left: 2em; }
|
|
/* -- ending ---------------------------------------------------------------------- */
|
|
#ending {
|
|
}
|
|
/* -- chars ---------------------------------------------------------------------- */
|
|
.testChars {margin-left: 150px; font-size:10px; text-align:center;}
|
|
.btn-info1 {
|
|
color: #fff;
|
|
background-color: #28B463;
|
|
border-color: #d6e9c6;
|
|
}
|
|
.btn-info2 {
|
|
color: #fff;
|
|
background-color: #D4AC0D;
|
|
border-color: #faebcc;
|
|
}
|
|
.btn-info3 {
|
|
color: #fff;
|
|
background-color: #D35400;
|
|
border-color: #ebccd1;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<script language="javascript" type="text/javascript"><!--
|
|
output_list = Array();
|
|
/* level - 0:Summary; 1:Failed; 2:All */
|
|
function showCase(level) {
|
|
trs = document.getElementsByTagName("tr");
|
|
for (var i = 0; i < trs.length; i++) {
|
|
tr = trs[i];
|
|
id = tr.id;
|
|
if (id.substr(0,2) == 'ft') {
|
|
if (level < 1) {
|
|
tr.className = 'hiddenRow';
|
|
}
|
|
else {
|
|
tr.className = '';
|
|
}
|
|
}
|
|
if (id.substr(0,2) == 'pt') {
|
|
if (level > 1) {
|
|
tr.className = '';
|
|
}
|
|
else {
|
|
tr.className = 'hiddenRow';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function showClassDetail(cid, count) {
|
|
var id_list = Array(count);
|
|
var toHide = 1;
|
|
for (var i = 0; i < count; i++) {
|
|
tid0 = 't' + cid.substr(1) + '.' + (i+1);
|
|
tid = 'f' + tid0;
|
|
tr = document.getElementById(tid);
|
|
if (!tr) {
|
|
tid = 'p' + tid0;
|
|
tr = document.getElementById(tid);
|
|
}
|
|
id_list[i] = tid;
|
|
if (tr.className) {
|
|
toHide = 0;
|
|
}
|
|
}
|
|
for (var i = 0; i < count; i++) {
|
|
tid = id_list[i];
|
|
if (toHide) {
|
|
document.getElementById('div_'+tid).style.display = 'none'
|
|
document.getElementById(tid).className = 'hiddenRow';
|
|
}
|
|
else {
|
|
document.getElementById(tid).className = '';
|
|
}
|
|
}
|
|
}
|
|
function showTestDetail(div_id){
|
|
var details_div = document.getElementById(div_id)
|
|
var displayState = details_div.style.display
|
|
// alert(displayState)
|
|
if (displayState != 'block' ) {
|
|
displayState = 'block'
|
|
details_div.style.display = 'block'
|
|
}
|
|
else {
|
|
details_div.style.display = 'none'
|
|
}
|
|
}
|
|
function html_escape(s) {
|
|
s = s.replace(/&/g,'&');
|
|
s = s.replace(/</g,'<');
|
|
s = s.replace(/>/g,'>');
|
|
return s;
|
|
}
|
|
/* obsoleted by detail in <div>
|
|
function showOutput(id, name) {
|
|
var w = window.open("", //url
|
|
name,
|
|
"resizable,scrollbars,status,width=800,height=450");
|
|
d = w.document;
|
|
d.write("<pre>");
|
|
d.write(html_escape(output_list[id]));
|
|
d.write("\n");
|
|
d.write("<a href='javascript:window.close()'>close</a>\n");
|
|
d.write("</pre>\n");
|
|
d.close();
|
|
}
|
|
*/
|
|
--></script>
|
|
<div class='heading'>
|
|
<h1>Web自动化测试</h1>
|
|
<p class='attribute'><strong>Start Time:</strong> 2019-02-26 10:45:51</p>
|
|
<p class='attribute'><strong>Duration:</strong> 0:00:32.794098</p>
|
|
<p class='attribute'><strong>Status:</strong> Pass 2 Error 1</p>
|
|
|
|
<p class='description'>详细测试结果如下:</p>
|
|
</div>
|
|
<div style="float:left; margin-left: 10px; font-size:12px">
|
|
<p> Test Case Pie charts </p>
|
|
<a class="btn btn-xs btn-info1">-Pass-</a><br>
|
|
<a class="btn btn-xs btn-info2">-Faild-</a><br>
|
|
<a class="btn btn-xs btn-info3">-Error-</a><br>
|
|
</div>
|
|
|
|
<div class="testChars" style="center">
|
|
<canvas id="myChart" width="250" height="250"></canvas>
|
|
</div>
|
|
|
|
|
|
<p id='show_detail_line' style="margin-left: 16px; font-size:12px">Show
|
|
<a href='javascript:showCase(0)' class="btn btn-xs btn-primary">Summary</a>
|
|
<a href='javascript:showCase(1)' class="btn btn-xs btn-danger">Failed</a>
|
|
<a href='javascript:showCase(2)' class="btn btn-xs btn-info">All</a>
|
|
</p>
|
|
<table id='result_table'>
|
|
<colgroup>
|
|
<col align='left' />
|
|
<col align='right' />
|
|
<col align='right' />
|
|
<col align='right' />
|
|
<col align='right' />
|
|
<col align='right' />
|
|
</colgroup>
|
|
<tr id='header_row' class="panel-title">
|
|
<td>Test Group/Test case</td>
|
|
<td>Count</td>
|
|
<td>Pass</td>
|
|
<td>Fail</td>
|
|
<td>Error</td>
|
|
<td>View</td>
|
|
</tr>
|
|
|
|
<tr class='errorClass'>
|
|
<td>test_baiduSearch.TestLogin</td>
|
|
<td>3</td>
|
|
<td>2</td>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td><a href="javascript:showClassDetail('c1',3)">Detail</a></td>
|
|
</tr>
|
|
|
|
<tr id='pt1.1' class='hiddenRow'>
|
|
<td class='none'><div class='testcase'>test_search</div></td>
|
|
<td colspan='5' align='center'>pass</td>
|
|
</tr>
|
|
|
|
<tr id='pt1.2' class='hiddenRow'>
|
|
<td class='none'><div class='testcase'>test_search1</div></td>
|
|
<td colspan='5' align='center'>pass</td>
|
|
</tr>
|
|
|
|
<tr id='ft1.3' class='none'>
|
|
<td class='errorCase'><div class='testcase'>test_search2</div></td>
|
|
<td colspan='5' align='center'>
|
|
<!--css div popup start-->
|
|
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.3')" >
|
|
error</a>
|
|
<div id='div_ft1.3' class="popup_window">
|
|
<div style='text-align: right; color:red;cursor:pointer'>
|
|
<a onfocus='this.blur();' onclick="document.getElementById('div_ft1.3').style.display = 'none' " >
|
|
[x]</a>
|
|
</div>
|
|
<pre>
|
|
|
|
ft1.3: Traceback (most recent call last):
|
|
File "D:\githublily\Automated-Test\testcase\test_baiduSearch.py", line 49, in test_search2
|
|
self.page.wrong_search = self.page.search_content
|
|
File "D:\githublily\Automated-Test\common\pageObject.py", line 101, in __set__
|
|
raise ValueError("Can't set value, element not found")
|
|
ValueError: Can't set value, element not found
|
|
|
|
|
|
</pre>
|
|
</div>
|
|
<!--css div popup end-->
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id='total_row'>
|
|
<td>Total</td>
|
|
<td>3</td>
|
|
<td class="text text-success">2</td>
|
|
<td class="text text-danger">0</td>
|
|
<td class="text text-warning">1</td>
|
|
<td> </td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div id='ending'> </div>
|
|
|
|
<script type="text/javascript">
|
|
var data = [
|
|
{
|
|
name: 'error',
|
|
value: 1,
|
|
color: "#D35400",
|
|
label: "Error",
|
|
labelColor: 'white',
|
|
labelFontSize: '16'
|
|
},
|
|
{
|
|
name: 'fail',
|
|
value : 0,
|
|
color : "#D4AC0D",
|
|
label: "Fail",
|
|
labelColor: 'white',
|
|
labelFontSize: '16'
|
|
},
|
|
{
|
|
name : 'pass',
|
|
value : 2,
|
|
color : "#28B463",
|
|
label : "Pass",
|
|
labelColor: 'white',
|
|
labelFontSize: '16'
|
|
}
|
|
]
|
|
var newopts = {
|
|
animationSteps: 100,
|
|
animationEasing: 'easeInOutQuart',
|
|
}
|
|
//Get the context of the canvas element we want to select
|
|
var ctx = document.getElementById("myChart").getContext("2d");
|
|
var myNewChart = new Chart(ctx).Pie(data,newopts);
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|