Merge branch 'master' of ec2-54-222-189-45.cn-north-1.compute.amazonaws.com.cn:ConcordyaInc/e2e-test

* 'master' of ec2-54-222-189-45.cn-north-1.compute.amazonaws.com.cn:ConcordyaInc/e2e-test:
  期初

# Conflicts:
#	test_case/external/beginning_period/beginning_period_page.py
#	test_case/external/beginning_period/beginning_period_spec.py
#	test_case/external/comp_list/comp_list_page.py
#	util/upload_file_page.py
This commit is contained in:
huangcaiyan 2018-04-09 15:31:02 +08:00
commit 35badf9be8
29 changed files with 1576 additions and 289 deletions

View File

@ -7,6 +7,7 @@
<w>inviteuser</w>
<w>menuitem</w>
<w>tbody</w>
<w>unassign</w>
<w>webelement</w>
</words>
</dictionary>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -8,16 +8,16 @@ class CompInfo(object):
# ------------------------------------------------
# # stage
# BASE_URL = 'https://web-gyz-stage.guanplus.com'
# LOGIN_DATA = ['13683139989', '1qazxcvbnm']
# COMP_NAME = '北京有序云创技术有限公司'
BASE_URL = 'https://web-gyz-stage.guanplus.com'
LOGIN_DATA = ['13683139989', '1qazxcvbnm']
COMP_NAME = '北京有序云创技术有限公司'
# COMP_NAME = '固定yk'
# ------------------------------------------------
# pro
BASE_URL = 'https://firms.guanplus.com'
LOGIN_DATA = ['13683139989', 'qq123456']
COMP_NAME = '成立启用同月测试yb' # yb规模
# BASE_URL = 'https://firms.guanplus.com'
# LOGIN_DATA = ['13683139989', 'qq123456']
# COMP_NAME = '成立启用同月测试yb' # yb规模
# COMP_NAME = '跨年测试11月启用yb' # 一般纳税人
ENTER_COMP_INFO = [BASE_URL, LOGIN_DATA, COMP_NAME]

View File

@ -0,0 +1,298 @@
<?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>管有账测试报告</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<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 {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
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; */
padding: 10px;
background-color: #E6E6D6;
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
}
#result_table {
width: 80%;
border-collapse: collapse;
border: 1px solid #777;
}
#header_row {
font-weight: bold;
color: white;
background-color: #777;
}
#result_table td {
border: 1px solid #777;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #6c6; }
.failClass { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
</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,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
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>管有账测试报告</h1>
<p class='attribute'><strong>Start Time:</strong> 2018-02-02 15:59:25</p>
<p class='attribute'><strong>Duration:</strong> 0:00:26.854321</p>
<p class='attribute'><strong>Status:</strong> Error 1</p>
<p class='description'>测试用例执行情况:</p>
</div>
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>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'>
<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_case.external.beginning_period.beginning_period_spec.BeginningPeriodSpec</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td><a href="javascript:showClassDetail('c1',1)">Detail</a></td>
</tr>
<tr id='ft1.1' class='none'>
<td class='errorCase'><div class='testcase'>test_import_initial_account: 测试 导入期初帐</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.1')" >
error</a>
<div id='div_ft1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_ft1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
ft1.1: kong
comp_num= 95
class1= input-ellipsis underLine
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
comp_num= 95
index= 94
1
comp_name= 北京有序云创有限公司2062
Traceback (most recent call last):
File "/Users/huangcaiyan/work/e2e-test/test_case/external/beginning_period/beginning_period_spec.py", line 46, in test_import_initial_account
page.import_initial_account( self.initial_account_import_data_path )
File "/Users/huangcaiyan/work/e2e-test/test_case/external/beginning_period/beginning_period_page.py", line 49, in import_initial_account
uploadFilePage.upload_file( file_path )
File "/Users/huangcaiyan/work/e2e-test/util/upload_file_page.py", line 15, in upload_file
upload_btn_loc.send_keys( file_dir ) # time.sleep(5)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 352, in send_keys
'value': keys_to_typing(value)})
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 501, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: invalid argument: File not found : ./e2e-test/test_data/cai/external/导入期初帐.xlsx
(Session info: chrome=63.0.3239.132)
(Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.11.6 x86_64)
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
</body>
</html>

View File

@ -0,0 +1,279 @@
<?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>管有账测试报告</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<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 {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
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; */
padding: 10px;
background-color: #E6E6D6;
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
}
#result_table {
width: 80%;
border-collapse: collapse;
border: 1px solid #777;
}
#header_row {
font-weight: bold;
color: white;
background-color: #777;
}
#result_table td {
border: 1px solid #777;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #6c6; }
.failClass { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
</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,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
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>管有账测试报告</h1>
<p class='attribute'><strong>Start Time:</strong> 2018-02-02 16:09:31</p>
<p class='attribute'><strong>Duration:</strong> 0:00:29.487920</p>
<p class='attribute'><strong>Status:</strong> Pass 1</p>
<p class='description'>测试用例执行情况:</p>
</div>
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>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'>
<td>Test Group/Test case</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
</tr>
<tr class='passClass'>
<td>test_case.external.beginning_period.beginning_period_spec.BeginningPeriodSpec</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td><a href="javascript:showClassDetail('c1',1)">Detail</a></td>
</tr>
<tr id='pt1.1' class='hiddenRow'>
<td class='none'><div class='testcase'>test_import_initial_account: 测试 导入期初帐</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.1')" >
pass</a>
<div id='div_pt1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_pt1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
pt1.1: kong
comp_num= 95
class1= input-ellipsis underLine
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
comp_num= 95
index= 94
1
comp_name= 北京有序云创有限公司2062
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
</body>
</html>

View File

@ -0,0 +1,279 @@
<?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>管有账测试报告</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<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 {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
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; */
padding: 10px;
background-color: #E6E6D6;
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
}
#result_table {
width: 80%;
border-collapse: collapse;
border: 1px solid #777;
}
#header_row {
font-weight: bold;
color: white;
background-color: #777;
}
#result_table td {
border: 1px solid #777;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #6c6; }
.failClass { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
</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,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
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>管有账测试报告</h1>
<p class='attribute'><strong>Start Time:</strong> 2018-02-02 16:10:18</p>
<p class='attribute'><strong>Duration:</strong> 0:00:35.545354</p>
<p class='attribute'><strong>Status:</strong> Pass 1</p>
<p class='description'>测试用例执行情况:</p>
</div>
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>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'>
<td>Test Group/Test case</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
</tr>
<tr class='passClass'>
<td>test_case.external.beginning_period.beginning_period_spec.BeginningPeriodSpec</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td><a href="javascript:showClassDetail('c1',1)">Detail</a></td>
</tr>
<tr id='pt1.1' class='hiddenRow'>
<td class='none'><div class='testcase'>test_import_initial_account: 测试 导入期初帐</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.1')" >
pass</a>
<div id='div_pt1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_pt1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
pt1.1: kong
comp_num= 95
class1= input-ellipsis underLine
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '小芳']
comp_num= 95
index= 94
1
comp_name= 北京有序云创有限公司2062
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
</body>
</html>

View File

@ -0,0 +1,279 @@
<?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>管有账测试报告</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<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 {
margin-top: 0ex;
margin-bottom: 1ex;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
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; */
padding: 10px;
background-color: #E6E6D6;
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
}
#result_table {
width: 80%;
border-collapse: collapse;
border: 1px solid #777;
}
#header_row {
font-weight: bold;
color: white;
background-color: #777;
}
#result_table td {
border: 1px solid #777;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #6c6; }
.failClass { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
</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,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
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>管有账测试报告</h1>
<p class='attribute'><strong>Start Time:</strong> 2018-02-02 16:11:59</p>
<p class='attribute'><strong>Duration:</strong> 0:00:58.743172</p>
<p class='attribute'><strong>Status:</strong> Pass 1</p>
<p class='description'>测试用例执行情况:</p>
</div>
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>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'>
<td>Test Group/Test case</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
</tr>
<tr class='passClass'>
<td>test_case.external.beginning_period.beginning_period_spec.BeginningPeriodSpec</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td><a href="javascript:showClassDetail('c1',1)">Detail</a></td>
</tr>
<tr id='pt1.1' class='hiddenRow'>
<td class='none'><div class='testcase'>test_import_initial_account: 测试 导入期初帐</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.1')" >
pass</a>
<div id='div_pt1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_pt1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
pt1.1: kong
comp_num= 114
class1= input-ellipsis underLine
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '永康', '小语', 'AWS', '123', 'zs', 'ls']
['+新增用户', 'huangcaiyan0714', 'william', '永康', 'ASW', '永康', '小语', 'AWS', '123', 'zs', 'ls']
comp_num= 114
index= 113
1
comp_name= xgm报表测试专用帐套不许动20180202创建
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
</body>
</html>

View File

@ -4,10 +4,11 @@ from HTMLTestRunner import HTMLTestRunner
from test_case.invoice.record_invoice.record_invoice_spec import RecordInvoiceSpec
from test_case.external.create_company.create_comp_spec import CreateCompSpec
from test_case.external.beginning_period.beginning_period_spec import BeginningPeriodSpec
if __name__ == '__main__':
testSuite = unittest.TestSuite()
# # 登录测试
# testSuite.addTest(LoginSpec('test_verify_login'))
# testSuite.addTest(LoginSpec('test_unexit_username'))
@ -15,20 +16,20 @@ if __name__ == '__main__':
# testSuite.addTest(LoginSpec('test_empty_username'))
# testSuite.addTest(LoginSpec('test_empty_password'))
# testSuite.addTest(LoginSpec('test_typeerror_username'))
# 设置页面
# testSuite.addTest(SettingSpec('test_go_to_comp_billing_page'))
# testSuite.addTest(SettingSpec('test_go_to_contact_page'))
# testSuite.addTest(SettingSpec('test_go_to_mutil_user_page'))
# testSuite.addTest(SettingSpec('test_go_to_partner_set_page'))
# testSuite.addTest(SettingSpec('test_go_to_tax_rate_page'))
# 设置-帐套信息页面
# testSuite.addTest(CompBillingSpec('test_comp_name_empty'))
# testSuite.addTest(CompBillingSpec('test_legal_person_name_empty'))
# testSuite.addTest(CompBillingSpec('test_tax_num_empty'))
# testSuite.addTest(CompBillingSpec('test_verify_edit_comp_info'))
# 设置-往来性质(done)
# testSuite.addTest(ContactSpec('test_show_add_modal'))
# testSuite.addTest(ContactSpec('test_name_empty'))
@ -37,7 +38,7 @@ if __name__ == '__main__':
# testSuite.addTest(ContactSpec('test_contact_property_is_unit'))
# testSuite.addTest(ContactSpec('test_contact_property_is_personal'))
# testSuite.addTest(ContactSpec('test_name_repeat'))
# 设置-股东信息(done)
# testSuite.addTest(PartnersetSpec('test_click_add_btn_modal_is_show'))
# testSuite.addTest(PartnersetSpec('test_partnerset_empty_invalid'))
@ -46,7 +47,7 @@ if __name__ == '__main__':
# testSuite.addTest(PartnersetSpec('test_add_a_partner_valid'))
# testSuite.addTest(PartnersetSpec('test_edit_partnerset_valid'))
# testSuite.addTest(PartnersetSpec('test'))
#
# # 工资-添加员工
# testSuite.addTest(AddStuffSpec('test_name_empty'))
@ -56,13 +57,13 @@ if __name__ == '__main__':
# testSuite.addTest(AddStuffSpec('test_verify_add_stuff'))
# testSuite.addTest(AddStuffSpec('test_verify_add_labour'))
# testSuite.addTest(AddStuffSpec('test'))
# 记收支
# 记所有科目和账户的收支、互转
# testSuite.addTest(RecordTransactionSpec('test_record_income'))
# testSuite.addTest(RecordTransactionSpec('test_record_outcome'))
# testSuite.addTest(RecordTransactionSpec('test_record_transfer'))
# # 记发票
# # # 记所有类别发票
# testSuite.addTest(RecordInvoiceSpec('test_record_input_invoice'))
@ -76,27 +77,28 @@ if __name__ == '__main__':
# testSuite.addTest(ReportDataReadySpec('test_record_transfer'))
# testSuite.addTest(ReportDataReadySpec('test_record_input_invoice'))
# testSuite.addTest(ReportDataReadySpec('test_record_output_invoice'))
# external
# 记录完全部收入、支出、互转手指列表本月收入为42,650.92支出为70,584.30
# testSuite.addTest(EnterCompSpec('test_enter_comp'))
# 创建帐套
testSuite.addTest(CreateCompSpec('test_verify_create_comp'))
# testSuite.addTest( CreateCompSpec( 'test_verify_create_comp' ) )
# testSuite.addTest(CreateCompSpec('test_create_comp_empty_comp_name'))
# testSuite.addTest(CreateCompSpec('test_create_comp_empty_legal_person'))
# 帐套列表
# 分配会计/助理/客服联系人
# testSuite.addTest(DistributeModalSpec('test_distribute_accounting'))
# 启用期初帐页面
testSuite.addTest( BeginningPeriodSpec( 'test_import_initial_account' ) )
# testSuite.addTest(UserSettingSpec('test_go_to_comp_billing_page'))
# testSuite.addTest(SidebarSpec('test_get_current_account_period'))
# testSuite.addTest(CreateWaysSpec('test_input_comp_name_jump_to_create_page'))
now = time.strftime('%Y-%m-%d %H_%M_%S')
now = time.strftime( '%Y-%m-%d %H_%M_%S' )
report_dir = './report/cai_test'
filename = report_dir + '/' + now + '_result.html'
testReport = open(filename, 'wb')
runner = HTMLTestRunner(
stream=testReport, title="管有账测试报告", description='测试用例执行情况:')
runner.run(testSuite)
testReport = open( filename , 'wb' )
runner = HTMLTestRunner( stream=testReport , title="管有账测试报告" , description='测试用例执行情况:' )
runner.run( testSuite )
testReport.close()

View File

@ -1,6 +1,8 @@
from selenium import webdriver
import unittest
import time
import sys
import os
from util.public_page import PublicPage
from ...login.login_page import LoginPage
@ -16,37 +18,35 @@ from .beginning_period_page import BeginningPeriodPage
# @Software : PyCharm
class BeginningPeriodSpec(unittest.TestCase):
# {角色,帐套名称,会计名称,会计手机号}
user_info = ['会计', '', 'current_user', '']
initial_account_file_path = '/Users/doghome/Test/e2e-test/test_data/cai/begining_period/期初导入测数据.xlsx'
@classmethod
def setUpClass(self):
self.driver = webdriver.Chrome()
publicPage = PublicPage(self.driver)
publicPage.max_window()
self.driver.implicitly_wait(30)
loginPage = LoginPage(CompInfo.BASE_URL, self.driver)
loginPage.login(CompInfo.LOGIN_DATA)
@classmethod
def tearDownClass(self):
self.driver.quit()
def test_import_initial_account(self):
"""测试 导入期初帐"""
compListPage = CompListPage(self.driver)
distributePage = DistributeModalPage(self.driver)
page = BeginningPeriodPage(self.driver)
distributePage.invite_user(self.user_info)
compListPage.enter_comp()
time.sleep(2)
page.go_to_upload_initial_account_page(CompInfo.BASE_URL)
time.sleep(1)
page.import_initial_account(self.initial_account_file_path)
time.sleep(10)
class BeginningPeriodSpec( unittest.TestCase ):
# {角色,帐套名称,会计名称,会计手机号}
user_info = [ '会计' , None , 'current_user' , '' ]
initial_account_import_data_path ='/Users/huangcaiyan/work/e2e-test/test_data/cai/external/导入期初帐.xlsx'
@classmethod
def setUpClass( self ):
self.driver = webdriver.Chrome()
publicPage = PublicPage( self.driver )
publicPage.max_window()
self.driver.implicitly_wait( 30 )
loginPage = LoginPage( CompInfo.BASE_URL , self.driver )
loginPage.login( CompInfo.LOGIN_DATA )
@classmethod
def tearDownClass( self ):
self.driver.quit()
def test_import_initial_account( self ):
"""测试 导入期初帐"""
compListPage = CompListPage( self.driver )
distributePage = DistributeModalPage( self.driver )
page = BeginningPeriodPage( self.driver )
distributePage.invite_user( self.user_info )
time.sleep( 2 )
compListPage.enter_comp()
page.import_initial_account( self.initial_account_import_data_path )
time.sleep(8)
if __name__ == '__main__':

View File

@ -179,3 +179,4 @@ class CompListPage(object):
#

View File

@ -1,5 +1,5 @@
from selenium import webdriver
import unittest
import unittest,time
from .comp_list_page import CompListPage
from util.public_page import PublicPage
@ -12,6 +12,8 @@ from comp_info import CompInfo
# @File : comp_list_page
# @Software : PyCharm
class CompListSpec( unittest.TestCase ):
comp_info = [ None ]
@classmethod
def setUpClass( self ):
self.driver = webdriver.Chrome()
@ -29,12 +31,13 @@ class CompListSpec( unittest.TestCase ):
# def test_distribute_accounting( self ):
# page = CompListPage( self.driver )
# page.distribute_accounting( '固定yk' )
#
# name_list()
def test_get_comp_name_list( self ):
def test_enter_comp( self ):
page = CompListPage( self.driver )
page.get_comp_name_list()
page.enter_comp()
time.sleep(5)
if __name__ == '__main__':

Binary file not shown.

Binary file not shown.

View File

@ -232,7 +232,6 @@ class PublicPage:
logging.error('[PublicPage]click_elem--查找元素不存在,异常堆栈信息是:', str(traceback.format_exc()))
except Exception as e:
print('[PublicPage]click_elem--未知错误,错误信息是:', str(e))
def double_click_elem( self, elem_loc ):
"""
:param elem_loc: 双击元素元素定位

View File

@ -5,7 +5,7 @@ from util.public_page import PublicPage
class UploadFilePage(object):
def __init__(self, driver, file_dir):
def __init__(self, driver, file_dir):
# self.driver = webdriver.Chrome()
self.driver = driver
self.file_dir = file_dir

Binary file not shown.