Commit 448441bb authored by libin's avatar libin
Browse files

20190724

parent 53efdb75
This diff is collapsed.
......@@ -253,7 +253,7 @@ class WebClient():
try:
self.wait_unit_elem(element_selector, find_by)
txtmsg = self.get_element(element_selector, find_by).text
print("expected text:" + msg+ ",actual text:" + txtmsg)
print("expected text:",msg,",actual text:",txtmsg)
assert msg in txtmsg
# try:
# assert msg in txtmsg
......@@ -268,7 +268,7 @@ class WebClient():
def assert_multiple_mark_msg(self,elements_selector,msg,find_by=By.XPATH):
self.wait_unit_elem(elements_selector, find_by)
txtmsgs = self.get_elements(elements_selector, find_by)
print("expected text:" + msg+ ",actual text:" + txtmsgs)
print("expected text:",msg,",actual text:",txtmsgs)
for txtmsg in txtmsgs:
txt = txtmsg.text
assert msg in txt
......@@ -296,7 +296,7 @@ class WebClient():
def assert_attribute_msg(self, element_selector, attr, msg, find_by=By.XPATH):
self.wait_unit_elem(element_selector, find_by)
attrmsg = self.get_element(element_selector, find_by).get_attribute(attr)
print("actual attribute:" + attrmsg)
print("actual attribute:",attrmsg)
assert msg in attrmsg
# try:
# assert msg in attrmsg
......@@ -479,11 +479,11 @@ class WebClient():
def get_screenshot_as_file(self,screenshot_name):
separator = "\\" if com_module.is_windows_platform() else "/"
path = os.getcwd().split(separator)
if ('testcase_touch' in path or 'testestcases'in path or 'testcases_pc' in path):
file_name = separator.join(path[0:-1])+"/screenshot"
else:
file_name = separator.join(path[:])+"/screenshot"
self.__driver.get_screenshot_as_file(file_name+"/%s%s.png"% (datetime.now().strftime("%Y%m%d.%H%M"),screenshot_name) )
# if ('testcase_touch' in path or 'testestcases'in path or 'testcases_pc' in path):
# file_name = separator.join(path[0:-1])+"/screenshot"
# else:
# file_name = separator.join(path[:])+"/screenshot"
self.__driver.get_screenshot_as_file("../screenshot/%s_%s.png"% (datetime.now().strftime("%Y%m%d%H%M"),screenshot_name) )
def sleep(self):
......
......@@ -40,6 +40,7 @@ SEARCH_RESULT_TEXT_3 = "共 3 条"
SEARCH_RESULT_TEXT_2 = "共 2 条"
SEARCH_RESULT_TEXT_4 = "共 4 条"
SEARCH_RESULT_TEXT_6 = "共 6 条"
SEARCH_RESULT_TEXT_9 = "共 9 条"
PLEASE_ENTER_USERNAME = "请输入账号!"
PLEASE_ENTER_PW = "请输入密码!"
WRONG_USERNAME = "用户不存在"
......@@ -223,7 +224,7 @@ SEARCH_NO_DATA_MSG = "暂无数据"
COMPANY_PARKNAME = u"西安软件园"
COMPANY_BUILDNAME=u"零壹大厦"
COMPANY_BUILD_TOKEN='6666666666'
COMPANY_BUILD_TOKEN='999999999'
'''
预定管理页面数据
......@@ -257,7 +258,7 @@ SAVE_SUCCESS_WARNING_MSG = u"保存成功"
ADD_DEPARTMENT_BOX_TITLE_TEXT = u"添加部门"
REPETITION_DEPARTMENT_MSG = u"该部门已存在"
EMPTY_DEPARTMENT_MSG = u"部门不能为空"
EDIT_DEPARTMENT_BOX_TITLE_TEXT = u"修改部门名称"
EDIT_DEPARTMENT_BOX_TITLE_TEXT = u"修改部门"
'''
用户信息页面
......@@ -325,6 +326,7 @@ PRE_ALL_DAY_END = "18:00"
'''
PRE_DEPARTMENT_NAME = "产品测试部"
PRE_DEPARTMENT_ID = "497"
PRE_DEPARTMENT_FATHER_ID = "496"
'''预置的楼宇数据'''
PRE_BUILD_NAME ="零壹广场"
......
......@@ -50,8 +50,9 @@ ASSERT_DELETE_TEXT = ".ant-confirm-content"
ASSERT_DELETE_SUCCESS = ".ant-message-custom-content.ant-message-success>span"
ASSERT_DELETE_ERROR = ".ant-message-custom-content.ant-message-error>span"
ADMINISTRATOR_FLIP_1 = ".//li[@title='1']"
ADMINISTRATOR_FLIP_2 = ".//li[@title='2']"
ADMINISTRATOR_FLIP_3 = ".//li[@title='3']"
ADMINISTRATOR_FLIP_NEXT = ".ant-pagination-next"
ADMINISTRATOR_FLIP_PREVIOUS = ".ant-pagination-prev"
ADMINISTRATOR_FLIP_NEXT = ".//li[@title='下一页']"
ADMINISTRATOR_FLIP_PREVIOUS = ".//li[@title='上一页']"
ADMINISTRATOR_PAGE_BTN = '//*[@id="main"]/div/div[2]/div[2]/div/div/ul/li[last()-1]'
\ No newline at end of file
......@@ -8,7 +8,7 @@ ADD_DEPARTMENT_TEXT_INPUT = "[name='department.manage.name']>input"
DEPARTMENT_MANAGEMENT_TEXT = ".//*[@id='main']/div/div[1]"
DEPARTMENT_SEARCH_RESULT_TEXT = ".//*[@id='main']/div/div[3]/div[2]/div/div/ul/li[1]"
EDIT_DEPARTMENT_BTN = '//*[@id="main"]/div/div[3]/div[2]/div/div/div/div/div/div/table/tbody/tr/td[5]/span/i[1]'
FIRST_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[1]/td[3]"
FIRST_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[1]/td[2]"
SEARCH_INPUT = ".select .ant-input"
SEARCH_BTN = ".//*[@class='filter clearfix']/ul[1]/li[2]/button[1]"
RESET_BTN = ".//*[@class='filter clearfix']/ul[1]/li[2]/button[2]"
......
ADDBUILD = ".//*[@id='main']/div/div[3]/div[1]/ul/li"
ADDBUILD_FLOOR = "[name='page.filter.floor']>input"
ADDBUILD_FLOOR = "body > div:nth-child(5) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > ul > li:nth-child(1) > div > input"
ADDBUILD_PARK = "div[class ='ant-modal-body']>ul>li>[name='page.filter.park']"
ADDBUILD_BUILD = "div[class ='ant-modal-body']>ul>li>[name='page.filter.building']"
CLOSE_BUTTON = ".//*[@class='ant-modal-content']/button"
......
CREATE_BUILD_BUTTON = ".//*[@class='operation-list']/li"
CREATE_OVERLAY_TITLE=".//*[@id='rcDialogTitle0']"
CREATE_OVERLAY_BULIDNAME = "div[class='ant-modal-body']>ul>li>[name='page.filter.building']>input"
CREATE_OVERLAY_CHOOSE_PART = "body > div:nth-child(4) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > ul > li:nth-child(2) > div > div"
CREATE_OVERLAY_CHOOSE_PART = "body > div:nth-child(5) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > ul > li:nth-child(2) > div > div > div > div"
CREATE_OVERLAY_CHOOSE_PART_FLAG = "html/body/div[4]/div/div/div/ul/li[2]"
CREATE_OVERLAY_BUILDTOKEN = "[name='page.filter.adsNo']>input"
CREATE_OVERLAY_UPLOAD_IMG ="[name='page.filter.ads']>span>div>span>button"
......
......@@ -13,10 +13,10 @@ def uploading_file(browser,file_name):
keyboard = keyboard_util.KeyBoardUtil()
separator = '\\' if com_module.is_windows_platform() else '/'
path = os.getcwd().split(separator)
if ('testcase_touch' in path or 'testestcases'in path or 'testcases_pc' in path):
file_path = separator.join(path[0:-1])+file_name
else:
file_path = separator.join(path[:])+file_name
# if ('testcase_touch' in path or 'testestcases'in path or 'testcases_pc' in path):
file_path = separator.join(path[0:-1])+file_name
# else:
# file_path = separator.join(path[:])+file_name
# print(file_path)
keyboard.send_keys(file_path)
time.sleep(3)
......
<?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> 2019-07-24 11:18:14</p>
<p class='attribute'><strong>Duration:</strong> 0:00:00</p>
<p class='attribute'><strong>Status:</strong> none</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 id='total_row'>
<td>Total</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
</body>
</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>智能工位系统测试报告</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> 2019-07-24 11:18:58</p>
<p class='attribute'><strong>Duration:</strong> 0:00:00</p>
<p class='attribute'><strong>Status:</strong> none</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>