def test_date_limit_less(self): '''测试日期限制逻辑小于''' qiqiao.Application(self.driver).clickButtonInTitle("添加") qiqiao.Date(self.driver).required("必填_提示", '2019-09-20') qiqiao.Tab(self.driver).clickTab("大于920") qiqiao.Date(self.driver).normal("大于920", "2020-09-10") qiqiao.Tab(self.driver).clickTab("小于920") qiqiao.Date(self.driver).normal("小于920", "2020-09-10") qiqiao.Application(self.driver).clickSubmit() msg = qiqiao.Application(self.driver).getText(Operation().readXml( 'msg', 'prompt')) self.assertEqual(msg, '小于920')
def test_default_tody(self): '''测试日期设置默认值为当天''' qiqiao.Application(self.driver).clickButtonInTitle("添加") qiqiao.Tab(self.driver).clickTab("默认填写当天") value = qiqiao.Date(self.driver).getDefaultValue("默认填写当天") now_time = datetime.datetime.now().strftime('%Y-%m-%d') self.assertEqual(value, now_time)
def test_default_next_three_days(self): '''测试日期设置默认值为当天后三天''' qiqiao.Application(self.driver).clickButtonInTitle("添加") qiqiao.Tab(self.driver).clickTab("默认填写后3天") value = qiqiao.Date(self.driver).getDefaultValue("默认后3天") now_time = datetime.datetime.now() offset = datetime.timedelta(days=+3) re_date = (now_time + offset).strftime('%Y-%m-%d') self.assertEqual(value, re_date)