def test_003_closeRemoteAuth(self): u'''关闭远程认证''' if Support == '√': logger.info(u'参数支持远程认证') login.loginWeb(self) # admin账号登录 self.driver.implicitly_wait(10) remoteauth = Organization_userAuthPage(self.driver, self.url) remoteauth.click_UserManage() time.sleep(0.3) remoteauth.click_userAuth() time.sleep(1) # 关闭web认证 remoteauth.click_remoteAuthC() time.sleep(1) # 断言 提示信息是否有误 status = str( remoteauth.getAttribute_byXpath(remoteauth.remoteAuthCs, 'checked')) self.assertEqual(status, 'true', msg='远程认证关闭出错') print('远程认证关闭') # 免认证选择 全部用户,然后关闭免认证 remoteauth.click_noConfig() time.sleep(1) remoteauth.click_alluser() time.sleep(0.5) remoteauth.click_save() time.sleep(1) remoteauth.click_FreeAuthC() time.sleep(2) # 断言 提示信息是否有误 status2 = str( remoteauth.getAttribute_byXpath(remoteauth.FreeAuthCs, 'checked')) self.assertEqual(status2, 'true', msg='免认证关闭出错') print('免认证关闭') self.driver.quit() # 清空组织架构组 organization_group.import_empty_template(self) # 判断组织架构是否有其他组 有则清空 print('删除组织架构组 完成') elif Support == '×': logger.info(u'参数不支持远程认证') logger.info('test_003_closeRemoteAuth passed')
def test_003_FreeAuthAll(self): u'''免认证 - 所有用户''' time.sleep(2) freeauth = Organization_userAuthPage(self.driver, self.url) freeauth.click_noConfig() time.sleep(1) freeauth.click_alluser() time.sleep(0.5) freeauth.click_save() time.sleep(5) # 打开网页验证 断言 self.driver.get('http://www.baidu.com') time.sleep(2) title1 = self.driver.title # print(title1) self.assertEqual(title1, '百度一下,你就知道', msg='免认证 组织架构 出错') self.driver.quit() logger.info('test_003_FreeAuthAll passed')