def setUpClass(cls): browser = BrowserEngine(cls) driver = browser.open_browser(cls) cls.driver = driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainPage = MainPage(driver) mainPage.click_bdjl()
def test_1_search_by_name(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_type() restype = ResType(driver) num = restype.query_by_name('羽毛球') self.assertEqual(num, '1')
def test1_query(self): driver = self.driver loginPage = LoginPage(driver) loginPage.login('admin', 'admin') mainPage = MainPage(driver) mainPage.click_zdgl() billMpage = BillMPage(driver) billMpage.query_by_month_address('2019-01', '109-0311') billMpage.sleep(5)
def testbatchImport(self): '''账单批量导入''' driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin','admin') mainpage = MainPage(driver) mainpage.click_zdpldr() bbiPage = BillBIPage(driver) filePath = r'C:\Users\Hi\Downloads\20190709144305-账单模板.xls' bbiPage.batchImportBill(filePath)
def testImportDetail(self): '''查看明细''' driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_zdpldr() bbiPage = BillBIPage(driver) failNum = bbiPage.view_detail_and_get_failNum() self.assertEqual(failNum,'0')
def test_modify_restype(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_type() restype = ResType(driver) restype.click_modify_btn() modify_restype = ResTypeModify(driver) modify_restype.modify_res_type('足球','足球2')
def test_1_addDevice(self): '''新增设备''' driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainPage = MainPage(driver) mainPage.click_deviceManage() dmPage = DeviceManagePage(driver) dmPage.addDevice(deviceCode='renxing7294', deviceName='3幢1单元人行相机1', deviceLocation='3幢1单元', imgPath=r'D:\data\t1\timg.jpg')
def test_add_restype(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_type() restype = ResType(driver) restype.click_add_btn() add_restype = ResTypeAdd(driver) add_restype.add_res_type('篮球')
def test_login(self): username = '******' password = '******' driver = self.driver loginPage = LoginPage(driver) loginPage.login(username, password) mainPage = MainPage(driver) loginInfo = mainPage.login_verify() self.assertEqual(loginInfo, username)
def test_query(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin','admin') mainpage = MainPage(driver) #mainpage.sleep(2) mainpage.click_menu_active_m() #mainpage.sleep(5) activepage = ActivePage(driver) activepage.to_frame() activepage.query_operate(titlename='测试') activepage.sleep(1) num = activepage.get_totalCount() self.assertEqual(num,'1')
def test1_add(self): '''新增物业收费标准''' driver = self.driver loginPage = LoginPage(driver) loginPage.login('admin', 'admin') mainPage = MainPage(driver) mainPage.click_wysfbz() billFS = BillFeeStandard(driver) billFS.add_feeStandard(systemName='明珠国际', feeTypeName='水费', content='水费') #billFS.sleep(1) billFS.close_alert() billFS.sleep(2)
def test_add_config_restype(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_type() restype = ResType(driver) restype.click_plus_btn() restype.sleep(1) config_restype = ResTypeConfig(driver) config_restype.add_config('Wifi', '无线网络') message = config_restype.get_opt_message() self.assertEqual(message, '操作成功!') config_restype.sleep(3)
def test_quesyResults(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_jfxxbb() payReportpage = PayReportPage(driver) num = payReportpage.query_and_gettotalnum( custNameOrPhone='15088887777', address='109-1201', startTime='2019-01-01', endTime='2019-02-01') self.assertEqual(num, '4') owner_phone = payReportpage.view_detail() self.assertEqual(owner_phone, '15088887777')
def test_01_addProject(self): """新增项目""" driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainPage = MainPage(driver) mainPage.click_projectManage() pmPage = ProjectManagePage(driver) projectCode = 'QJY' projectName = '曲江印' provinceName = '陕西' cityName = '西安' districtName = '西安' addrDetail = '西安市曲江新区南三环以南' projectType = '住宅' acreage = '10000' overview = '曲江印项目以环幕大平层,五星级酒店,甲级写字楼,花园商务城市综合体;12栋环幕大平层,将窗外的繁华街景和优美自然景观揽收眼底,全面吸纳和渗透植物园景观' pmPage.addProject(projectCode, projectName, provinceName, cityName, districtName, addrDetail, projectType, acreage, overview)
def test_add_resource(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_manage() mainpage.sleep(2) resManage = ResManagePage(driver) resManage.click_add_dialog() resMngAddpage = ResMngAddPage(driver) resName = '羽毛球' typeName = '羽毛球' address = '羽毛球' phone = '18667027231' passnum = 3 imgUrl = r'C:\Users\Hi\Desktop\1555319477282.jpg' resDesc = '来一次酣畅淋漓的比赛' validDate = '2019-07-03' expireDate = '2021-07-31' startTime, endTime = '07:00', '18:00' resMngAddpage.add_resource(resName, typeName, address, phone, passnum, imgUrl, resDesc, validDate, expireDate, startTime, endTime)
def test_modify_resource(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_manage() mainpage.sleep(2) resManage = ResManagePage(driver) resManage.click_modify_dialog() modifyRes = ModifyResource(driver) resName = '羽毛球1' #typeName = '羽毛球' address = '羽毛球1' phone = '18667027233' #passnum = 3 imgUrl = r'C:\Users\Hi\Desktop\fGqWeLbnkDlvCFF.jpg' resDesc = '来打羽毛球!' validDate = '2019-07-04' expireDate = '2031-07-31' #startTime, endTime = '07:00', '18:00' modifyRes.modify_resource(resName, address, phone, imgUrl, resDesc, validDate, expireDate) modifyRes.sleep(3)
def test_res_record(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_manage() mainpage.sleep(2) resManage = ResManagePage(driver) resManage.click_record_dialog() recordpage = ResourceBookRecord(driver) num = recordpage.query_by_orderNo('343345') self.assertEqual(num, '0')
def test_res_view(self): driver = self.driver loginpage = LoginPage(driver) loginpage.login('admin', 'admin') mainpage = MainPage(driver) mainpage.click_menu_res_manage() mainpage.sleep(2) resManage = ResManagePage(driver) resManage.click_view_dialog() viewRes = ViewResource(driver) info = viewRes.get_viewInfo() str = ','.join(info) self.assertEqual(str, '羽毛球1,羽毛球')