Commit 584b72f6 authored by libin's avatar libin
Browse files

20190726

parent a8458cf5
This diff is collapsed.
......@@ -382,10 +382,10 @@ class WebClient():
'''拼装本地文件路径'''
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])+local_file_path
else:
file_path = separator.join(path[:])+local_file_path
# if ('testcase_touch' in path or 'testestcases'in path or 'testcases_pc' in path):
# file_path = separator.join(path[0:-1])+local_file_path
# else:
file_path = separator.join(path[:])+local_file_path
with open(file_path,"rb") as f2:
l=f2.read()
print('l=',l)
......
......@@ -284,6 +284,7 @@ WRONG_USER_CARD_NUMBER = u"用户卡号必须为字母或数字以及其组合"
ROLE_MANAGEMENT_TEXT = u"角色管理"
EMPTY_ROLE_NAME_MSG = u"角色名称不允许为空"
EMPTY_DEPARTMENT_MSG = u"请选择部门"
EMPTY_DEPARTMENT_MSG2 = u"部门不能为空"
EMPTY_RANGE_MSG = u"请选择范围"
REPETITION_ROLE_NAME_MSG = u"角色名称已存在"
DELETE_ROLE_CONFIRM_TEXT = u"确认删除此权限角色?"
......@@ -325,7 +326,7 @@ PRE_ALL_DAY_END = "18:00"
预置的部门数据
'''
PRE_DEPARTMENT_NAME = "产品测试部"
PRE_DEPARTMENT_ID = "2065"
PRE_DEPARTMENT_ID = "2610"
PRE_DEPARTMENT_FATHER_ID = "496"
'''预置的楼宇数据'''
......
......@@ -15,7 +15,7 @@ SEARCH_PARK="[name='page.filter.park'] .ant-select-selection__rendered"
SEARCH_PARK_LIST=".//*[@id='main']/div[2]/div/div/div/ul/li[2]"
SEARCH_BUILD01="[name='page.filter.building'] input"
SEARCH_BUILD02="[name='page.filter.building'] input"
SEARCH_BUTTON01='//*[@id="main"]/div/div[2]/ul/li[3]/div/button[1]'
SEARCH_BUTTON01='//*[@id="main"]/div/div[2]/ul/li[2]/div/button[1]'
SEARCH_BUTTON02=".//*[@id='main']/div[1]/div[2]/ul/li[3]/div/button[1]"
SEARCH_RESET_BUTTON01='//*[@id="main"]/div/div[2]/ul/li[3]/div/button[2]'
SEARCH_RESET_BUTTON02=".//*[@id='main']/div[1]/div[2]/ul/li[3]/div/button[2]"
......
......@@ -66,7 +66,7 @@ def clear_area():
def clear_department():
set_foreign_key_sql1 = "set foreign_key_checks = 0;"
execute_sql(set_foreign_key_sql1)
sql = "DELETE FROM `organization` WHERE domainID = %s AND orgName NOT IN ('%s','%s');"%(test_data.COMPANY_ID, test_data.PRE_DEPARTMENT_NAME, "企业通讯录")
sql = "DELETE FROM `organization` WHERE domainId = %s AND orgName NOT IN ('%s','%s');"%(test_data.COMPANY_ID, test_data.PRE_DEPARTMENT_NAME, "企业通讯录")
execute_sql(sql)
set_foreign_key_sql2 = "SET FOREIGN_KEY_CHECKS = 1;"
execute_sql(set_foreign_key_sql2)
......
......@@ -116,7 +116,7 @@ class CreateDepartment(unittest.TestCase):
self.browser.click_element(xtpz_bmgl.ADD_DEPARTMENT_BTN)#点击“添加部门”按钮
self.browser.assert_mark_msg(xtpz_bmgl.ADD_DEPARTMENT_BOX_TITLE, test_data.ADD_DEPARTMENT_BOX_TITLE_TEXT)#断言页面标题为:添加部门
self.browser.click_element(xtpz_bmgl.CONFIRM_BTN)#点击“确定”按钮
self.browser.assert_mark_msg(xtpz_bmgl.DYNAMIC_WARNING_MSG, test_data.EMPTY_DEPARTMENT_MSG)#检查出现动态提示信息:请选择部门
self.browser.assert_mark_msg(xtpz_bmgl.DYNAMIC_WARNING_MSG, test_data.EMPTY_DEPARTMENT_MSG2)#检查出现动态提示信息:请选择部门
def tearDown(self):
......
......@@ -153,7 +153,7 @@ class CreateUser(unittest.TestCase):
self.browser.assert_mark_msg(xtpz_yhxx.DYNAMIC_WARNING_MSG, test_data.USER_EMPTY_DEPARTMENT_MSG)#检查出现动态提示信息:部门不能为空
self.browser.click_element(xtpz_yhxx.USER_DEPARTMENT, By.CSS_SELECTOR)#点击“部门”下拉框
# self.browser.click_element(xtpz_yhxx.USER_DEPARTMENT_CHECK)#选择部门
self.object.select_option_by_css_and_text(test_data.PRE_DEPARTMENT_NAME)
self.browser.select_option_by_css_and_text(test_data.PRE_DEPARTMENT_NAME)
self.browser.click_element(xtpz_yhxx.CONFIRM_BTN)#点击“确定”按钮
self.browser.assert_mark_msg(xtpz_yhxx.DYNAMIC_WARNING_MSG, test_data.EMPTY_ROLE_MSG)#检查出现动态提示文本:角色不能为空!
self.browser.click_element(xtpz_yhxx.USER_ROLE, By.CSS_SELECTOR)#点击“角色”下拉框
......
......@@ -59,7 +59,7 @@ class EditPark(unittest.TestCase):
'''
def test_edit_yuanqu_002(self):
self.browser.click_element(xtpz_yqgl.EDIT_PARK_BTN) #点击园区表中第一行的“编辑园区”图标
self.browser.assert_mark_msg(xtpz_yqgl.EDIT_PARK_DIALOG_TITLE,test_data.EDIT_PARK_DIALOG_TITLE) #断言弹出“编辑园区”弹出框,标题是:编辑园区
self.browser.assert_mark_msg(xtpz_yqgl.EDIT_PARK_DIALOG_TITLE,test_data.EDIT_PARK_DIALOG_TITLE,By.CSS_SELECTOR) #断言弹出“编辑园区”弹出框,标题是:编辑园区
self.browser.assert_attribute_msg(xtpz_yqgl.PARKNAME, test_data.PRE_ATTRIBUTE_VALUE,test_data.PRE_PARK_NAME, By.CSS_SELECTOR) #断言“园区名称”显示正确
self.browser.assert_attribute_msg(xtpz_yqgl.TIMEZONE_TEXT, test_data.PRE_ATTRIBUTE_TITLE,test_data.PRE_TIMEZONE, By.CSS_SELECTOR) #断言“时区”显示正确
self.browser.assert_mark_msg(xtpz_yqgl.CITY_TEXT, test_data.PRE_CITY) #断言“城市”显示正确
......
......@@ -52,7 +52,7 @@ class SearchPark(unittest.TestCase):
2.点击“重置”按钮,清空查询框内容,查询结果不更新
'''
def test_search_yuanqu_001(self):
select_sql = "SELECT COUNT(*) FROM `park` WHERE domainId=135;"
select_sql = "SELECT COUNT(*) FROM `park` WHERE domainId=%s;"%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 18) #断言数据库中有18条数据
self.browser.assert_mark_msg(xtpz_yqgl.SEARCH_RESULT_TEXT, test_data.SEARCH_RESULT_TEXT_16) #断言页面中显示数据“共16 条”
search_park = 'facebook'
......@@ -122,7 +122,7 @@ class SearchPark(unittest.TestCase):
2.查询数据库中不存在的园区
'''
def test_search_yuanqu_003(self):
select_sql = "SELECT COUNT(*) FROM `park` WHERE domainId=135;"
select_sql = "SELECT COUNT(*) FROM `park` WHERE domainId=%s;"%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 18) #断言数据库中有18条数据
self.browser.assert_mark_msg(xtpz_yqgl.SEARCH_RESULT_TEXT, test_data.SEARCH_RESULT_TEXT_16) #断言页面左下角显示“共16 条”
'''
......
......@@ -233,6 +233,7 @@ class EditStationMap(unittest.TestCase):
deal_db_data.assert_select_result(select_station_elements, 2)
def tearDown(self):
self.imgs = self.browser.imgs
self.browser.exit_all_browsers() #退出浏览器
if __name__ == "__main__":
#删除在工位地图中添加的工位素材,恢复环境
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment