Commit bbfb9d13 authored by libin's avatar libin
Browse files

20190806

parent c1e01945
This diff is collapsed.
......@@ -72,7 +72,7 @@ class WebClient():
def exit_all_browsers(self):
self.__driver.quit()
time.sleep(self.timeout)
'''关闭新打开的浏览页'''
def close_new_browser(self):
ActionChains(self.__driver).key_down(Keys.CONTROL).send_keys("w").key_up(Keys.CONTROL).perform()
......@@ -491,8 +491,8 @@ class WebClient():
def sleep(self):
time.sleep(self.timeout)
def sleep_time(self,time):
time.sleep(time)
def sleep_time(self,sleep_ime):
time.sleep(sleep_ime)
if __name__ == '__main__':
a = WebClient("http://testsmartworkspace294.rd.virsical.cn/manage/")
......
......@@ -41,6 +41,7 @@ SEARCH_RESULT_TEXT_2 = "共 2 条"
SEARCH_RESULT_TEXT_4 = "共 4 条"
SEARCH_RESULT_TEXT_6 = "共 6 条"
SEARCH_RESULT_TEXT_9 = "共 9 条"
SEARCH_RESULT_TEXT_10 = "共 10 条"
PLEASE_ENTER_USERNAME = "请输入账号!"
PLEASE_ENTER_PW = "请输入密码!"
WRONG_USERNAME = "用户不存在"
......@@ -69,7 +70,8 @@ ATTRIBUTE_PLACEHOLDER_TEXT_START_DATE = "开始日期"
ATTRIBUTE_PLACEHOLDER_TEXT_END_DATE = "结束日期"
ATTRIBUTE_PLACEHOLDER_TEXT_ENTER_VACATION_NAME = "请输入节假日名称"
ATTRIBUTE_CLASS = "class"
ATTRIBUTE_CLASS_TEXT_DISABLED = "page-option-ewm-select div-disabled"
ATTRIBUTE_CLASS_TEXT_DISABLED = "page-option-ewm-select div-disabled"
ATTRIBUTE_CLASS_TEXT_DISABLED2 = "page-option-ewm-select div-disabled"
ATTRIBUTE_CLASS_TEXT_AVAILABLE = "page-option-ewm-select operation-list"
ATTRIBUTE_CLASS_LOTS_EDIT_AVAILABLE = "page-option-ewm-select" #“批量编辑”按钮可用时的属性class的值
ATTRIBUTE_CLASS_SWITCH_CHECKED = "ant-switch ant-switch-checked"
......@@ -119,8 +121,9 @@ DELETE_CONFIRM_BOX_TEXT = "确认删除该条数据?"
DELETE_CONFIRM_BOX_TEXT_CHINESE = "确认删除该条数据?"
DELETE_CONFIRM_BOX_TEXT_USE = "该用户正在使用固定工位,请确定是否删除?"
DELETE_LOTS_CONFIRM_BOX_TEXT = "确认删除勾选的数据?"
DELETE_SUCCESS_MSG = "操作成功"
DELETE_FAILED_MSG = "部门designer department存在工位,不可删除"
DELETE_SUCCESS_MSG = "删除成功"
DELETE_SUCCESS_MSG2 = "该部门被删除,且部门下的用户均被删除"
DELETE_FAILED_MSG = "部门下存在座位,删除失败"
'''
首页数据
'''
......@@ -351,7 +354,7 @@ PRE_USER_ID = "1696"
PRE_USER_JOB_NUMBER = "autotest"
PRE_USER_CARD_NUMBER = "autotest"
PRE_USER_EMAIL = "at@autotest.com"
# PRE_USER_DEPARTMENT = "Pre_Testing_Department"
PRE_USER_DEPARTMENT = PRE_DEPARTMENT_NAME
PRE_USER_ROLE = "普通用户"
PRE_USER_WORKSTATION_NUMBER = "FS001"
......@@ -374,8 +377,10 @@ SPECIAL_USER_ROLEURL = '1,2,3,4,5,6,7,8,11,13,15,16,17,18,19,20,21,22,26,27,28,2
SPECIAL_USER_RANGE = "Pre_Xi'an_SoftWare_Park"
'''预置的工位数据'''
PRE_MOBILE_STATION_ID = "2456"
PRE_FIXED_STATION_ID = "2457"
PRE_MOBILE_STATION_NAME = "PM001"
PRE_FIXED_STATION_NAME = "PF002"
PRE_FIXED_STATION_NAME = "PF001"
PRE_STATION_PARK = PRE_PARK_NAME
PRE_STATION_BUILDING = PRE_BUILD_NAME
PRE_STATION_FLOOR = PRE_FLOOR_NAME
......
......@@ -71,10 +71,10 @@ COMPANYADMIN_DTGL_KJSC = '//*[@id="sub5$Menu"]/li[2]'
'''工位管理'''
COMPANYADMIN_GWGL = '//*[@id="workstationIndex"]/div/div/div[1]/div/ul/li[7]/div'
COMPANYADMIN_GWGL_KXGDGW = '//*[@id="sub6$Menu"]/li[1]'
COMPANYADMIN_GWGL_GWBX = '//*[@id="sub6$Menu"]/li[2]'
COMPANYADMIN_GWGL_ZWCX = '//*[@id="sub6$Menu"]/li[3]'
COMPANYADMIN_GWGL_GWXCJL = '//*[@id="sub6$Menu"]/li[4]'
COMPANYADMIN_GWGL_KXGDGW = '//*[@id="sub2$Menu"]/li[1]'
COMPANYADMIN_GWGL_GWBX = '//*[@id="sub2$Menu"]/li[2]'
COMPANYADMIN_GWGL_ZWCX = '//*[@id="sub2$Menu"]/li[3]'
COMPANYADMIN_GWGL_GWXCJL = '//*[@id="sub2$Menu"]/li[4]'
'''系统日志'''
COMPANYADMIN_XTRZ = '//*[@id="workstationIndex"]/div/div/div[1]/div/ul/li[8]/div'
......@@ -82,9 +82,9 @@ COMPANYADMIN_XTRZ_CZRZ = '//*[@id="sub7$Menu"]/li[1]'
'''统计报表'''
COMPANYADMIN_TJBB = '//*[@id="workstationIndex"]/div/div/div[1]/div/ul/li[9]/div'
COMPANYADMIN_TJBB_YDGWYDL = '//*[@id="sub8$Menu"]/li[1]'
COMPANYADMIN_TJBB_YDGWLYL = '//*[@id="sub8$Menu"]/li[2]'
COMPANYADMIN_TJBB_YDGWWSYL = '//*[@id="sub8$Menu"]/li[3]'
COMPANYADMIN_TJBB_YDGWSYL = '//*[@id="sub8$Menu"]/li[4]'
COMPANYADMIN_TJBB_YDGWSYJL = '//*[@id="sub8$Menu"]/li[5]'
COMPANYADMIN_TJBB_KJZYTJ = '//*[@id="sub8$Menu"]/li[6]'
\ No newline at end of file
COMPANYADMIN_TJBB_YDGWYDL = '//*[@id="sub1$Menu"]/li[1]'
COMPANYADMIN_TJBB_YDGWLYL = '//*[@id="sub1$Menu"]/li[2]'
COMPANYADMIN_TJBB_YDGWWSYL = '//*[@id="sub1$Menu"]/li[3]'
COMPANYADMIN_TJBB_YDGWSYL = '//*[@id="sub1$Menu"]/li[4]'
COMPANYADMIN_TJBB_YDGWSYJL = '//*[@id="sub1$Menu"]/li[5]'
COMPANYADMIN_TJBB_KJZYTJ = '//*[@id="sub1$Menu"]/li[6]'
\ No newline at end of file
UPLOADING_STATION_MAP_BTN = ".//*[@class='map-action']/a[1]/i[1]"
UPLOADING_STATION_MAP_BTN = ".//*[@class='ant-table-tbody']/tr[1]/td[11]/div/a[1]/i"
UPLOADING_STATION_MAP2_BTN = ".//*[@class='ant-table-tbody']/tr[2]/td[11]/div/a[1]/i"
EDIT_STATION_MAP_BTN = "icon-ditu_0"
STATION_SEAT_MANAGEMENT_BTN = "icon-zuowei_0"
DRAW_PATH_BTN = ".//i[@class='iconfont icon-lujingfenxi']"
......
......@@ -5,16 +5,17 @@ SEARCH_RESULT = ".//*[@class='ant-spin-container']/ul[1]/li[1]"
PAGE_ONE = ".//*[@class='ant-spin-container']/ul[1]/li[3]"
PAGE_TWO = ".//*[@class='ant-spin-container']/ul[1]/li[4]"
NO_DATA_TEXT = "ant-table-placeholder"
LOTS_EDIT_BTN = ".//*[@class='clearfix page-option']/div[2]"
LOTS_EDIT_BTN = "//*[@id='more']/div[2]/div/div/div/ul/li[1]/div"
LOTS_DELETE_BTN = ".//*[@class='clearfix page-option']/div[3]"
LOTS_CHECKBOX = ".//*[@class='ant-table-selection-column']/span[1]/div[1]/label[1]/span[1]/input[1]"
LOTS_CHECKBOX_SPAN = ".//*[@class='ant-table-selection-column']/span[1]/div[1]/label[1]/span[1]"
LOTS_CHECKBOX_SPAN = ".//*[@class='ant-table-selection-column']/span[1]/div[1]/label[1]/span[1]"
MORE_OPERATION = '//*[@id="more"]/div[1]/div[7]/p/a'
#第一行工位数据信息
FIRST_LINE_EDIT_BTN = 'icon-edit_0'
FIRST_LINE_DELETE_BTN = "icon-delete_0"
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[10]"
FIRST_LINE_STATUS = ".//*[@class='ant-table-tbody']/tr[1]/td[11]"
FIRST_LINE_STATION_NUMBER = ".//*[@class='ant-table-tbody']/tr[1]/td[3]"
#第二行工位数据信息
SECOND_LINE_EDIT_BTN = "icon-edit_1"
......@@ -42,6 +43,7 @@ ALL_ANT_DROPDOWN_BOX = ".ant-select-selection__rendered .ant-select-selection-se
STATION_NUMBER_INPUT = ".select .ant-input"
SEARCH_BTN = ".ant-btn.ant-btn-primary"
RESET_BTN = ".//*[@class='select']/button[2]"
SECOND_SEARCH_DEPARTMENT_DROPDOWNLIST = '//*[@id="main"]/div[2]/div/div/div/ul/li[3]'
'''“添加工位”页面中的元素'''
......@@ -54,7 +56,8 @@ AREA_DROPDOWN_LIST = ".form-group [name='page.filter.area'] .ant-select-selectio
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 > 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 = "#form-group > li:nth-child(7) > div > span > span > span.ant-select-selection__rendered > span"
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"
USER_INPUT = "[name='page.filter.user'] input"
......@@ -75,11 +78,14 @@ CLOSE_BTN = ".//*[@class='ant-modal-content']/button[1]"
DYNAMIC_WARNING_MSG = ".//*[@class='ant-message-notice-content']/div[1]/span[1]"
'''“批量编辑工位”页面中的元素'''
LOTS_DEPARTMENT_LIST = "[name='department.manage.dept'] .ant-select-selection__placeholder"
LOTS_DEPARTMENT_LIST_TEXT = "[name='department.manage.dept'] .ant-select-selection__choice__content"
LOTS_DEPARTMENT_LIST_TEXT_02 = ".//*[@name='department.manage.dept']/div[1]/div[1]/div[1]/ul[1]/li[2]/div[1]"
LOTS_STATUS_LIST = "[name='page.table.status'] .ant-select-selection__placeholder"
LOTS_DEPARTMENT_LIST = "/html/body/div[3]/div/div[2]/div/div[1]/div[2]/ul/li[1]/div/span/span/span"
LOTS_DEPARTMENT_LIST_TEXT = "/html/body/div[3]/div/div[2]/div/div[1]/div[2]/ul/li[1]/div/span/span/ul/li[1]"
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 = "/html/body/div[3]/div/div[2]/div/div[1]/div[2]/ul/li[2]/div/div/div/div/div"
LOTS_STATUS_LIST_TEXT = "[name='page.table.status'] .ant-select-selection-selected-value"
FIRST_DEPARTMENT_LIST = "/html/body/div[5]/div/div/div/ul/li[2]/span[2]"
SECOND_DEPARTMENT_LIST = "/html/body/div[4]/div/div/div/ul/li[3]/span[2]"
THIRD_DEPARTMENT_LIST = "/html/body/div[4]/div/div/div/ul/li[4]/span[2]"
'''删除工位确认框'''
DELETE_STATION_CONFIRM_BOX_TEXT = "ant-confirm-title"
......
......@@ -10,7 +10,7 @@ USER_NAME_SEARCH_INPUT = "[name='page.filter.name'] input"
SEARCH_BTN = ".//*[@class='buttons']/li[1]/button[1]"
RESET_BTN = ".//*[@class='buttons']/li[2]/button[1]"
FIRST_DEPARTMENT_SELECT = ".//*[@id='main']/div[2]/div/div/div/ul/li[2]"
SECOND_LINE_DELETE_BTN = ".//*[@class='ant-table-tbody']/tr[2]/td[9]/span[1]/i[2]"
SECOND_LINE_DELETE_BTN = ".//*[@class='ant-table-tbody']/tr[2]/td[10]/span[1]/i[2]"
LOTS_CHECKBOX = ".//*[@class='ant-table-selection']/label[1]/span[1]/input[1]"
FIRST_PAGE_BTN = ".//*[@class='ant-pagination ant-table-pagination']/li[3]"
SECOND_PAGE_BTN = ".//*[@class='ant-pagination ant-table-pagination']/li[4]"
......@@ -29,9 +29,10 @@ USER_EMAIL = "[name='page\.filter\.floor'] .ant-input"
USER_DEPARTMENT = "ul[class='form-group']>li>[name='page.filter.dept']"
USER_ROLE = "ul[class='form-group']>li>[name='user.import.role']"
USER_DEPARTMENT_CHECK = "/html/body/div[3]/div/div/div/ul/li[2]/span[2]"
USER_DEPARTMENT_CHECK1 = "/html/body/div[4]/div/div/div/ul/li[2]/span[2]"
USER_ROLE_GENERAL_USER = ".//*[@class = 'ant-select-dropdown ant-select-dropdown--single ant-select-dropdown-placement-bottomLeft' ]/div[1]/ul[1]/li[3]"
USER_ROLE_SPECIAL_USER = ".//*[@class = 'ant-select-dropdown ant-select-dropdown--single ant-select-dropdown-placement-bottomLeft' ]/div[1]/ul[1]/li[2]"
USER_WORKSTATION = "[name] [tabindex='-1']"
USER_WORKSTATION = "/html/body/div[2]/div/div[2]/div/div[1]/div[2]/ul/li[7]/div/span"
USER_WORKSTATION_NUMBER = ".//*[@class='ant-select-selection__rendered']/div[2]/div[1]"
USER_INFORMATION_TEXT = ".//*[@id='main']/div/div[1]"
DYNAMIC_WARNING_MSG = ".//*[@class='ant-message-notice-content']/div[1]/span[1]"
......
......@@ -109,6 +109,13 @@ def reset_building():
WHERE id=%s AND domainId=%s;'''%(test_data.PRE_BUILD_BUILDTOKEN, test_data.PRE_BUILD_NAME, test_data.PRE_PARK_ID, test_data.PRE_BUILD_ID, test_data.COMPANY_ID)
execute_sql(update_sql)
# 重置预置区域
def reset_area():
update_sql = '''UPDATE `floorarea` f
SET f.`areaAge`=1000000
WHERE id=%s AND domainId=%s;'''%(test_data.PRE_AREA_ID, test_data.COMPANY_ID)
execute_sql(update_sql)
# 重置预置部门
def reset_department():
update_sql = "UPDATE `organization` o SET o.`orgName`='%s' WHERE o.`id`=%s;"%(test_data.PRE_DEPARTMENT_NAME, test_data.PRE_DEPARTMENT_ID)
......@@ -133,4 +140,17 @@ 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)
execute_sql(update_sql2)
# 重置工位信息
def reset_station():
update_sql1 = '''UPDATE `mobilestation` SET floorAreaId=%s,floorAreaNum='%s',floorId=%s,floorNum='%s',officeBuildingId=%s,officeBuildingName='%s',
orgId='%s',parkName='%s',parkId=%s,stationNum='%s',stationState=3 WHERE id=%s;'''%(test_data.PRE_AREA_ID, test_data.PRE_STATION_AREA,
test_data.PRE_FLOOR_ID, test_data.PRE_STATION_FLOOR,test_data.PRE_BUILD_ID,test_data.PRE_STATION_BUILDING,test_data.PRE_DEPARTMENT_ID,
test_data.PRE_STATION_PARK,test_data.PRE_PARK_ID,test_data.PRE_MOBILE_STATION_NAME,test_data.PRE_MOBILE_STATION_ID)
execute_sql(update_sql1)
update_sql2 = '''UPDATE `mobilestation` SET floorAreaId=%s,floorAreaNum='%s',floorId=%s,floorNum='%s',officeBuildingId=%s,officeBuildingName='%s',
orgId='%s',parkName='%s',parkId=%s,stationNum='%s',stationState=3 WHERE id=%s;''' % (test_data.PRE_AREA_ID, test_data.PRE_STATION_AREA,
test_data.PRE_FLOOR_ID, test_data.PRE_STATION_FLOOR, test_data.PRE_BUILD_ID, test_data.PRE_STATION_BUILDING,test_data.PRE_DEPARTMENT_ID,
test_data.PRE_STATION_PARK, test_data.PRE_PARK_ID, test_data.PRE_FIXED_STATION_NAME,test_data.PRE_FIXED_STATION_ID)
execute_sql(update_sql2)
\ No newline at end of file
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