Esempio n. 1
0
 def test_002_check_name_null(self):
     u"""name为空(testlink_ID:3171)"""
     log.debug("002")
     tmp = TimePolicyBusiness(self.driver)
     #输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, "", "1", "1", u"该字段不能为空", "h")
     self.assertTrue(result), "check name is null, test fail!"
     print "check name is null, test pass!"
Esempio n. 2
0
 def test_003_check_name_over_max_length(self):
     u"""name字符长度超过32(testlink_ID:3172)"""
     log.debug("003")
     tmp = TimePolicyBusiness(self.driver)
     #输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, data_wireless['long_ssid']+"a",
         "1", "1", u"最多只能有32个字符", "h")
     self.assertTrue(result), "check name is null, test fail!"
     print "check name is null, test pass!"
Esempio n. 3
0
 def test_027_check_timeout_daily_24(self):
     u"""Timeout Type选择Daily,不填入数字(testlink_ID:3193)"""
     log.debug("027")
     tmp = TimePolicyBusiness(self.driver)
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, u"时间策略1", "1", "24",
         u"必须是一个0到23的整数", "h")
     self.assertTrue(result), "check timeout is hourly and input 24, test fail!"
     print "check timeout is hourly and input 24, test pass!"
Esempio n. 4
0
 def test_026_check_timeout_daily_null(self):
     u"""Timeout Type选择Daily,不填入数字(testlink_ID:3192)"""
     log.debug("026")
     tmp = TimePolicyBusiness(self.driver)
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, u"时间策略1", "1", "",
         u"该字段不能为空", "h")
     self.assertTrue(result), "check timeout is hourly and input null, test fail!"
     print "check timeout is hourly and input null, test pass!"
Esempio n. 5
0
 def test_024_check_connection_time_d_invalid(self):
     u"""Connection Time选择m,填入非数字字符(testlink_ID:3190)"""
     log.debug("024")
     tmp = TimePolicyBusiness(self.driver)
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, u"时间策略1", "abc", "1",
         u"必须是一个整数并大于或等于0", "d")
     self.assertTrue(result), "check connection time is invalid, test fail!"
     print "check connection time is invalid, test pass!"
Esempio n. 6
0
 def test_021_check_connection_time_d_100000000(self):
     u"""Connection Time选择m,填入数字100000000(testlink_ID:3188)"""
     log.debug("021")
     tmp = TimePolicyBusiness(self.driver)
     #输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, u"时间策略1",
         "100000000", "1", u"必须是一个整数并小于或等于99999999", "d")
     self.assertTrue(result), "check connection time less 100000000, test fail!"
     print "check connection time less 100000000, test pass!"
Esempio n. 7
0
 def test_020_check_connection_time_d_null(self):
     u"""Connection Time选择m,不填入数字(testlink_ID:3187)"""
     log.debug("020")
     tmp = TimePolicyBusiness(self.driver)
     #输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(0, u"时间策略1",
         "", "1", u"该字段不能为空", "d")
     self.assertTrue(result), "check connection time is null, test fail!"
     print "check connection time is null, test pass!"
Esempio n. 8
0
 def test_007_check_same_name_policy(self):
     u"""添加两条相同name的策略(testlink_ID:3176)"""
     log.debug("007")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, "a", "1", "1", "h")
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(1, "a", "2", "2", u"此时间策略已经存在", "h")
     self.driver.refresh()
     self.driver.implicitly_wait(60)
     time.sleep(10)
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check two same name time policys, test fail!"
     print "check two same name time policys, test pass!"