def test_001_WEB_login(self): u'''WEB登录:HTTP/HTTPS''' accessStrategy = ManagementPolicyPage(self.driver, self.url) accessStrategy.click_AccessPolicy() time.sleep(1) login_mode1 = accessStrategy.getAttribute_byXpath( accessStrategy.httpwebEns, 'data-control-src') login_mode2 = accessStrategy.getAttribute_byXpath( accessStrategy.httpswebEns, 'data-control-src') self.assertEqual(login_mode1, 'HTTP', msg='模式不为"HTTP"') self.assertEqual(login_mode2, 'HTTPS', msg='模式不为"HTTPs"') self.driver.quit() logger.info('test_001_WEB_login passed')
def test_006_RemoteManagement(self): u'''远程管理''' management = ManagementPolicyPage(self.driver, self.url) management.click_ManagementPolicy() time.sleep(1) management.click_RemoteManagement() time.sleep(0.5) switch = str( management.getAttribute_byXpath(management.httpCs, 'checked')) port = str(management.getAttribute_byName(management.OutPort1, 'value')) self.assertEqual(switch, 'true', msg='远程管理默认关闭 有误') self.assertEqual(port, '8081', msg='远程管理端口 默认不为8081') self.driver.quit() logger.info('test_006_RemoteManagement passed')
def test_004_accesscontrol_Language(self): u'''设备访问控制/WEB语言''' accesscontrol = ManagementPolicyPage(self.driver, self.url) accesscontrol.click_lanAccessControl() time.sleep(1) switch = str( accesscontrol.getAttribute_byXpath( accesscontrol.innerAccessControlCs, 'checked')) self.assertEqual(switch, 'true', msg='内网访问控制默认未关闭') languageA = getAssertText('languageA') language = ManagementPolicyPage(self.driver, self.url) language.click_Language() time.sleep(1) languageText = str(language.getText_byXpath(language.languageText)) self.assertEqual(languageText, languageA, msg='语言 显示字符异常') self.driver.quit() logger.info('test_004_accesscontrol_Language passed')