def test_001_CarStatistic(self): logger.info("开始用例: {0}".format(sys._getframe().f_code.co_name)) self.index = Hunan_pages.Hunan_pages_Statistic(driver) self.index.F5() self.index.statistic_bt_click() self.index.installareadata_area_input(param[5]["area"]) self.index.installareadata_btime_input(param[5]["btime"]) self.index.sleep(2) self.index.installareadata_etime_input(param[5]["etime"]) self.index.installareadata_cartype_click() self.index.installareadata_cartype_check(param[5]["cartype1"]) self.index.installareadata_select_bt_click() self.index.assert_text(text="合计", css="css->tfoot > tr")
def test_001_Areaassessment_mouth(self): logger.info("开始用例: {0}".format(sys._getframe().f_code.co_name)) self.index = Hunan_pages.Hunan_pages_Assessment(driver) self.index.F5() self.index.assessment_bt_click() self.index.sleep(3) self.index.areaassessment_type_choose(param[6]["assessmenttype"]) self.index.areaassessment_area_input(param[6]["area"]) self.index.areaassessment_mouth_time_input(param[6]["btime"]) self.index.areaassessment_cartype_click() self.index.areaassessment_cartype_check(param[6]["cartype1"]) self.index.areaassessment_select_bt_click() self.index.assert_text(text="合计", css="css->tfoot > tr")
def setUpClass(cls): global logger global driver logger = Log() # 实例化浏览器引擎 logger.info( '############################### START ###############################' ) driver = Browser_engine().get_browser() # driver = Browser_engine().get_browser() cls.index = Hunan_pages.Hunan_pages_login(driver) cls.index.max_window() cls.index.open_Hunan(param[1]["url"]) cls.index.username_input(param[1]["username"]) cls.index.password_input(param[1]["password"]) cls.index.click_login()
def test_004_SelectTheCar_Synch(self): """ 根据车牌号查询并同步车辆信息 :return: """ logger.info("开始用例: {0}".format(sys._getframe().f_code.co_name)) self.index = Hunan_pages.Hunan_pages_BaseInfo(driver) self.index.F5() self.index.move_settings() self.index.baseinfo_click() self.index.carinfo_carnum_input(param[1]["carnumber"]) self.index.carinfo_select_bt_click() self.index.assert_text( text=param[1]["carnumber"], css="css->#vehicleManage_tables_table > tbody > tr:nth-child(1)") self.index.carinfo_chooseinfo_click() self.index.carinfo_synch_bt_click_() self.index.carinfo_synch_YES_click() self.index.assert_text( text="同步成功", css="css->.layui-layer-content.layui-layer-padding")
def test_003_SelectTheCar_company(self): """ 查询指定企业车辆基本信息 :return: """ logger.info("开始用例: {0}".format(sys._getframe().f_code.co_name)) self.index = Hunan_pages.Hunan_pages_BaseInfo(driver) self.index.F5() self.index.move_settings() self.index.baseinfo_click() self.index.carinfo_area_input(param[3]["area"]) # 地区 self.index.carinfo_platform_input(param[3]["platform"]) # 接入平台 self.index.carinfo_company_input(param[3]["company"]) # 企业 self.index.carinfo_cartype_click() # self.index.carinfo_cartype_choose(param[1]["cartype1"]) # 类型1 if param[1]["deletecheck"] == "YES": self.index.carinfo_deletcheck_click() self.index.carinfo_carstate_click() self.index.carinfo_carstate_choose(param[3]["carstate"]) self.index.carinfo_select_bt_click() self.index.assert_text( text=param[3]["company"], css="css->#vehicleManage_tables_table > tbody > tr:nth-child(1)")
def tearDownClass(cls): cls.index = Hunan_pages.Hunan_pages_login(driver) cls.index.quit() logger.info( '################################ End ################################' )