def check_time_money(self, sign_n, rent_n): d2_sign = date.get_today_month(sign_n) d2_sign = date.get_day_of_d(d2_sign, n=-1) d2_sign = str(d2_sign) d2_rent = date.get_today_month(rent_n) d2_rent = date.get_day_of_d(d2_rent, n=-1) d2_rent = str(d2_rent) sign_end_time = self.pm.read_element_txt_by_ids( self.pc.checkout_sign_end_time, 0) rent_end_time = self.pm.read_element_txt_by_ids( self.pc.checkout_sign_end_time, 1) if d2_sign == sign_end_time and d2_rent == rent_end_time: pass else: self.pm.screen_shot() print '合同到期日,房租到期日错误:', sign_end_time, rent_end_time assert True is False
def judge_start_end_date_6_1(self, date1): date2 = date.get_today_month(3) # 第二期开始时间 date3 = date.get_today_month(3) # 第三期开始时间 d1_end = date.get_day_of_d(date2, n=-1) d1_end = str(d1_end) d2_end = date.get_day_of_d(date3, n=-1) d2_end = str(d2_end) start_date_1 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 0) start_date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 1) end_date_1 = self.pm.read_element_txt_by_ids(self.phs.bill_end_date, 0) end_date_2 = self.pm.read_element_txt_by_ids(self.phs.bill_end_date, 1) if start_date_1 == date1 and end_date_1 == d1_end and start_date_2 == date2 and end_date_2 == d2_end: pass else: self.pm.screen_shot() print '账期日期错误', date1, date2, d1_end, d2_end, start_date_1, start_date_2, end_date_1, end_date_2 assert True is False
def judge_bill_payment_date(self, d1, status_fenqi): # 首期 date_first = self.pm.read_element_txt_by_ids( self.phs.bill_payment_date, 0) # 第一期应收款日 date_1 = self.pm.read_element_txt_by_ids(self.phs.bill_payment_date, 1) print 'd1的类型:', d1, type(d1) print 'date_first的类型:', date_first, type(date_first) print 'date_1的类型:', date_1, type(date_1) if date_first == d1 and date_1 == d1: pass else: self.pm.screen_shot() print '首期收款日期错误:', date_first, '!=', date_1, '!=', d1 assert True is False if status_fenqi == '6_3': # 如果有第2期(6期3月付) self.pm.screenSlide_by_zuobiao(700.0, 1600.0, 700.0, 600.0, 1080, 1920) date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_payment_date, 2) d2 = date.get_today_month(3) d2 = date.get_day_of_d(d2, n=-1) d2 = str(d2) if date_2 == d2: pass else: self.pm.screen_shot() print '第二期日期错误:', date_2, '!=', d2 assert True is False if status_fenqi == '12_6': # 如果有第2期(12期6月付) self.pm.screenSlide_by_zuobiao(700.0, 1600.0, 700.0, 600.0, 1080, 1920) date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_payment_date, 2) d2 = date.get_today_month(6) d2 = date.get_day_of_d(d2, n=-1) d2 = str(d2) if date_2 == d2: pass else: self.pm.screen_shot() print '第二期日期错误:', date_2, '!=', d2 assert True is False
def caiwu_rent_time(self, n): text = self.pm.read_element_txt_by_id(self.po.caiwu_sign_time) text_list = text.split(u'至') date_start = text_list[0] date_end = text_list[1] date1 = date.today() date1 = str(date1) date2 = date.get_today_month(n) date2 = date.get_day_of_d(date2, n=-1) date2 = str(date2) if date1 == date_start and date2 == date_end: pass else: self.pm.screen_shot() print '财务收费确认页面,合同租期错误:', date1, date2, date_start, date_end assert True is False
def judge_start_end_date(self, date1, status_fenqi): if status_fenqi == '1_1': date2 = date.get_today_month(1) date2 = date.get_day_of_d(date2, n=-1) date2 = str(date2) start_date = self.pm.read_element_txt_by_id( self.phs.bill_start_date) end_date = self.pm.read_element_txt_by_id(self.phs.bill_end_date) if start_date == date1 and end_date == date2: pass else: self.pm.screen_shot() print '账期日期错误', date1, date2, start_date, end_date assert True is False if status_fenqi == '6_3': date2 = date.get_today_month(3) # 第二期开始时间 date3 = date.get_today_month(6) # 第三期开始时间 d1_end = date.get_day_of_d(date2, n=-1) d1_end = str(d1_end) d2_end = date.get_day_of_d(date3, n=-1) d2_end = str(d2_end) start_date_1 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 0) start_date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 1) end_date_1 = self.pm.read_element_txt_by_ids( self.phs.bill_end_date, 0) end_date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_end_date, 1) # 修改日期2018-8-01改成2018-08-01 # end_date_2_list = end_date_2.split('-') # end_date_2_list[1] = '0' + end_date_2_list[1] # end_date_2 = '-'.join(end_date_2_list) # end_date_2 = date.modify_date(end_date_2) if start_date_1 == date1 and end_date_1 == d1_end and start_date_2 == date2 and end_date_2 == d2_end: pass else: self.pm.screen_shot() print '账期日期错误', date1, date2, d1_end, d2_end, start_date_1, start_date_2, end_date_1, end_date_2 assert True is False if status_fenqi == '12_6': date2 = date.get_today_month(6) # 第二期开始时间 date3 = date.get_today_month(12) # 第三期开始时间 d1_end = date.get_day_of_d(date2, n=-1) d1_end = str(d1_end) d2_end = date.get_day_of_d(date3, n=-1) d2_end = str(d2_end) start_date_1 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 0) start_date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_start_date, 1) end_date_1 = self.pm.read_element_txt_by_ids( self.phs.bill_end_date, 0) end_date_2 = self.pm.read_element_txt_by_ids( self.phs.bill_end_date, 1) # 修改日期2018-8-01改成2018-08-01 # end_date_2_list = end_date_2.split('-') # end_date_2_list[1] = '0' + end_date_2_list[1] # end_date_2 = '-'.join(end_date_2_list) # end_date_2 = date.modify_date(end_date_2) if start_date_1 == date1 and end_date_1 == d1_end and start_date_2 == date2 and end_date_2 == d2_end: pass else: self.pm.screen_shot() print '账期日期错误', date1, date2, d1_end, d2_end, start_date_1, start_date_2, end_date_1, end_date_2 assert True is False