Beispiel #1
0
 def test_001_routemode_save_config_file(self):
     """路由模式下保存配置"""
     #首先启用无线网卡
     tmp = ConfigUpdateBusiness(self.driver)
     tmp.wlan_enable(data_basic['wlan_pc'])
     #刷新页面重新登录ap页面
     Lg = LoginBusiness(self.driver)
     Lg.refresh_login_ap()
     #把AP恢复出厂配置
     tmp3 = ConfigUpdateBusiness(self.driver)
     tmp3.restore_AP_factory()
     #重新登录AP
     #调用实例的登录AP的web界面
     Lg.login(data_basic['superUser'], data_basic['super_defalut_pwd'])
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #修改工作模式为路由模式,外网设置static IP模式
     tmp1 = WorkModeBusiness(self.driver)
     tmp1.change_workmode_to_route_WANstaticIP(data_wan['static_IP'],
         data_wan['netmask'], data_wan['gateway'], data_wan['DNS'],
         data_wirless['all_ssid'],"psk2", data_wirless['short_wpa'], "HT20", "auto")
     time.sleep(60)
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #下载配置文件
     tmp.download_config_file()
     #判断配置文件是否下载
     #文件路径
     PATH = os.path.join(os.getcwd(), "bakup.file")
     print(PATH)
     result = os.path.exists(PATH)
     #判断wan口是否是静态IP
     tmp3 = WanSettingsBusiness(self.driver)
     result5 = tmp3.get_wan_way(data_basic['DUT_ip'], data_basic['ssh_user'],
         data_basic['ssh_pwd'])
     self.assertTrue(result)
     self.assertIn("static", result5)
     log.debug("001\t\tpass")
 def test_001_check_routemode_reboot_ap(self):
     """路由模式下在页面上点击重启设备后,验证设备是否重启"""
     #首先启用无线网卡
     tmp = RebootSystemBusiness(self.driver)
     tmp.wlan_enable(data_basic['wlan_pc'])
     #刷新页面重新登录ap页面
     Lg = LoginBusiness(self.driver)
     Lg.refresh_login_ap()
     #把AP恢复出厂配置
     tmp3 = ConfigUpdateBusiness(self.driver)
     tmp3.restore_AP_factory()
     #重新登录AP
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #调用实例的登录AP的web界面
     Lg.login(data_basic['superUser'], data_basic['super_defalut_pwd'])
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #修改工作模式为路由模式,外网设置static IP模式
     tmp1 = WorkModeBusiness(self.driver)
     tmp1.change_workmode_to_route_WANstaticIP(
         data_wan['static_IP'], data_wan['netmask'], data_wan['gateway'],
         data_wan['DNS'], data_wirless['all_ssid'], "psk2",
         data_wirless['short_wpa'], "HT20", "auto")
     time.sleep(60)
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #判断wan口是否是静态IP
     tmp3 = WanSettingsBusiness(self.driver)
     result5 = tmp3.get_wan_way(data_basic['DUT_ip'],
                                data_basic['ssh_user'],
                                data_basic['ssh_pwd'])
     #在页面上点击重启设备后,验证设备是否重启
     result1, result2 = tmp.check_reboot_ap(data_basic['DUT_ip'])
     self.assertIn("static", result5)
     self.assertNotEqual(0, result1)
     self.assertEqual(0, result2)
     log.debug("001\t\tpass")