def test_004_check_name_length_1(self): u"""name字符长度等于1(testlink_ID:3173)""" log.debug("004") tmp = TimePolicyBusiness(self.driver) #按照默认配置,新建一个时间策略 tmp.new_timepolicy_default(0, "a", "1", "1", "h") #判断页面上有新建的时间策略 result = tmp.check_have_timepolicy() tmp.del_all_timepolicy() self.assertTrue(result), "check name's length is 1, test fail!" print "check name's length is 1, test pass!"
def test_023_check_connection_time_d_99999999(self): u"""Connection Time选择m,填入数字1-99999999之间的数字-2(testlink_ID:3189-2)""" log.debug("023") tmp = TimePolicyBusiness(self.driver) #按照默认配置,新建一个时间策略 tmp.new_timepolicy_default(0, u"时间策略1", "99999999", "1", "d") #判断页面上有新建的时间策略 result = tmp.check_have_timepolicy() tmp.del_all_timepolicy() self.assertTrue(result), "check connection time is 99999999, test fail!" print "check connection time is 99999999, test pass!"
def test_009_check_disable_timepolicy(self): u"""Enable不勾选(testlink_ID:3178)""" log.debug("009") tmp = TimePolicyBusiness(self.driver) #编辑一个时间策略,点击Enable tmp.enable_disable_timepolicy(0) #判断页面上是否有Enable图标 result = tmp.check_enbale_timepolicy() tmp.del_all_timepolicy() self.assertFalse(result), "check disable time policy, test fail!" print "check disable time policy, test pass!"
def test_006_check_name_chinese(self): u"""name为特殊字符或汉字(testlink_ID:3175)""" log.debug("006") tmp = TimePolicyBusiness(self.driver) #按照默认配置,新建一个时间策略 tmp.new_timepolicy_default(0, u"时间策略1", "1", "1", "h") #判断页面上有新建的时间策略 result = tmp.check_have_timepolicy() tmp.del_all_timepolicy() self.assertTrue(result), "check name is Chinese, test fail!" print "check name is Chinese, test pass!"
def test_005_check_name_length_32(self): u"""name字符长度等于1(testlink_ID:3174)""" log.debug("005") tmp = TimePolicyBusiness(self.driver) #按照默认配置,新建一个时间策略 tmp.new_timepolicy_default(0, data_wireless['long_ssid'], "1", "1", "h") #判断页面上有新建的时间策略 result = tmp.check_have_timepolicy() tmp.del_all_timepolicy() self.assertTrue(result), "check name's length is 32, test fail!" print "check name's length is 32, test pass!"
def test_025_check_timeout_hourly(self): u"""Timeout Type选择Reset Hourly(testlink_ID:3191)""" log.debug("025") tmp = TimePolicyBusiness(self.driver) #按照默认配置,新建一个时间策略 tmp.new_timepolicy_default(0, u"时间策略1", "1", "1", "h") #编辑一个时间策略,修改客户端重连超时类型为每小时 tmp.change_timeout_hourly(0) result = tmp.get_titlediv() tmp.del_all_timepolicy() self.assertIn(u"每小时", result), "check timeout is hourly, test fail!" print "check timeout is hourly, test pass!"
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!"
def test_045_check_webUI_change_config(self): u"""修改配置之后检查页面信息(testlink_ID:3201)""" log.debug("045") tmp = TimePolicyBusiness(self.driver) #修改客户端重连超时类型为每小时 tmp.change_timeout_hourly(0) #获取页面所有标题 result1 = tmp.get_titlediv() #判断页面上是否有Enable图标 result2 = tmp.check_enbale_timepolicy() #删除所有的时间策略 tmp.del_all_timepolicy() self.assertIn(u"时间策略1", result1) self.assertIn(u"每小时", result1) self.assertTrue(result2), "check time policy webUI after change config, test fail!" print "check time policy webUI after change config, test pass!"