def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj=Moudle_dataFill_overall_mn_dailyFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass'])
class Test_overall__mn_monthFill_search(unittest.TestCase): """ 酒店月填报-查询功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_mn_monthFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall__mn_monthFill_modify(self): """ 酒店月填报-查询功能验证 """ #点击数据管理 self.naviObj.click_dataManagement() #点击数据填报 self.naviObj.click_dataFill() #点击综合产业 self.naviObj.click_overall() #点击查询 self.naviObj.click_dataFill_overall_search() #点击酒店月填报查询 self.naviObj.click_dataFill_overall_search_hotelMonth() time.sleep(2) self.title = self.mdObj.get_page_title() self.mdObj.assertEqual(self.title, "贵州金元运营监管平台") time.sleep(2) def tearDown(self): self.d.close()
class Test_overall__mn_monthFill(unittest.TestCase): """ 锰系合金月填报-填报功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_mn_monthFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall__mn_monthFill(self): """ 锰系合金日填报-填报功能验证 """ #点击数据管理 self.naviObj.click_dataManagement() #点击数据填报 self.naviObj.click_dataFill() #点击综合产业 self.naviObj.click_overall() #点击填报 self.naviObj.click_dataFill_overall_fill() #点击锰系合金月填报 self.naviObj.click_dataFill_overall_fill_mn_monthFill() #点击组织树中的综合产业 self.mdObj.click_orgTree() #点击锰系合金 self.mdObj.click_mxhj() time.sleep(2) #判断填报是否已提交 self.list = [ self.mdObj.sencondMonth_peopleCost, self.mdObj.sencondMonth_makeCost, self.mdObj.sencondMonth_fullCost ] for i in self.list: if not self.mdObj.get_value(i): self.mdObj.mn_monthFill_input_inTable(22, 22, 22) self.mdObj.click_saveButton() self.pValue = self.mdObj.getValue(i) #验证保存数据是否与输入一致 self.assertEqual(int(self.pValue), 22) self.mdObj.click_saveButton() self.mdObj.click_submitButton() else: print("填报已提交") break time.sleep(2) def tearDown(self): self.d.close()
class Test_overall__mn_monthFill_modify(unittest.TestCase): """ 锰系合金月填报-修改功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_mn_monthFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall__mn_monthFill_modify(self): """ 锰系合金月填报-修改功能验证 """ #点击数据管理 self.naviObj.click_dataManagement() #点击数据填报 self.naviObj.click_dataFill() #点击综合产业 self.naviObj.click_overall() #点击修改 self.naviObj.click_dataFill_overall_modify() #点击锰系合金月填报修改 self.naviObj.click_dataFill_overall_modify_mnMonth() #点击组织树中的综合产业 self.mdObj.click_orgTree() #点击锰系合金 self.mdObj.click_mxhj() time.sleep(2) #验证填报是否可修改 self.valueList = [ self.mdObj.sencondMonth_peopleCost, self.mdObj.sencondMonth_makeCost, self.mdObj.sencondMonth_fullCost ] if self.mdObj.isClickable(self.mdObj.modifyButton): self.mdObj.mn_monthFill_input_inTable(22, 22, 22) self.mdObj.click_modifyButton() elif self.valueList: self.mdObj.shot("填报未审核") print("填报未审核") else: self.mdObj.shot("填报未提交") print("填报未提交") time.sleep(2) def tearDown(self): self.d.close()
class Test_overall_hotel_monthFill(unittest.TestCase): """ 酒店月填报-填报功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_hotel_monthFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall_hotel_dailyFill(self): """ 酒店月填报-填报功能验证 """ # 点击数据管理 self.naviObj.click_dataManagement() # 点击数据填报 self.naviObj.click_dataFill() # 点击综合产业 self.naviObj.click_overall() # 点击填报 self.naviObj.click_dataFill_overall_fill() # 点击酒店月填报 self.naviObj.click_dataFill_overall_fill_hotel_monthFill() time.sleep(2) # 判断填报是否已填写,若未全部填写则填写未填写部分,若全都被填写则填写上一年 for i in range(50): now = datetime.datetime.now() year = datetime.datetime.strftime(now, "%Y") self.mdObj.js_execute(self.mdObj.js) self.mdObj.input_yValue(int(year) - i * 1) self.mdObj.click_search() time.sleep(1) if self.mdObj.isClickable(self.mdObj.saveButton): for e in self.mdObj.eList: if self.mdObj.getAttribute(e, 'readonly') == 'true': self.mdObj.getLogger.info("{},已被填写".format(e)) else: self.mdObj.type(1, e) self.mdObj.getLogger("{},正在填写".format(e)) self.mdObj.click_saveButton() self.mdObj.click_submitButton() break else: continue def tearDown(self): self.d.close()
class Test_overall__mn_dailyFill_modify(unittest.TestCase): """ 锰系合金日填报-修改功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_mn_dailyFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall__mn_dailyFill_modify(self): """ 锰系合金日填报-修改功能验证 """ # 点击数据管理 self.naviObj.click_dataManagement() # 点击数据填报 self.naviObj.click_dataFill() # 点击综合产业 self.naviObj.click_overall() # 点击修改 self.naviObj.click_dataFill_overall_modify() # 点击锰系合金日填报修改 self.naviObj.click_dataFill_overall_modify_mnDaily() # 点击组织树中的综合产业 self.mdObj.click_orgTree() # 点击锰系合金 self.mdObj.click_mxhj() time.sleep(2) # 修改填报 self.listValue = self.mdObj.get_listValue() if self.mdObj.isClickable(self.mdObj.mn_xg): for i in self.mdObj.list: self.mdObj.type(2, i) self.assertEqual(int(self.mdObj.getValue(i)), 2) self.mdObj.click_xg() self.mdObj.getLogger.info("修改成功") elif self.listValue: self.mdObj.getLogger.info("填报未审核,无法修改") else: self.mdObj.getLogger.info("填报未提交,无法修改") time.sleep(2) def tearDown(self): self.d.close()
class Test_overall__mn_dailyFill(unittest.TestCase): """ 锰系合金日填报-填报功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj=Moudle_dataFill_overall_mn_dailyFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall_mn_dailyFill(self): """ 锰系合金日填报-填报功能验证 """ #点击数据管理 self.naviObj.click_dataManagement() #点击数据填报 self.naviObj.click_dataFill() #点击综合产业 self.naviObj.click_overall() #点击填报 self.naviObj.click_dataFill_overall_fill() #点击锰系合金日填报 self.naviObj.click_dataFill_overall_fill_mn_dailyFill() #点击组织树中的综合产业 self.mdObj.click_orgTree() #点击锰系合金 self.mdObj.click_mxhj() time.sleep(2) #输入验证数据 self.mdObj.mn_dailyFill_input_inTable(2,2,3) #判断填报是否已填写 if self.mdObj.isClickable(self.mdObj.mn_bc): self.mdObj.click_bc() self.output = self.mdObj.getValue(self.mdObj.outPut) # 验证已输入数据 self.assertEqual(int(self.output), 2) self.mdObj.click_tj() else: print("填报已提交") time.sleep(2) def tearDown(self): self.d.close()
class Test_overall__mn_dailyFill_verify(unittest.TestCase): """ 锰系合金日填报-审核功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_mn_dailyFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall__mn_dailyFill_verify(self): """ 锰系合金日填报-审核功能验证 """ # 点击数据管理 self.naviObj.click_dataManagement() # 点击数据填报 self.naviObj.click_dataFill() # 点击综合产业 self.naviObj.click_overall() # 点击审核 self.naviObj.click_dataFill_overall_verify() # 点击锰系合金日填报审核 self.naviObj.click_dataFill_overall_mnDaily_fillVerify() # 点击组织树中的综合产业 self.mdObj.click_orgTree() # 点击锰系合金 self.mdObj.click_mxhj() time.sleep(2) # 验证填报是否可审核 self.valueList = self.mdObj.get_listValue() if self.mdObj.isClickable(self.mdObj.mn_sp): self.mdObj.click_sp() elif not self.valueList: self.mdObj.getLogger.info("填报未提交,无法审核") else: self.mdObj.getLogger.info("填报已审核") time.sleep(2) def tearDown(self): self.d.close()
class Test_overall_hotel_monthFill_modify(unittest.TestCase): """ 酒店月填报-修改功能验证 """ def setUp(self): self.d = getDriver() self.d.get(YamlReader().data['global']['corp']['url']) self.login = LoginOutObj(self.d) self.mdObj = Moudle_dataFill_overall_hotel_monthFill(self.d) self.naviObj = NavigateObj(self.d) self.login.Login(YamlReader().data['global']['corp']['user'], YamlReader().data['global']['corp']['pass']) def Test_overall_hotel_monthFill_modify(self): """ 酒店月填报-修改功能验证 """ # 点击数据管理 self.naviObj.click_dataManagement() # 点击数据填报 self.naviObj.click_dataFill() # 点击综合产业 self.naviObj.click_overall() # 点击修改 self.naviObj.click_dataFill_overall_modify() # 点击酒店月成本修改 self.naviObj.click_dataFill_overall_modify_hotelMonth() time.sleep(2) if self.mdObj.isClickable(self.mdObj.modifyButton): self.mdObj.type(111, random.sample(self.mdObj.eList, 1)[0]) #随机修改一个元素值 self.mdObj.click_modifyButton() else: self.mdObj.getLogger.info("填报未填写,无法修改") def tearDown(self): self.d.close()