Commit bec8f038 authored by libin's avatar libin
Browse files

20190725更新了测试报告

parent 448441bb
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
from src.module import deal_db_data
from src.datalib import test_data
'''
预置部门数据
'''
deal_db_data.clear_department()
insert_sql1 = '''INSERT INTO `organization` (domainId,orgFatherId,orgName,orgStatus)
VALUES({di},{fi},'测试部门',0),({di},{fi},'测试部01',0),({di},{fi},'test department',0),({di},{fi},'运维部',0),({di},{fi},'在线教育研发部',0),({di},{fi},'在线教育@',0),({di},{fi},'产品服务部',0),
({di},{fi},'云应用研发部',0),({di},{fi},'人事部',0),({di},{fi},'销售部',0),({di},0,'设计部',{fi}),({di},{fi},'designer department',0);''' \
.format(di=test_data.COMPANY_ID, fi=test_data.PRE_DEPARTMENT_FATHER_ID)
deal_db_data.execute_sql(insert_sql1)
'''
预置用户数据
'''
deal_db_data.clear_user()
insert_sql2 = '''INSERT INTO `userinfo` (attendanceCard,domainId,email,employeeId,employeeName,orgId,PASSWORD,roleId,userFrom,userStatus)
VALUES ('321',{di},'cyq@qq.com','002','cyq',129,'wafer123',98,2,0),
('322',{di},'322@qq.com','003','Frank',129,'wafer123',98,2,0),
('323',{di},'323@qq.com','004','Claire',129,'wafer123',98,2,0),
('324',{di},'324@qq.com','005','Doug@',129,'wafer123',98,2,0),
('325',{di},'325@qq.com','006','Tom',129,'wafer123',98,2,0),
('326',{di},'326@qq.com','007','Zoe',129,'wafer123',98,2,0),
('327',{di},'327@qq.com','008','胡歌',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',98,2,0),
('328',{di},'328@qq.com','009','Marry01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',98,2,0),
('329',{di},'329@qq.com','010','cyq01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',98,2,0),
('330',{di},'330@qq.com','011','Mike',129,'wafer123',98,2,0),
('331',{di},'331@qq.com','012','clair!@#',129,'wafer123',98,2,0),
('332',{di},'332@qq.com','013','胡歌001',129,'wafer123',98,2,0); '''.format(di = test_data.COMPANY_ID)
deal_db_data.execute_sql(insert_sql2)
\ No newline at end of file
#coding:utf-8
from src.datalib import test_data
from src.elementlib import administrator
from src.module import login_swp
import unittest
from src.common import web_client
from selenium.webdriver.common.by import By
class NavigationMemu(unittest.TestCase):
def setUp(self):
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)
'''导航菜单的收缩和展开'''
def test_navigation_menu_shrin_and_expand(self):
self.object.assert_mark_msg(administrator.NAVIGATION_MENU_TEXT, \
test_data.NAVIGATION_MENU_TITLE, By.CSS_SELECTOR) #断言侧边栏默认是展开的
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT,1, By.CSS_SELECTOR)
self.object.click_element(administrator.ADMINISTRATOR_LIST,By.CSS_SELECTOR) #点击“收缩”图标
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT,0, By.CSS_SELECTOR) #断言导航菜单收起来
self.object.click_element(administrator.ADMINISTRATOR_LIST, By.CSS_SELECTOR) #点击“展开”图标
self.object.assert_mark_msg(administrator.NAVIGATION_MENU_TEXT, \
"hahha", By.CSS_SELECTOR) #断言侧边栏默认是展开的
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT,1, By.CSS_SELECTOR)
'''导航菜单的收缩和展开'''
def test_navigation_menu(self):
self.object.assert_mark_msg(administrator.NAVIGATION_MENU_TEXT, \
test_data.NAVIGATION_MENU_TITLE, By.CSS_SELECTOR) # 断言侧边栏默认是展开的
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT, 1, By.CSS_SELECTOR)
self.object.click_element(administrator.ADMINISTRATOR_LIST, By.CSS_SELECTOR) # 点击“收缩”图标
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT, 0, By.CSS_SELECTOR) # 断言导航菜单收起来
self.object.click_element(administrator.ADMINISTRATOR_LIST, By.CSS_SELECTOR) # 点击“展开”图标
self.object.assert_mark_msg(administrator.NAVIGATION_MENU_TEXT, \
"hahha", By.CSS_SELECTOR) # 断言侧边栏默认是展开的
self.object.assert_elem_is_displayed(administrator.NAVIGATION_MENU_TEXT, 1, By.CSS_SELECTOR)
def tearDown(self):
self.imgs = self.object.imgs
self.object.exit_all_browsers()
if __name__ == '__main__':
suite = unittest.main()
\ No newline at end of file
......@@ -78,6 +78,7 @@ class Login(unittest.TestCase):
def tearDown(self):
self.imgs = self.browser.imgs
self.browser.exit_all_browsers()
......
......@@ -27,6 +27,7 @@ class NavigationMemu(unittest.TestCase):
def tearDown(self):
self.imgs = self.object.imgs
self.object.exit_all_browsers()
if __name__ == '__main__':
......
......@@ -51,6 +51,7 @@ class CreatCompany(unittest.TestCase):
def tearDown(self):
self.imgs = self.object.imgs
deal_sql = "delete from `domain` where domainName= '"+test_data.COMPANY_URL_NEW+"' and domainStatus = '0' "
deal_db_data.execute_sql(deal_sql)
self.object.exit_all_browsers()
......
......@@ -130,6 +130,7 @@ class EditCompany(unittest.TestCase):
self.object.assert_mark_msg(administrator.TEXT_URL_LINE_ONE , NEW_COMPANY_URL) # 断言第一行企业域名是否已修改
def tearDown(self):
self.imgs = self.object.imgs
# 删除企业域
deal_sql = "delete from `domain` where domainName like '%qwe%'"
deal_db_data.execute_sql(deal_sql)
......
......@@ -44,6 +44,7 @@ class EditCompany(unittest.TestCase):
self.object.assert_mark_msg(administrator.ASSERT_DELETE_ERROR, test_data.ASSERT_DELETE_ERROR,By.CSS_SELECTOR) # 断言提示信息删除失败
def tearDown(self):
self.imgs = self.object.imgs
self.object.exit_all_browsers()
if __name__ == '__main__':
......
......@@ -88,6 +88,7 @@ class ChangePassword(unittest.TestCase):
def tearDown(self):
self.imgs = self.object.imgs
self.object.exit_all_browsers()
update_sql = "UPDATE `userinfo` u SET u.`passWord`='63319c57312f61f070975263bc8a68b2' WHERE id = 1;" #password=wafer123
deal_db_data.execute_sql(update_sql)
......
......@@ -34,6 +34,7 @@ class PageTurning(unittest.TestCase):
def tearDown(self):
self.imgs = self.object.imgs
self.object.exit_all_browsers()
if __name__ == '__main__':
......
......@@ -20,6 +20,7 @@ class Login(unittest.TestCase):
def tearDown(self):
self.imgs = self.browser.imgs
self.browser.exit_all_browsers()
......
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