Commit 32441758 authored by libin's avatar libin
Browse files

delete user work

parent b63ef457
......@@ -142,16 +142,20 @@ def reset_user():
# 重置预置普通角色
def reset_commoon_role():
update_sql1 = '''UPDATE `role` r SET r.`menu`='%s',
r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`scopes`='%s',
r.`defaultRole`=0,r.`speReser`=0 WHERE id = %s;'''%(test_data.COMMON_USER_MENU, test_data.COMMON_USER_ROLE_NAME, test_data.COMMON_USER_SCOPES, test_data.COMMON_USER_ROLE_ID)
# update_sql1 = '''UPDATE `role` r SET r.`menu`='%s',
# r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`scopes`='%s',
# r.`defaultRole`=0,r.`speReser`=0 WHERE id = %s;'''%(test_data.COMMON_USER_MENU, test_data.COMMON_USER_ROLE_NAME, test_data.COMMON_USER_SCOPES, test_data.COMMON_USER_ROLE_ID)
update_sql1 = '''UPDATE `role` r SET r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`defaultRole`=0,r.`speReser`=0 WHERE id = %s;''' % (
test_data.COMMON_USER_ROLE_NAME,test_data.COMMON_USER_ROLE_ID)
execute_sql(update_sql1)
# 重置预置特殊预约角色
def reset_special_role():
update_sql2 = '''UPDATE `role` r SET r.`menu`='%s',
r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`scopes`='%s',
r.`defaultRole`=1,r.`speReser`=1 WHERE id =%s;'''%(test_data.SPECIAL_USER_MENU, test_data.SPECIAL_USER_ROLE_NAME, test_data.SPECIAL_USER_SCOPES, test_data.SPECIAL_USER_ROLE_ID)
# update_sql2 = '''UPDATE `role` r SET r.`menu`='%s',
# r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`scopes`='%s',
# r.`defaultRole`=1,r.`speReser`=1 WHERE id =%s;'''%(test_data.SPECIAL_USER_MENU, test_data.SPECIAL_USER_ROLE_NAME, test_data.SPECIAL_USER_SCOPES, test_data.SPECIAL_USER_ROLE_ID)
update_sql2 = '''UPDATE `role` r SET r.`roleName`='%s',r.`roleType`=0,r.`roleFlag`=0,r.`defaultRole`=1,r.`speReser`=1 WHERE id =%s;''' % (
test_data.SPECIAL_USER_ROLE_NAME,test_data.SPECIAL_USER_ROLE_ID)
execute_sql(update_sql2)
# 重置工位信息
......
......@@ -41,7 +41,7 @@ class CreateUser(unittest.TestCase):
xtpz_yhxx.USER_DEPARTMENT,xtpz_yhxx.USER_DEPARTMENT_CHECK,\
xtpz_yhxx.USER_ROLE,xtpz_yhxx.USER_ROLE_GENERAL_USER)
#断言“自动分配工位”是OFF状态
self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED)
# self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED)
self.browser.click_element(xtpz_yhxx.CONFIRM_BTN)#点击“确定”按钮
self.browser.assert_mark_msg(xtpz_yhxx.DYNAMIC_WARNING_MSG, test_data.ADD_SUCCESS_MSG)#检查出现动态提示信息:添加成功
'''
......@@ -90,10 +90,10 @@ class CreateUser(unittest.TestCase):
xtpz_yhxx.USER_DEPARTMENT,xtpz_yhxx.USER_DEPARTMENT_CHECK,\
xtpz_yhxx.USER_ROLE,xtpz_yhxx.USER_ROLE_GENERAL_USER)
#断言“自动分配工位”是ON
self.browser.sleep()
self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED)
# self.browser.sleep()
# self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED)
#断言“工位编号”为预置的固定工位fixed001
self.browser.assert_mark_msg(xtpz_yhxx.USER_WORKSTATION_NUMBER, 'fixed001')
# self.browser.assert_mark_msg(xtpz_yhxx.USER_WORKSTATION_NUMBER, 'fixed001')
self.browser.click_element(xtpz_yhxx.CONFIRM_BTN)#点击“确定”按钮
self.browser.assert_mark_msg(xtpz_yhxx.DYNAMIC_WARNING_MSG, test_data.EMAIL_FORMAT_ERROR)#检查出现动态提示信息:邮箱格式不正确!
self.browser.clear_elem_text(xtpz_yhxx.USER_EMAIL, By.CSS_SELECTOR)#清除邮箱
......@@ -138,7 +138,7 @@ class CreateUser(unittest.TestCase):
#断言“邮箱”输入框中的默认文本为“请输入邮箱”
self.browser.assert_attribute_msg(xtpz_yhxx.USER_EMAIL, test_data.ATTRIBUTE_PLACEHOLDER, test_data.ATTRIBUTE_PLACEHOLDER_TEXT_EMAIL, By.CSS_SELECTOR)
#断言“自动分配工位”是OFF状态
self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED)
# self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_UNCHECKED)
self.browser.click_element(xtpz_yhxx.CONFIRM_BTN)#点击“确定”按钮
self.browser.assert_mark_msg(xtpz_yhxx.DYNAMIC_WARNING_MSG, test_data.EMPTY_USERNAME_MSG)#检查出现动态提示信息:姓名不能为空!
self.browser.sendkeys_to_element(xtpz_yhxx.USER_NAME, 'CYQ', By.CSS_SELECTOR)#输入姓名
......
......@@ -45,7 +45,7 @@ class EditUser(unittest.TestCase):
self.browser.assert_attribute_msg(xtpz_yhxx.USER_EMAIL, test_data.ATTRIBUTE_VALUE, test_data.PRE_USER_EMAIL, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_yhxx.USER_DEPARTMENT, test_data.PRE_USER_DEPARTMENT, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_yhxx.USER_ROLE, test_data.PRE_USER_ROLE, By.CSS_SELECTOR)
self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED)
# self.browser.assert_attribute_msg(xtpz_yhxx.USER_WORKSTATION, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_SWITCH_CHECKED)
self.browser.assert_mark_msg(xtpz_yhxx.USER_WORKSTATION_NUMBER, "129")
user_name = 'edit user'
job_number = '0516'
......
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