Ejemplo n.º 1
0
 def setUp(self):
     logger.info('setUp start')
     login.loginWeb(self)  #admin账号登录
     language = ManagementPolicyPage(self.driver, self.url)
     self.driver.implicitly_wait(10)
     #进入系统配置-网管策略-语言选择
     language.click_sysConfig()
     time.sleep(0.5)
     language.click_ManagementPolicy()
     time.sleep(1)
     language.click_Language()
     time.sleep(1)
    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')