Commit c1e01945 authored by libin's avatar libin
Browse files

20190730

parent 584b72f6
This diff is collapsed.
......@@ -261,7 +261,7 @@ class WebClient():
raise AssertionError("\nAssertError: actual result: " + txtmsg + \
"; expect restlt: " + msg)
except TimeoutException:
raise AssertionError("\nAssertError:can't find element!")
raise Exception("can't find element:"+element_selector)
'''获取多个元素,并获取它们的text和传入的文本进行断言比较'''
......
......@@ -56,6 +56,7 @@ ENTER_NAME_TEXT = "请输入姓名"
MAX_INPUT_ATTRIBUTE = "maxlength"
MAX_INPUT_CHARACTER_NUM = "50"
ATTRIBUTE_VALUE = 'value'
ATTRIBUTE_STYLE = 'style'
ATTRIBUTE_PLACEHOLDER = "placeholder"
ATTRIBUTE_PLACEHOLDER_TEXT = "全部"
ATTRIBUTE_PLACEHOLDER_TEXT_NAME = "请输入姓名"
......@@ -68,7 +69,7 @@ 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_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"
......@@ -326,7 +327,7 @@ PRE_ALL_DAY_END = "18:00"
预置的部门数据
'''
PRE_DEPARTMENT_NAME = "产品测试部"
PRE_DEPARTMENT_ID = "2610"
PRE_DEPARTMENT_ID = "2611"
PRE_DEPARTMENT_FATHER_ID = "496"
'''预置的楼宇数据'''
......@@ -346,11 +347,11 @@ PRE_AREA_ID = "28"
预置的用户数据
'''
PRE_USER_NAME = "autotest"
PRE_USER_ID = "1684"
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_Testing_Department"
PRE_USER_ROLE = "普通用户"
PRE_USER_WORKSTATION_NUMBER = "FS001"
......
......@@ -8,19 +8,33 @@ 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[2]"
FIRST_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[1]/td[2]/span[3]"
SECOND_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[2]/td[2]/span[3]"
THIRD_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[3]/td[2]/span[3]"
FOURTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[4]/td[2]/span[3]"
FIFTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[5]/td[2]/span[3]"
SIXTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[6]/td[2]/span[3]"
SEVENTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[7]/td[2]/span[3]"
EIGHTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[8]/td[2]/span[3]"
NINTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[9]/td[2]/span[3]"
TENTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[10]/td[2]/span[3]"
ELEVENTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[11]/td[2]/span[3]"
TWENTIETH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[12]/td[2]/span[3]"
THIRTEENTH_LINE_DEPARTMENT_NAME_TEXT = ".//*[@class='ant-table-tbody']/tr[13]/td[2]/span[3]"
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]"
SEARCH_RESULT_TEXT = ".//*[@class='ant-spin-container']/ul[1]/li[1]"
NO_DATA_TEXT = ".//*[@class='ant-table-placeholder']/span[1]"
DELETE_FIRST_LINE_BTN = ".//*[@class='ant-table-tbody']/tr[1]/td[6]/span[1]/i[2]"
DELETE_FIRST_LINE_BTN = ".//*[@class='ant-table-tbody']/tr[2]/td[5]/span[1]/i[2]"#新增的第一个,即第二条数据
DELETE_LAST_LINE_BTN = ".//*[@class='ant-table-tbody']/tr[last()]/td[5]/span[1]/i[2]"
LOT_SIZING_DELETE_BTN = ".//*[@id='main']/div/div[3]/div[1]/div[2]"
LOT_SIZING_CHECKBOX = ".//*[@class='ant-checkbox-wrapper']/span[1]/input[1]"
PAGE_NUM_1 = ".//*[@class='ant-spin-container']/ul[1]/li[3]"
PAGE_NUM_2 = ".//*[@class='ant-spin-container']/ul[1]/li[4]"
FIRST_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[1]/td[1]/span[1]/label[1]/span[1]/input[1]"
THIRD_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[3]/td[1]/span[1]/label[1]/span[1]/input[1]"
FIRST_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[1]/td[1]/span/label/span/input"
LAST_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[last()]/td[1]/span/label/span/input"
THIRD_LINE_CHECKBOX = ".//*[@class='ant-table-tbody']/tr[3]/td[1]/span/label/span/input"
'''
......
......@@ -15,18 +15,18 @@ 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[2]/div/button[1]'
SEARCH_BUTTON01='//*[@id="main"]/div/div[2]/ul/li[3]/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]"
SEARCH_RESULT=".//*[@id='main']/div/div[2]/div[2]/div/div/ul/li[1]"
DELETE_BUILD_ICON=".//i[@class='iconfont icon-delete page-option-icon']"
DELETE_OVERLAY_TITLE="html/body/div[3]/div/div[2]/div/div[1]/div/div/div[1]/span"
DELETE_BUILD_ICON=".//i[@class='iconfont icon-delete page-option-icon ']"
DELETE_OVERLAY_TITLE="/html/body/div[4]/div/div[2]/div/div[1]/div/div/div[1]/span"
DELETE_BUILD_CONFIRM_BUTTON=".//button[@class='ant-btn ant-btn-primary ant-btn-lg']"
DELETE_BUILDE_CANCEL_BUTTON=".//button[@class='ant-btn ant-btn-lg']"
BUILD_LIST_NAME01=".//*[@id='main']/div/div[2]/div[2]/div/div/div/div/div/div/table/tbody/tr[1]/td[2]"
BUILD_LIST_EMPTY=".//*[@id='main']/div/div[2]/div[2]/div/div/div/div/div/div[2]/span"
BUILD_LIST_EMPTY=".//*[@id='main']/div/div[2]/div[2]/div/div/div/div/div/div[2]"
ERROR_MESSAGE=".//div[@class='ant-message-custom-content ant-message-error']/span"
BUILDING_MANAGEMENT_PAGE_TEXT = ".//*[@id='main']/div/div[1]/span"
BUILD_BUILDTOKEN_IMG=".//*[@id='main']/div/div[2]/div[2]/div/div/div/div/div/div/table/tbody/tr/td[4]/div/span/div[1]/div[1]/span/a"
......
......@@ -111,14 +111,14 @@ def reset_building():
# 重置预置部门
def reset_department():
update_sql = "UPDATE `organization` o SET o.`orgName`='%s' WHERE o.`id`=%s;"%(test_data.PRE_DEPARTMENT_NAME, test_data.COMPANY_ID)
update_sql = "UPDATE `organization` o SET o.`orgName`='%s' WHERE o.`id`=%s;"%(test_data.PRE_DEPARTMENT_NAME, test_data.PRE_DEPARTMENT_ID)
execute_sql(update_sql)
# 重置预置用户
def reset_user():
update_sql = '''UPDATE `userinfo` u
SET u.`attendanceCard` = '%s', u.`email` = '%s',u.`employeeId`='%s',u.`employeeName`='%s',u.`orgId` = %s,u.`roleId`=%s,u.`userFrom`=2,u.`userStatus`=0
WHERE id =%s;'''%(test_data.PRE_USER_CARD_NUMBER, test_data.PRE_USER_EMAIL, test_data.PRE_USER_JOB_NUMBER, test_data.COMMON_USER_ROLE_ID, test_data.COMPANY_ID)
WHERE id =%s;'''%(test_data.PRE_USER_CARD_NUMBER, test_data.PRE_USER_EMAIL, test_data.PRE_USER_JOB_NUMBER, test_data.PRE_USER_NAME, test_data.PRE_DEPARTMENT_ID, test_data.COMMON_USER_ROLE_ID, test_data.PRE_USER_ID)
execute_sql(update_sql)
# 重置预置普通角色
......
'''
进入各个主页面,从登陆开始执行
'''
from src.datalib import test_data
from src.elementlib import companyadmin, xtpz_yqgl
#园区管理
def goto_park(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTPZ) # 点击侧边栏中的“系统设置”
browser.click_element(companyadmin.COMPANYADMIN_XTPZ_YQGL) # 点击“系统设置”下的“园区管理”
# browser.assert_mark_msg(xtpz_yqgl.PARK_MANAGEMENT_TEXT, test_data.PARK_MANAGEMENT_TEXT) # 断言页面标题是“园区管理”
#楼宇管理
def goto_build(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTSZ) # 点击侧边栏中的“系统设置”
browser.click_element(companyadmin.COMPANYADMIN_XTSZ_LYGL) # 点击“系统设置”下的“园区管理”
#楼层管理
def goto_floor(browser):
object.click_element(companyadmin.COMPANYADMIN_XTPZ) # 点击工位管理菜单
object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL) # 点击楼层管理菜单
#区域管理
def goto_area(browser):
object.click_element(companyadmin.COMPANYADMIN_XTPZ)
object.click_element(companyadmin.COMPANYADMIN_XTPZ_QYGL)
#部门管理
def goto_department(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTPZ) # 点击侧边栏中的“工位管理”
browser.click_element(companyadmin.COMPANYADMIN_XTPZ_BMGL) # 点击“工位管理”下的“部门管理”
# browser.assert_mark_msg(xtpz_bmgl.DEPARTMENT_MANAGEMENT_PAGE_TITLE, test_data.DEPARTMENT_MANAGEMENT_TEXT) # 断言页面中的文本:部门管理
#用户管理
def goto_user(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTPZ)
browser.click_element(companyadmin.COMPANYADMIN_XTPZ_YHXX)
# browser.assert_mark_msg(xtpz_yhxx.PAGE_TITLE, test_data.USER_INFORMATION_TEXT) # 断言页面中的文本“用户信息”
#角色管理
def goto_role(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTPZ)
browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)
#角色管理
def goto_role(browser):
browser.click_element(companyadmin.COMPANYADMIN_XTPZ)
browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)
#工位信息
def goto_station(browser):
browser.click_element(companyadmin.COMPANYADMIN_ZYGL)
browser.click_element(companyadmin.COMPANYADMIN_ZYGL_GWXX)
from src.common import mysql_client
from src.datalib import test_data
from src.module import deal_db_data
insert_sql = '''INSERT INTO `organization` (domainId,orgFatherId,orgName,orgStatus)
VALUES({di},{fi},'测试部1门',0),({di},{fi},'测试部101',0),({di},{fi},'test department',0),({di},{fi},'运1维部',0),({di},{fi},'在线1教育研发部',0),({di},{fi},'在线1教育@',0),({di},{fi},'产品服1务部',0),
({di},{fi},'云应用研发1部',0),({di},{fi},'人事部1',0),({di},{fi},'销售1部',0),({di},{fi},'设1计部',0),({di},{fi},'designe1r department',0);'''\
.format(di = test_data.COMPANY_ID, fi = test_data.PRE_DEPARTMENT_FATHER_ID)
deal_db_data.execute_sql(insert_sql)
\ No newline at end of file
......@@ -8,6 +8,7 @@ from src.elementlib import companyadmin
from src.module import edit_yuanqu
from src.module import deal_db_data
from selenium.webdriver.common.by import By
from src.module import goto
class CreatePark(unittest.TestCase):
......@@ -16,9 +17,7 @@ class CreatePark(unittest.TestCase):
self.brower = web_client.WebClient(test_data.MANAGE_URL)
deal_db_data.clear_park()
login_swp.login01(self.brower,test_data.COMPANYADMIN_NAME,test_data.COMPANYADMIN_PW,test_data.HOME_PAGE_COMPANYADMIN_NAME)#登陆
self.brower.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“系统设置”
self.brower.click_element(companyadmin.COMPANYADMIN_XTPZ_YQGL)#点击“系统设置”下的“园区管理”
self.brower.assert_mark_msg(xtpz_yqgl.PARK_MANAGEMENT_TEXT,test_data.PARK_MANAGEMENT_TEXT)#断言页面标题是“园区管理”
goto.goto_park(self.brower)
'''
author:曹英群
createtime:2017.08.15
......
......@@ -6,6 +6,7 @@ from src.module import login_swp,deal_db_data, upload_file
from src.elementlib import companyadmin, xtpz_lygl
from selenium.webdriver.common.by import By
import logging
from src.module import goto
class Blulid(unittest.TestCase):
......@@ -15,8 +16,7 @@ class Blulid(unittest.TestCase):
login_swp.login01(self.browser, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW) #登录
def test_createbuild(self):
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ) #点击导航菜单中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_LYGL) #点击“工位管理”下的“楼宇管理”
goto.goto_build(self.browser)
'''
创建楼宇
'''
......
......@@ -8,6 +8,7 @@ from src.elementlib import xtpz_lcgl
from src.elementlib import companyadmin
from selenium.webdriver.common.by import By
import logging
from src.module import goto
class Login(unittest.TestCase):
def setUp(self):
......@@ -18,9 +19,7 @@ class Login(unittest.TestCase):
#验证所有数据都正确的情况下是否添加成功
def test_Createfloor(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击工位管理菜单
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)#点击楼层管理菜单
time.sleep(3)
goto.goto_floor(self.object)
self.object.click_element(xtpz_lcgl.ADDBUILD)#点击添加楼层
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)#点击楼层输入框
self.object.sendkeys_to_element(xtpz_lcgl.ADDBUILD_FLOOR, 'a20', By.CSS_SELECTOR)#输入楼层
......@@ -33,9 +32,7 @@ class Login(unittest.TestCase):
self.object.click_element(xtpz_lcgl.DETERMINE_BUTTON)#点击确定按钮
#验证所有数据都正确的情况下是否添加成功
def test_Createfloor2(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.assert_elem_true(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.assert_mark_msg(companyadmin.COMPANYADMIN_XTPZ_LCGL_NAME, test_data.FLOOR_MANAGEMENT_TEXT)
goto.goto_floor(self.object)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
......@@ -50,9 +47,7 @@ class Login(unittest.TestCase):
#验证没有输入楼层时的提示信息是否正确
def test_CreateFloor3(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.assert_elem_true(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.assert_mark_msg(companyadmin.COMPANYADMIN_XTPZ_LCGL_NAME, test_data.FLOOR_MANAGEMENT_TEXT)
goto.goto_floor(self.object)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
......@@ -61,9 +56,7 @@ class Login(unittest.TestCase):
#验证没有选择园区和楼宇时的提示信息是否正确
def test_CreateFloor4(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.assert_elem_true(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.assert_mark_msg(companyadmin.COMPANYADMIN_XTPZ_LCGL_NAME, test_data.FLOOR_MANAGEMENT_TEXT)
goto.goto_floor(self.object)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
......@@ -72,9 +65,7 @@ class Login(unittest.TestCase):
self.object.assert_mark_msg(xtpz_lcgl.NULL_FLOOR_WARNING, test_data.AREA_NULL)
#验证没有选择楼宇时的提示信息是否正确
def test_CreateFloor5(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.assert_elem_true(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.assert_mark_msg(companyadmin.COMPANYADMIN_XTPZ_LCGL_NAME, test_data.FLOOR_MANAGEMENT_TEXT)
goto.goto_floor(self.object)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
......@@ -86,8 +77,7 @@ class Login(unittest.TestCase):
self.object.assert_mark_msg(xtpz_lcgl.NULL_FLOOR_WARNING, test_data.BUILDING_NULL)
#验证输入的楼层等于50个字符
def test_CreateFloor6(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
goto.goto_floor(self.object)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
self.object.sendkeys_to_element(xtpz_lcgl.ADDBUILD_FLOOR, 'a1234567891234567891234567891234567891234567891234', By.CSS_SELECTOR)
......@@ -98,8 +88,7 @@ class Login(unittest.TestCase):
self.object.assert_mark_msg(xtpz_lcgl.NULL_FLOOR_WARNING, test_data.BUILDING_NULL)
#验证输入的楼层大于50个字符
def test_CreateFloor7(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
goto.goto_floor(self.object)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
self.object.sendkeys_to_element(xtpz_lcgl.ADDBUILD_FLOOR, 'a12345678912345678912345678912345678912345678912345', By.CSS_SELECTOR)
......@@ -111,9 +100,7 @@ class Login(unittest.TestCase):
#验证输入正常数据后点击取消是否正常
def test_CreateFloor8(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.assert_elem_true(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.assert_mark_msg(companyadmin.COMPANYADMIN_XTPZ_LCGL_NAME, test_data.FLOOR_MANAGEMENT_TEXT)
goto.goto_floor(self.object)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_LCGL)
self.object.click_element(xtpz_lcgl.ADDBUILD)
self.object.click_element(xtpz_lcgl.ADDBUILD_FLOOR, By.CSS_SELECTOR)
......
......@@ -7,6 +7,7 @@ from src.datalib import test_data
from src.elementlib import xtpz_qygl
from src.elementlib import companyadmin
from selenium.webdriver.common.by import By
from src.module import goto
class CreateArea(unittest.TestCase):
......@@ -14,11 +15,9 @@ class CreateArea(unittest.TestCase):
self.object = web_client.WebClient(test_data.MANAGE_URL)
deal_db_data.clear_area()
login_swp.login01(self.object, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW)
goto.goto_area(self.object)
def test_create_area(self):
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ)
self.object.click_element(companyadmin.COMPANYADMIN_XTPZ_QYGL)
self.object.click_element(xtpz_qygl.ADDAREA,By.CSS_SELECTOR)
self.object.sendkeys_to_element(xtpz_qygl.ADDAREA_AREA, 'Z',By.CSS_SELECTOR)
self.object.click_element(xtpz_qygl.ADDAREA_PARK,By.CSS_SELECTOR)
......
......@@ -7,6 +7,7 @@ from src.common import web_client
from src.module import deal_db_data
from src.elementlib import companyadmin
from selenium.webdriver.common.by import By
from src.module import goto
class CreateDepartment(unittest.TestCase):
......@@ -17,9 +18,7 @@ class CreateDepartment(unittest.TestCase):
deal_db_data.clear_department()
self.browser = web_client.WebClient(test_data.MANAGE_URL)
login_swp.login01(self.browser,test_data.COMPANYADMIN_NAME,test_data.COMPANYADMIN_PW)#登录
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_BMGL)#点击“工位管理”下的“部门管理”
self.browser.assert_mark_msg(xtpz_bmgl.DEPARTMENT_MANAGEMENT_PAGE_TITLE, test_data.DEPARTMENT_MANAGEMENT_TEXT)#断言页面中的文本:部门管理
goto.goto_department(self.browser)
'''
author:曹英群
......
......@@ -5,6 +5,7 @@ from src.datalib import test_data
from src.elementlib import companyadmin,xtpz_yhxx
from src.module import login_swp,edit_user,deal_db_data
from selenium.webdriver.common.by import By
from src.module import goto
class CreateUser(unittest.TestCase):
......@@ -12,11 +13,9 @@ class CreateUser(unittest.TestCase):
self.browser = web_client.WebClient(test_data.MANAGE_URL)
deal_db_data.clear_user()
login_swp.login01(self.browser, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW)#登陆
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_YHXX)#点击“工位管理”下的“用户信息”
self.browser.assert_mark_msg(xtpz_yhxx.PAGE_TITLE, test_data.USER_INFORMATION_TEXT)#断言页面中的文本“用户信息”
goto.goto_user(self.browser)
'''
author:曹英群
createtime:2017.08.24
......
......@@ -5,6 +5,7 @@ from src.datalib import test_data
from src.module import login_swp,edit_user_role,deal_db_data
from src.elementlib import companyadmin,xtpz_jsgl
from selenium.webdriver.common.by import By
from src.module import goto
class CreateRole(unittest.TestCase):
......@@ -16,7 +17,7 @@ class CreateRole(unittest.TestCase):
deal_db_data.clear_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)
'''
author:曹英群
......@@ -26,8 +27,7 @@ class CreateRole(unittest.TestCase):
只编辑三项必填项
'''
def test_create_role_001(self):
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)#点击“工位管理”下的“角色管理”
goto.goto_role(self.browser)
#“角色名称”文本框的默认文本为:角色名称不允许为空
self.browser.assert_attribute_msg(xtpz_jsgl.ROLE_NAME_INPUT, test_data.ATTRIBUTE_PLACEHOLDER, test_data.ATTRIBUTE_PLACEHOLDER_TEXT_ROLE_NAME, By.CSS_SELECTOR)
self.browser.assert_mark_msg(xtpz_jsgl.DEPARTMENT_DROPDOWN_LIST, test_data.PLEASE_SELECT_TEXT, By.CSS_SELECTOR)#“部门”的默认文本为:请选择
......@@ -50,8 +50,7 @@ class CreateRole(unittest.TestCase):
必填项校验
'''
def test_create_role_002(self):
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)#点击“工位管理”下的“角色管理”
goto.goto_role(self.browser)
self.browser.click_element(xtpz_jsgl.ADD_BTN)#点击“新增”按钮
self.browser.assert_mark_msg(xtpz_jsgl.DYNAMIC_WARNING_MSG, test_data.EMPTY_ROLE_NAME_MSG)#检查出现动态提示信息:角色名称不允许为空
role_name = "一般用户"
......@@ -77,8 +76,7 @@ class CreateRole(unittest.TestCase):
2.“重置”按钮
'''
def test_create_role_003(self):
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)#点击“工位管理”下的“角色管理”
goto.goto_role(self.browser)
#编辑角色信息项
role_name = "普通用户"
edit_user_role.edit_user_role(self.browser, xtpz_jsgl.ROLE_NAME_INPUT, role_name,\
......@@ -104,8 +102,7 @@ class CreateRole(unittest.TestCase):
'''
def test_create_role_004(self):
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击“侧边栏”中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)#点击“工位管理”下的“角色管理”
goto.goto_role(self.browser)
#编辑角色信息项
role_name = "角色名称aaskdRksdk~!@#$%^&**4565<>?.|{}——))j"
edit_user_role.edit_user_role(self.browser, xtpz_jsgl.ROLE_NAME_INPUT, role_name,\
......@@ -153,8 +150,7 @@ class CreateRole(unittest.TestCase):
('8882','{di}','零壹广场B座','0','{pi}'),('8883','{di}','零壹广场C座','0','{pi}'),('8884','{di}','零壹广场D座','0','{pi}'),('8885','{di}','零壹广场E座','0','{pi}');
'''.format(di = test_data.COMPANY_ID, pi = test_data.PRE_PARK_ID)
deal_db_data.execute_sql(insert_building)
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ)#点击侧边栏中的“工位管理”
self.browser.click_element(companyadmin.COMPANYADMIN_XTPZ_JSGL)#点击“工位管理”下的“角色管理”
goto.goto_role(self.browser)
#编辑角色信息项
role_name = 'Special User'
edit_user_role.edit_user_role(self.browser, xtpz_jsgl.ROLE_NAME_INPUT, role_name,\
......
......@@ -6,6 +6,7 @@ from src.module import login_swp,deal_db_data
from src.elementlib import companyadmin,xtpz_gzrgl
import time
from selenium.webdriver.common.by import By
from src.module import goto
class CreateWorkdayAndVacation(unittest.TestCase):
def setUp(self):
......
......@@ -5,10 +5,7 @@ from src.datalib import test_data
from src.module import login_swp,upload_file
from src.elementlib import companyadmin,gwwh_gwdt
from selenium.webdriver.common.by import By
from src.module import goto
class UploadingStationMap(unittest.TestCase):
......
......@@ -5,7 +5,7 @@ from src.module import edit_station,login_swp,deal_db_data
from src.datalib import test_data
from src.elementlib import companyadmin,gwwh_gwxx
from selenium.webdriver.common.by import By
from src.module import goto
class CreateStation(unittest.TestCase):
......
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