Commit 4fd48f10 authored by libin's avatar libin
Browse files

20190823

parent ce5a4e12
......@@ -87,8 +87,8 @@ ATTRIBUTE_TRANSFORM = "transform"
ATTRIBUTE_TRANSFORM_XY_0 = "translate(0,0) scale(1, 1) rotate(0, 28.285, 25.985)"
ATTRIBUTE_TRANSFORM_XY_1660 = "translate(1660,900) scale(1, 1) rotate(0, 66, 29)"
ATTRIBUTE_TRANSFORM_XY_830 = "translate(830,450) scale(1, 1) rotate(0, 28.285, 25.985)"
ATTRIBUTE_TRANSFORM_R_90 = "translate(501,58) scale(1, 1) rotate(90, 28.285, 25.985)"
ATTRIBUTE_TRANSFORM_R_180 = "translate(501,58) scale(1, 1) rotate(180, 28.285, 25.985)"
ATTRIBUTE_TRANSFORM_R_90 = "scale(1, 1) rotate(90, 28.285, 25.985)"
ATTRIBUTE_TRANSFORM_R_180 = "scale(1, 1) rotate(180, 28.285, 25.985)"
ATTRIBUTE_ARIA_DISABLED = "aria-disabled"
PLEASE_SELECT_TEXT = "请选择"
ADD_SUCCESS_MSG = u'添加成功'
......@@ -102,6 +102,7 @@ DELETE_SUCCESS_MSG1 = u'删除成功'
AT_LEAST_ONE_MSG = u"请至少选填一项!"
LOTS_EDIT_SUCCESS_MSG = u"批量编辑成功!"
LOTS_DELETE_SUCCESS_MSG = u"批量删除成功!"
EMPTY_STATION_NUM = u"工位编号不能为空"
'''
搜索项目名称
'''
......@@ -341,8 +342,8 @@ PRE_BUILD_ID ="3"
PRE_BUILD_BUILDTOKEN ="autotest001"
'''预置楼层信息'''
PRE_FLOOR_NAME = "2"
PRE_FLOOR_ID = "62"
PRE_FLOOR_NAME = "3"
PRE_FLOOR_ID = "2"
'''预制区域信息'''
PRE_AREA_NAME = "东区"
......@@ -352,13 +353,13 @@ PRE_AREA_ID = "3"
预置的用户数据
'''
PRE_USER_NAME = "autotest"
PRE_USER_ID = "378"
PRE_USER_ID = "390"
PRE_USER_JOB_NUMBER = "autotest"
PRE_USER_CARD_NUMBER = "autotest"
PRE_USER_EMAIL = "at@autotest.com"
PRE_USER_DEPARTMENT = PRE_DEPARTMENT_NAME
PRE_USER_ROLE = "普通用户"
PRE_USER_WORKSTATION_NUMBER = "FS001"
PRE_USER_WORKSTATION_NUMBER = "PF001"
'''
系统默认的角色数据
......
......@@ -15,7 +15,7 @@ FIRST_LINE_EDIT_BTN = '#main .ant-table-fixed-right tbody tr:first-child i:nth-c
FIRST_LINE_DELETE_BTN = "#main .ant-table-fixed-right tbody tr:first-child i:nth-child(2)"
FIRST_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[1]/td[1]/span[1]/label[1]/span[1]/input[1]"
FIRST_LINE_DEPARTMENT = ".//*[@class='ant-table-tbody']/tr[1]/td[9]/li[1]"
FIRST_LINE_STATUS = ".//*[@class='ant-table-tbody']/tr[1]/td[11]"
FIRST_LINE_STATUS = ".//*[@class='ant-table-tbody']/tr[1]/td[12]"
FIRST_LINE_STATION_NUMBER = ".//*[@class='ant-table-tbody']/tr[1]/td[3]"
#第二行工位数据信息
SECOND_LINE_EDIT_BTN = "#main .ant-table-fixed-right tbody tr:nth-child(2) i:nth-child(1)"
......@@ -23,6 +23,12 @@ SECOND_LINE_DELETE_BTN = "#main .ant-table-fixed-right tbody tr:nth-child(2) i:n
SECOND_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[2]/td[1]/span[1]/label[1]/span[1]/input[1]"
SECOND_LINE_DEPARTMENT = ".//*[@class='ant-table-tbody']/tr[2]/td[9]/li[1]"
SECOND_LINE_STATUS = ".//*[@class='ant-table-tbody']/tr[2]/td[10]"
#第四行工位数据信息
FOURTH_LINE_EDIT_BTN = "#main .ant-table-fixed-right tbody tr:nth-child(4) i:nth-child(1)"
FOURTH_LINE_DELETE_BTN = "#main .ant-table-fixed-right tbody tr:nth-child(4) i:nth-child(2)"
FOURTH_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[4]/td[1]/span[1]/label[1]/span[1]/input[1]"
FOURTH_LINE_DEPARTMENT = ".//*[@class='ant-table-tbody']/tr[4]/td[9]/li[1]"
FOURTH_LINE_STATUS = ".//*[@class='ant-table-tbody']/tr[4]/td[10]"
#工位信息搜索项
FIRST_SEARCH_ITEM_TEXT = ".//*[@id='main']/div/ul/li[1]/label"
FIRST_SEARCH_DROPDOWNLIST = "[name='page.filter.park'] .ant-select-selection__rendered"
......@@ -60,16 +66,19 @@ STATION_TYPE_FIXED = "[name='page.filter.type'] label:nth-child(1) input"
STATION_TYPE_MOBILE = "[name='page.filter.type'] label:nth-child(2) input"
DEPARTMENT_DROPDOWN_LIST = ".form-group [name='page.filter.dept'] .ant-select-selection__rendered"
DEPARTMENT_DROPDOWN_LIST_TEXT = "#form-group li:nth-child(7) .ant-select-selection-selected-value"
DEPARTMENT_DROPDOWN_CHECK = "#form-group > div > div > div > div > ul > li > span.ant-select-tree-node-content-wrapper.ant-select-tree-node-content-wrapper-normal > span"
DEPARTMENT_DROPDOWN_LIST_TEXT_DELETE_BTN = "[name='page.filter.dept'] .ant-select-selection__choice>span"
DEPARTMENT_DROPDOWN_LIST_TEXT_2 = ".//*[@id='form-group']/li[7]/div/div/div/div/ul/li[2]/div"
DEPARTMENT_DROPDOWN_CHECK = "#form-group .ant-select-tree li:nth-child(2) span:nth-child(2)"
DEPARTMENT_DROPDOWN_LIST_TEXT_DELETE_BTN = "[name='page.filter.dept'] .ant-select-selection__choice>span:first-child"
DEPARTMENT_DROPDOWN_LIST_TEXT_PM_1 = "[name='page.filter.dept'] .ant-select-selection__choice:first-child>span:nth-child(2)" #移动工位的部门文字
DEPARTMENT_DROPDOWN_LIST_TEXT_PM_2 = "[name='page.filter.dept'] .ant-select-selection__choice:nth-child(2)>span:nth-child(2)" #移动工位的部门文字
DEPARTMENT_DROPDOWN_LIST_4 = "ul[class='ant-select-tree'] > li:nth-child(4) > span:nth-child(2)" #移动工位的部门列表
DEPARTMENT_DROPDOWN_LIST_5 = "ul[class='ant-select-tree'] > li:nth-child(5) > span:nth-child(2)" #移动工位的部门列表
USER_INPUT = "[name='page.filter.user'] input"
USER_DROPDOWN_LIST = ".//*[@id='form-group']/li[8]/div/div/ul/li"
#编辑工位时,会多显示一项“状态”,所以用户项向下挪动一个,XPATH发生变化
USER_EDIT_INPUT = "[name='page.filter.user'] .ant-input"
USER_EDIT_INPUT = "[name='page.filter.user'] input"
USER_EDIT_DROPDOWN_LIST = ".//*[@name='page.filter.user']/div/ul/li[1]/span"
USER_EDIT_DROPDOWN_LIST_TEXT = "#form-group li:nth-child(10) .ant-select-selection-selected-value"
USER_EDIT_DROPDOWN_LIST_TEXT_DELETE_BTN = "[name='page.filter.user'] .ant-tag>i"
USER_EDIT_DROPDOWN_LIST_TEXT = "#form-group li:nth-child(10) ul > li:first-child > div"
USER_EDIT_DROPDOWN_LIST_TEXT_DELETE_BTN = "#form-group li:nth-child(10) ul > li:first-child > span"
STATUS_DROPDOWN_LIST = "[name='page.table.status']"
MOBILE_STATUS_DROPDOWN_LIST = "[name='page.table.status'] .ant-select-selection-selected-value"
CANCEL_BTN = ".//*[@class='ant-modal-footer']/button[1]"
......@@ -81,11 +90,11 @@ CLOSE_BTN = ".//*[@class='ant-modal-content']/button[1]"
DYNAMIC_WARNING_MSG = ".//*[@class='ant-message-notice-content']/div[1]/span[1]"
'''“批量编辑工位”页面中的元素'''
LOTS_DEPARTMENT_LIST = "//body/div[last()]//ul[@class='form-group']/li[1]/div/span/span/span"
LOTS_DEPARTMENT_LIST_TEXT = "//body/div[last()-1]//ul[@class='form-group']/li[1]/div/span/span/ul/li[1]/span[2]"
LOTS_DEPARTMENT_LIST_TEXT_02 = "/html/body/div[3]/div/div[2]/div/div[1]/div[2]/ul/li[1]/div/span/span/ul/li[2]"
LOTS_STATUS_LIST = "//body/div[last()]//ul[@class='form-group']/li[2]/div"
LOTS_STATUS_LIST_TEXT = "//body/div[last()-1]//ul[@class='form-group']/li[2]/div/div/div/div/div"
LOTS_DEPARTMENT_LIST = "//body/div[2]//ul[@class='form-group']/li[1]/div"
LOTS_DEPARTMENT_LIST_TEXT = "//body/div[2]//ul[@class='form-group']/li[1]/div/span/span/ul/li[1]/span[2]"
LOTS_DEPARTMENT_LIST_TEXT_02 = "//body/div[2]//ul[@class='form-group']/li[1]/div/span/span/ul/li[2]/span[2]"
LOTS_STATUS_LIST = "//body/div[2]//ul[@class='form-group']/li[2]/div"
LOTS_STATUS_LIST_TEXT = "//body/div[2]//ul[@class='form-group']/li[2]/div/div/div/div/div[2]"
FIRST_DEPARTMENT_LIST = "//body/div[last()]//ul/li[2]/span[2]/span"
SECOND_DEPARTMENT_LIST = "//body/div[last()]//ul/li[3]/span[2]/span"
THIRD_DEPARTMENT_LIST = "//body/div[last()]//ul/li[4]/span[2]/span"
......
ROLE_MANAGEMENT_TEXT = ".//*[@id='main']/div/div[1]"
ROLE_NAME_INPUT = "[name='system.role.name'] input"
DEPARTMENT_DROPDOWN_LIST = "#formContent > span > span > span"
DEPARTMENT_DROPDOWN_LIST_TEXT = ".//*[@id='formContent']/div/div/div/ul/li[1]/div"
DEPARTMENT_DROPDOWN_LIST_TEXT = ".//*[@id='formContent']/div[2]/ul/li[3]/div/span/span/ul/li[1]/span[2]"
DEPARTMENT_DROPDOWN_LIST_FIRST = ".//*[@id='formContent']/div[3]/div/div/div/ul/li[1]"
DEPARTMENT_DROPDOWN_LIST_SECOND = ".//*[@id='formContent']/div[3]/div/div/div/ul/li[2]"
DEPARTMENT_DROPDOWN_LIST_THIRD = ".//*[@id='formContent']/div[3]/div/div/div/ul/li[3]"
......@@ -25,6 +25,7 @@ SECOND_LINE_ROLE = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[2]"
SECOND_LINE_EDIT_BTN = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[2]/span[1]/i[1]"
SECOND_LINE_DELETE_BTN = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[2]/span[1]/i[2]"
THIRD_LINE_ROLE = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[3]"
THIRD_LINE_EDIT_BTN = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[3]/span[1]/i[1]"
THIRD_LINE_DELETE_BTN = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[3]/span[1]/i[2]"
FORTH_LINE_ROLE = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[4]"
FORTH_LINE_DELETE_BTN = ".//*[@class='cont-left']/div[2]/div[1]/ul[1]/li[4]/span[1]/i[2]"
......
......@@ -111,7 +111,7 @@ def reset_park():
updata_sql = '''UPDATE `park` p SET p.`amTime`='09:00-12:00',p.`city`='xian',p.`country`='china',
p.`parkName`= "西安软件园",p.`parkStatus`=0,p.`pmTime`='13:00-18:00',p.`province`='shanxi',
p.`timeAreaName`='Asia/Shanghai',p.`cityName`='西安市',p.`countryName`='中国',p.`provinceName`='陕西省',p.`timeAreaName`='北京'
WHERE p.`id`=%s;''' % (test_data.COMPANY_ID)
WHERE p.`id`=%s;''' % (test_data.PRE_PARK_ID)
execute_sql(updata_sql)
# 重置预置楼宇
......
......@@ -44,7 +44,10 @@ class EditStation():
self.driver.assert_mark_msg(gwwh_gwxx.BUILDING_DROPDOWN_LIST, test_data.PRE_BUILD_NAME,By.CSS_SELECTOR)#断言“楼宇”下拉框显示为:Pre_lingyi_Square
self.driver.assert_mark_msg(gwwh_gwxx.FLOOR_DROPDOWN_LIST, test_data.PRE_FLOOR_NAME,By.CSS_SELECTOR)#断言“楼层”下拉框显示为:Pre_Floor_3
self.driver.assert_mark_msg(gwwh_gwxx.AREA_DROPDOWN_LIST, test_data.PRE_AREA_NAME,By.CSS_SELECTOR)#断言“区域”下拉框显示为:Pre_Part_A
self.driver.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.PRE_DEPARTMENT_NAME,By.CSS_SELECTOR)#断言部门下拉框中显示为:Pre_Testing_Department
try:
self.driver.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.PRE_DEPARTMENT_NAME,By.CSS_SELECTOR)#断言部门下拉框中显示为:Pre_Testing_Department
except Exception:
self.driver.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_PM_1, test_data.PRE_DEPARTMENT_NAME,By.CSS_SELECTOR)#移动,断言部门下拉框中显示为:Pre_Testing_Department
if __name__ == "__main__":
print("pass")
\ No newline at end of file
......@@ -21,8 +21,8 @@ class PageTurning(unittest.TestCase):
randStr = ''.join(random.sample(['a','b','c','d','e','f'],4))
sql_obj.executeSQL(r'''INSERT INTO `domain`(canceTime,delayedTime,domainName,domainStatus,domainUrl,fixedColor)
VALUES(30,30,'%s',0,'%s',0)''' % (randStr, randStr + ".com"))
sql_obj.commitSQL()
result = result + 1
sql_obj.commitSQL()
sql_obj.close_connect()
self.object = web_client.WebClient(test_data.MANAGE_URL)
login_swp.login01(self.object,test_data.SUPERADMIN_NAME,test_data.SUPERADMIN_PW,test_data.HOME_PAGE_SUPERADMIN_NAME) #超级管理员登陆
......
......@@ -149,44 +149,43 @@ class UploadingStationMap(unittest.TestCase):
self.browser.click_element(gwwh_gwdt.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwdt.DYNAMIC_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
#输不进去大于2位
# '''
# author:曹英群
# createtime:2017.09.22
# function:地图面积大于两位小数
# '''
# def test_uploading_station_map_008(self):
# '''上传地图和缩略图,地图面积大于两位小数,入(只能输入两位小数,小于1报错)'''
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #点击“上传地图和缩略图”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.ADD_MAP_BOX_TITLE, test_data.ADD_STATION_MAP_TEXT, By.CLASS_NAME) #断言弹出框的标题是“添加地图”
# area = "0.758"
# default_value = "0.76"
# self.browser.clear_elem_text(gwwh_gwdt.AREA_OF_REGION_INPUT, By.CSS_SELECTOR) #删除“区域面积”输入框中的值
# self.browser.sendkeys_to_element(gwwh_gwdt.AREA_OF_REGION_INPUT, area, By.CSS_SELECTOR) #在输入框中输入0.758
# self.browser.click_element(gwwh_gwdt.CONFIRM_BTN) #点击“确定”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.DYNAMIC_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #再次点击“上传地图和缩略图”按钮
# self.browser.assert_attribute_msg(gwwh_gwdt.AREA_OF_REGION_INPUT, test_data.ATTRIBUTE_VALUE, default_value, By.CSS_SELECTOR) #断言“区域面积”输入框中显示0.76
'''
author:曹英群
createtime:2017.09.22
function:地图面积大于两位小数
'''
def test_uploading_station_map_008(self):
'''上传地图和缩略图,地图面积大于两位小数,入'''
self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #点击“上传地图和缩略图”按钮
self.browser.assert_mark_msg(gwwh_gwdt.ADD_MAP_BOX_TITLE, test_data.ADD_STATION_MAP_TEXT, By.CLASS_NAME) #断言弹出框的标题是“添加地图”
area = "0.758"
default_value = "0.76"
self.browser.clear_elem_text(gwwh_gwdt.AREA_OF_REGION_INPUT, By.CSS_SELECTOR) #删除“区域面积”输入框中的值
self.browser.sendkeys_to_element(gwwh_gwdt.AREA_OF_REGION_INPUT, area, By.CSS_SELECTOR) #在输入框中输入0.758
# self.browser.click_element(gwwh_gwdt.CONFIRM_BTN) #点击“确定”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.DYNAMIC_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #再次点击“上传地图和缩略图”按钮
self.browser.assert_attribute_msg(gwwh_gwdt.AREA_OF_REGION_INPUT, test_data.ATTRIBUTE_VALUE, default_value, By.CSS_SELECTOR) #断言“区域面积”输入框中显示0.76
# '''
# author:曹英群
# createtime:2017.09.22
# function:地图面积大于两位小数
# '''
# def test_uploading_station_map_009(self):
# '''上传地图和缩略图,地图面积大于两位小数,舍(只能输入两位小数,小于1报错)'''
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #点击“上传地图和缩略图”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.ADD_MAP_BOX_TITLE, test_data.ADD_STATION_MAP_TEXT, By.CLASS_NAME) #断言弹出框的标题是“添加地图”
# area = "0.754"
# default_value = "0.75"
# self.browser.clear_elem_text(gwwh_gwdt.AREA_OF_REGION_INPUT, By.CSS_SELECTOR) #删除“区域面积”输入框中的值
# self.browser.sendkeys_to_element(gwwh_gwdt.AREA_OF_REGION_INPUT, area, By.CSS_SELECTOR) #在输入框中输入0.758
# self.browser.click_element(gwwh_gwdt.CONFIRM_BTN) #点击“确定”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.DYNAMIC_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #再次点击“上传地图和缩略图”按钮
# self.browser.assert_attribute_msg(gwwh_gwdt.AREA_OF_REGION_INPUT, test_data.ATTRIBUTE_VALUE, default_value, By.CSS_SELECTOR) #断言“区域面积”输入框中显示0.75
'''
author:曹英群
createtime:2017.09.22
function:地图面积大于两位小数
'''
def test_uploading_station_map_009(self):
'''上传地图和缩略图,地图面积大于两位小数,舍'''
self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #点击“上传地图和缩略图”按钮
self.browser.assert_mark_msg(gwwh_gwdt.ADD_MAP_BOX_TITLE, test_data.ADD_STATION_MAP_TEXT, By.CLASS_NAME) #断言弹出框的标题是“添加地图”
area = "0.754"
default_value = "0.75"
self.browser.clear_elem_text(gwwh_gwdt.AREA_OF_REGION_INPUT, By.CSS_SELECTOR) #删除“区域面积”输入框中的值
self.browser.sendkeys_to_element(gwwh_gwdt.AREA_OF_REGION_INPUT, area, By.CSS_SELECTOR) #在输入框中输入0.758
# self.browser.click_element(gwwh_gwdt.CONFIRM_BTN) #点击“确定”按钮
# self.browser.assert_mark_msg(gwwh_gwdt.DYNAMIC_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
# self.browser.click_element(gwwh_gwdt.UPLOADING_STATION_MAP_BTN) #再次点击“上传地图和缩略图”按钮
self.browser.assert_attribute_msg(gwwh_gwdt.AREA_OF_REGION_INPUT, test_data.ATTRIBUTE_VALUE, default_value, By.CSS_SELECTOR) #断言“区域面积”输入框中显示0.75
def tearDown(self):
......
......@@ -28,7 +28,7 @@ class EditPark(unittest.TestCase):
2.保存编辑内容
'''
def test_edit_yuanqu_001(self):
'''修改园区(bug,修改名字,报错)'''
'''修改园区'''
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,By.CSS_SELECTOR) #断言弹出“编辑园区”弹框,标题是:编辑园区
self.browser.assert_attribute_msg(xtpz_yqgl.PARKNAME, test_data.PRE_ATTRIBUTE_VALUE,test_data.PRE_PARK_NAME, By.CSS_SELECTOR) #断言“编辑园区”弹框中“园区名称”显示正确
......@@ -47,7 +47,7 @@ class EditPark(unittest.TestCase):
'''检查出现动态提示文本:修改成功'''
self.browser.assert_mark_msg(xtpz_yqgl.DYNAMIC_WARNING_MESSAGE, test_data.CHANGE_PARK_SUCCESS_MSG) #检查出现动态提示文本:修改成功
#断言数据库中该数据也修改
select_sql = "SELECT COUNT(*) FROM `park` p WHERE p.`parkName`like 'change%' AND domainId=%s;"%(test_data.COMPANY_ID)
select_sql = "SELECT COUNT(*) FROM `park` p WHERE p.`parkName` like 'change%%' AND domainId=%s;"%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 1)
'''
......
......@@ -14,6 +14,12 @@ from src.module import goto
class EditRole(unittest.TestCase):
def setUp(self):
deal_db_data.clear_role()
insert_role = '''INSERT INTO `role`(domainId,menu,roleName,roleType,roleFlag,scopes,defaultRole,speReser)
VALUES({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户',0,3,'{{"scopes":[{{"scopeType":1,"tableIds":"3"}},{{"scopeType":2,"tableIds":"3"}},{{"scopeType":3,"tableIds":"2"}},{{"scopeType":4,"tableIds":"3"}},{{"scopeType":10,"tableIds":"{oi}"}}]}}',1,1),
({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户01',0,3,'{{"scopes":[{{"scopeType":1,"tableIds":"3"}},{{"scopeType":2,"tableIds":"3"}},{{"scopeType":3,"tableIds":"2"}},{{"scopeType":4,"tableIds":"3"}},{{"scopeType":10,"tableIds":"{oi}"}}]}}',1,1);''' \
.format(di=test_data.COMPANY_ID, oi=test_data.PRE_DEPARTMENT_ID)
deal_db_data.execute_sql(insert_role)
self.browser = web_client.WebClient(test_data.MANAGE_URL)
login_swp.login01(self.browser, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW)
goto.goto_role(self.browser)
......@@ -28,14 +34,14 @@ class EditRole(unittest.TestCase):
3.不修改点击“重置”按钮
'''
def test_edit_role_001(self):
self.browser.click_element(xtpz_jsgl.FIRST_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.FIRST_LINE_EDIT_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, test_data.COMMON_USER_ROLE_NAME, By.CSS_SELECTOR)
# self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.COMMON_USER_DEPARTMENT)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_EDIT_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, "VIP用户", By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.PRE_DEPARTMENT_NAME)
self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.HOME_PAGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_DISABLED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.ADD_BTN, test_data.SAVE_BTN_MSG)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
......@@ -44,16 +50,16 @@ class EditRole(unittest.TestCase):
self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.HOME_PAGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_DISABLED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.ADD_BTN, test_data.ADD_BTN_MSG)
self.browser.click_element(xtpz_jsgl.FIRST_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.FIRST_LINE_EDIT_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, test_data.COMMON_USER_ROLE_NAME, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.COMMON_USER_DEPARTMENT)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_EDIT_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, "VIP用户", By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.PRE_DEPARTMENT_NAME)
self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.HOME_PAGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_DISABLED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.ADD_BTN, test_data.SAVE_BTN_MSG)
self.browser.click_element(xtpz_jsgl.RESET_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, '', By.CSS_SELECTOR)
......@@ -61,7 +67,7 @@ class EditRole(unittest.TestCase):
self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.HOME_PAGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_DISABLED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_AVAILABLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.DOWN_AUTHORIZATION_SWITCH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.ADD_BTN, test_data.ADD_BTN_MSG)
'''
......@@ -72,14 +78,14 @@ class EditRole(unittest.TestCase):
1.修改普通用户角色名称
'''
def test_edit_role_002(self):
self.browser.click_element(xtpz_jsgl.FIRST_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.FIRST_LINE_EDIT_BTN)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_EDIT_BTN)
self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, test_data.SPECIAL_USER_ROLE_NAME, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.REPETITION_ROLE_NAME_MSG)
self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
role_name = 'VIP用户'
role_name = 'editVIP用户'
self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, role_name, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
......@@ -92,48 +98,12 @@ class EditRole(unittest.TestCase):
1.修改普通用户管理端菜单,个人菜单
'''
def test_edit_role_003(self):
self.browser.click_element(xtpz_jsgl.FIRST_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.FIRST_LINE_EDIT_BTN)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.THIRD_LINE_EDIT_BTN)
self.browser.click_element(xtpz_jsgl.GWGL, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.GWGL, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.WDYY, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.WDYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
'''
author:曹英群
createtime:2017.08.31
function:
编辑用户:
1.修改特殊预约用户的角色名称
'''
def test_edit_role_004(self):
self.browser.click_element(xtpz_jsgl.SECOND_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.SECOND_LINE_EDIT_BTN)
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, test_data.SPECIAL_USER_ROLE_NAME, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.SPECIAL_USER_DEPARTMENT)
self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, test_data.COMMON_USER_ROLE_NAME, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.REPETITION_ROLE_NAME_MSG)
self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, 'VIP', By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
'''
author:曹英群
createtime:2017.08.31
function:
编辑用户:
1.修改特殊预约用户管理菜单,个人菜单
'''
def test_edit_role_005(self):
self.browser.click_element(xtpz_jsgl.SECOND_LINE_ROLE)
self.browser.click_element(xtpz_jsgl.SECOND_LINE_EDIT_BTN)
self.browser.click_element(xtpz_jsgl.GWWH, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_jsgl.GWWH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
self.browser.click_element(xtpz_jsgl.BBTT, By.CSS_SELECTOR)
......@@ -141,11 +111,51 @@ class EditRole(unittest.TestCase):
self.browser.click_element(xtpz_jsgl.ADD_BTN)
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
# '''
# author:曹英群
# createtime:2017.08.31
# function:
# 编辑用户:
# 1.修改特殊预约用户的角色名称
# '''
# def test_edit_role_004(self):
# self.browser.click_element(xtpz_jsgl.SECOND_LINE_ROLE)
# self.browser.click_element(xtpz_jsgl.SECOND_LINE_EDIT_BTN)
# self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_VALUE, test_data.SPECIAL_USER_ROLE_NAME, By.CSS_SELECTOR)
# self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.SPECIAL_USER_DEPARTMENT)
# self.browser.assert_attribute_msg(xtpz_jsgl.RANGE, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.TSYY, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
# self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
# self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, test_data.COMMON_USER_ROLE_NAME, By.CSS_SELECTOR)
# self.browser.click_element(xtpz_jsgl.ADD_BTN)
# self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.REPETITION_ROLE_NAME_MSG)
# self.browser.clear_elem_text(xtpz_jsgl.ROLE_NAME_INPUT, By.CSS_SELECTOR)
# self.browser.sendkeys_to_element(xtpz_jsgl.ROLE_NAME_INPUT, 'VIP', By.CSS_SELECTOR)
# self.browser.click_element(xtpz_jsgl.ADD_BTN)
# self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
# '''
# author:曹英群
# createtime:2017.08.31
# function:
# 编辑用户:
# 1.修改特殊预约用户管理菜单,个人菜单
# 和3合并
# '''
# def test_edit_role_005(self):
# self.browser.click_element(xtpz_jsgl.THIRD_LINE_ROLE)
# self.browser.click_element(xtpz_jsgl.THIRD_LINE_EDIT_BTN)
# self.browser.click_element(xtpz_jsgl.GWWH, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.GWWH, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
# self.browser.click_element(xtpz_jsgl.BBTT, By.CSS_SELECTOR)
# self.browser.assert_attribute_msg(xtpz_jsgl.BBTT, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_CHECKBOX_SELECTED, By.CSS_SELECTOR)
# self.browser.click_element(xtpz_jsgl.ADD_BTN)
# self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG)
def tearDown(self):
self.browser.exit_all_browsers()
deal_db_data.reset_commoon_role()
deal_db_data.reset_special_role()
deal_db_data.clear_role()
if __name__ == '__main__':
......
......@@ -15,8 +15,8 @@ class DeleteRole(unittest.TestCase):
def setUp(self):
deal_db_data.clear_role()
insert_role = '''INSERT INTO `role`(domainId,menu,roleName,roleType,roleFlag,scopes,defaultRole,speReser)
VALUES({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户',0,0,'{{"scopes":[{{"scopeType":-1,"tableIds":0}}]}}',1,1),
({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户01',0,0,'{{"scopes":[{{"scopeType":-1,"tableIds":0}}]}}',1,1);''' \
VALUES({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户',0,3,'{{"scopes":[{{"scopeType":-1,"tableIds":0}}]}}',1,1),
({di},'{{"backMenu":"1","webMenu":"30,31,32,33,34"}}','VIP用户01',0,3,'{{"scopes":[{{"scopeType":-1,"tableIds":0}}]}}',1,1);''' \
.format(di = test_data.COMPANY_ID)
deal_db_data.execute_sql(insert_role)
self.browser = web_client.WebClient(test_data.MANAGE_URL)
......
......@@ -43,9 +43,9 @@ class EditStation(unittest.TestCase):
'''%(test_data.COMPANY_ID, test_data.PRE_DEPARTMENT_ID)
deal_db_data.execute_sql(insert_user)
#插入工位数据
insert_station = '''INSERT INTO `mobilestation`(domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,qrCodeDir,qrCodeUrl,stationNum,stationState,stationType,userId,userName,parkId)
VALUES({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PM001_2450.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2450','PM002',3,1,{ui},'{un}',{pi}),
({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PF002_2451.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2451','PF002',3,2,{ui},'{un}',{pi});
insert_station = '''INSERT INTO `mobilestation`(domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,qrCodeDir,qrCodeUrl,stationNum,stationState,stationType,userIds,userNames,parkId)
VALUES({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PM001_2450.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2450','PM002',3,1,'','',{pi}),
({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PF002_2451.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2451','PF002',3,2,'{ui}','{un}',{pi});
'''.format(di = test_data.COMPANY_ID, ai = test_data.PRE_AREA_ID, an = test_data.PRE_AREA_NAME, fi = test_data.PRE_FLOOR_ID, fn = test_data.PRE_FLOOR_NAME, bi = test_data.PRE_BUILD_ID, bn = test_data.PRE_BUILD_NAME, oi = test_data.PRE_DEPARTMENT_ID, pn = test_data.PRE_PARK_NAME, pi = test_data.PRE_PARK_ID, ui = test_data.PRE_USER_ID, un = test_data.PRE_USER_NAME)
deal_db_data.execute_sql(insert_station)
login_swp.login01(self.browser, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW) #登录
......@@ -68,7 +68,7 @@ class EditStation(unittest.TestCase):
self.browser.assert_mark_msg(gwwh_gwxx.STATUS_DROPDOWN_LIST, test_data.PRE_STATION_STATUS,By.CSS_SELECTOR) #断言“状态”显示为“待绑定”
self.browser.clear_elem_text(gwwh_gwxx.STATION_NUMBER,By.CSS_SELECTOR) #清除“工位编号”
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.EMPTY_STATION_NUM) #检查出现动态提示文本:修改成功
'''
......@@ -120,17 +120,20 @@ class EditStation(unittest.TestCase):
function:修改部门,添加多个部门
'''
def test_edit_station_005(self):
'''修改部门,添加多个部门(不能添加多个部门)'''
self.browser.click_element(gwwh_gwxx.FIRST_LINE_EDIT_BTN,By.CSS_SELECTOR) #点击页面中第一行工位PF002后面的“编辑”图标
self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT, test_data.PRE_STATION_DEPARTMENT,By.CSS_SELECTOR) #断言“部门”下拉框中的文本为Pre_Testing_Department
'''修改部门,移动工位,添加多个部门'''
self.browser.click_element(gwwh_gwxx.SECOND_LINE_EDIT_BTN,By.CSS_SELECTOR) #点击页面中第一行工位PF002后面的“编辑”图标
self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_PM_1, test_data.PRE_DEPARTMENT_NAME,By.CSS_SELECTOR) #断言“部门”下拉框中的文本为Pre_Testing_Department
self.browser.click_element(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_DELETE_BTN,By.CSS_SELECTOR) #点击Pre_Testing_Department左上角的“X”,删除该部门
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.EMPTY_DEPARTMENT) #检查出现动态提示文本:部门不能为空!
self.browser.click_element(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST,By.CSS_SELECTOR) #点击“部门”下拉框
self.browser.select_option_by_css_and_text("Pre_Sale_Department") #在下拉列表中选择Pre_Sale_Departmen
self.browser.select_option_by_css_and_text("Pre_Operations_Department") #在下拉列表中选择Pre_Operations_Department
self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT, "Pre_Sale_Department",By.CSS_SELECTOR) #断言“部门”下拉框中显示选择的Pre_Sale_Department
# self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_2, "Pre_Operations_Department") #断言“部门”下拉框中显示选择的Pre_Operation_Department
# self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
# self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.EMPTY_DEPARTMENT) #检查出现动态提示文本:部门不能为空!
# self.browser.click_element(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST,By.CSS_SELECTOR) #点击“部门”下拉框
# self.browser.select_option_by_css_and_text("Pre_Sale_Department") #在下拉列表中选择Pre_Sale_Departmen
# self.browser.select_option_by_css_and_text("Pre_Operations_Department") #在下拉列表中选择Pre_Operations_Department
self.browser.click_element(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_4, By.CSS_SELECTOR)
self.browser.click_element(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_5, By.CSS_SELECTOR)
self.browser.click_coordinate(30,0)
self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_PM_1, "Pre_Sale_Department",By.CSS_SELECTOR) #断言“部门”下拉框中显示选择的Pre_Sale_Department
self.browser.assert_mark_msg(gwwh_gwxx.DEPARTMENT_DROPDOWN_LIST_TEXT_PM_2, "Pre_Operations_Department",By.CSS_SELECTOR) #断言“部门”下拉框中显示选择的Pre_Operation_Department
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功!
......@@ -157,7 +160,10 @@ class EditStation(unittest.TestCase):
self.browser.click_element(gwwh_gwxx.USER_EDIT_DROPDOWN_LIST_TEXT_DELETE_BTN,By.CSS_SELECTOR) #点击Pre_SET后面的X,删除该用户
self.browser.assert_attribute_msg(gwwh_gwxx.USER_EDIT_INPUT, test_data.ATTRIBUTE_VALUE, "",By.CSS_SELECTOR) #断言Pre_SET被删除
self.browser.sendkeys_to_element(gwwh_gwxx.USER_EDIT_INPUT, "Pre",By.CSS_SELECTOR) #在“用户”框中输入“Pre”
self.browser.click_element(gwwh_gwxx.USER_EDIT_DROPDOWN_LIST) #选择Pre_CYQ
# self.browser.click_element(gwwh_gwxx.USER_EDIT_DROPDOWN_LIST) #选择Pre_CYQ
self.browser.sleep()
self.browser.select_option_by_css_and_text("Pre_CYQ 002")
self.browser.sleep()
self.browser.assert_mark_msg(gwwh_gwxx.USER_EDIT_DROPDOWN_LIST_TEXT, "Pre_CYQ",By.CSS_SELECTOR) #断言“用户”框中显示Pre_CYQ
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.CHANGE_SUCCESS_MSG) #检查出现动态提示文本:修改成功!
......@@ -238,7 +244,7 @@ class EditStation(unittest.TestCase):
self.browser.assert_mark_msg(gwwh_gwxx.ADD_STATION_BOX_TITLE, test_data.LOTS_EDIT_STATION_BOX_TITLE_TEXT) #断言弹出新页面,页面标题是:批量编辑工位
self.browser.click_element(gwwh_gwxx.LOTS_STATUS_LIST) #点击“状态”下拉框
self.browser.select_option_by_css_and_text(test_data.PRE_STATION_STATUS) #选择工位原先的状态
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, test_data.PRE_STATION_STATUS,By.CSS_SELECTOR) #断言“状态”下拉框中显示:待绑定
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, test_data.PRE_STATION_STATUS) #断言“状态”下拉框中显示:待绑定
self.browser.click_element(gwwh_gwxx.LOTS_DEPARTMENT_LIST) #点击“所属部门”下拉框
self.browser.click_element(gwwh_gwxx.FIRST_DEPARTMENT_LIST)
# self.browser.select_option_by_css_and_text(test_data.PRE_STATION_DEPARTMENT) #选择工位原先所属的部门
......@@ -285,7 +291,7 @@ class EditStation(unittest.TestCase):
self.browser.click_element(gwwh_gwxx.LOTS_STATUS_LIST) #点击“状态”下拉框
status = "停用"
self.browser.select_option_by_css_and_text(status) #选择“停用”
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, status,By.CSS_SELECTOR) #断言“状态”下拉框中显示“停用”
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, status) #断言“状态”下拉框中显示“停用”
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.STATUS_NOT_CHANGE_TO_BLOCK_UP) #检查出现动态提示信息:未启用的工位不能编辑为停用
self.browser.click_element(gwwh_gwxx.CANCEL_BTN) #点击“取消”按钮
......@@ -304,7 +310,7 @@ class EditStation(unittest.TestCase):
self.browser.click_element(gwwh_gwxx.LOTS_STATUS_LIST) #点击“状态”下拉框
status = "正常"
self.browser.select_option_by_css_and_text(status) #选择“正常”
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, status, By.CSS_SELECTOR) #断言“状态”下拉框中显示“正常”
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_STATUS_LIST_TEXT, status) #断言“状态”下拉框中显示“正常”
self.browser.click_element(gwwh_gwxx.CONFIRM_BTN) #点击“确定”按钮
self.browser.assert_mark_msg(gwwh_gwxx.DYNAMIC_WARNING_MSG, test_data.STATUS_NOT_CHANGE_TO_NORMAL) #检查出现动态提示信息:工位坐标信息不全不可以批量启用
self.browser.click_element(gwwh_gwxx.CANCEL_BTN) #点击“取消”按钮
......@@ -325,6 +331,7 @@ class EditStation(unittest.TestCase):
department2 = "Pre_Operations_Department"
self.browser.click_element(gwwh_gwxx.SECOND_DEPARTMENT_LIST)
self.browser.click_element(gwwh_gwxx.THIRD_DEPARTMENT_LIST)
self.browser.click_coordinate(30,0)
# self.browser.select_option_by_css_and_text(department1) #选择部门Pre_Sale_Department
# self.browser.select_option_by_css_and_text(department2) #选择部门Pre_Operations_Department
self.browser.assert_mark_msg(gwwh_gwxx.LOTS_DEPARTMENT_LIST_TEXT, department1) #断言部门下拉框中显示部门Pre_Sale_Department
......
......@@ -24,19 +24,19 @@ class DeleteStation(unittest.TestCase):
#清除干扰数据
deal_db_data.clear_station()
#插入工位,作为预置数据
insert_station = '''INSERT INTO `mobilestation`(domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,stationNum,stationState,stationType,userId,userName,parkId)
VALUES({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'S001',3,1,{ui},'{un}',{pi}),