本文整理汇总了Python中common_suite_file.CommonSuiteData.use_new_user_login方法的典型用法代码示例。如果您正苦于以下问题:Python CommonSuiteData.use_new_user_login方法的具体用法?Python CommonSuiteData.use_new_user_login怎么用?Python CommonSuiteData.use_new_user_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_suite_file.CommonSuiteData
的用法示例。
在下文中一共展示了CommonSuiteData.use_new_user_login方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testAccapproval
# 需要导入模块: from common_suite_file import CommonSuiteData [as 别名]
# 或者: from common_suite_file.CommonSuiteData import use_new_user_login [as 别名]
class testAccapproval(object):
def __init__(self, driver):
self.driver = driver
self.log = log()
self.data = dataFileName()
self.cmf = commonFun(driver)
self.acproval = Accapproval(driver)
self.comsuit = CommonSuiteData(self.driver)
self.loginElem = loginPage(self.driver)
self.authElem = AuthorizationPage(self.driver)
self.flow = Flowcontrol(self.driver)
u'''获取测试数据
Parameters:
- sheetname:sheet名称
return:表格数据
'''
def get_accapproval_data(self, sheetname):
dataFile = dataFileName()
acpPath = dataFile.get_accapproval_test_data_url()
acpData = dataFile.get_data(acpPath, sheetname)
return acpData
u'''添加访问审批'''
def add_access_approvel_001(self):
#日志开始记录
self.log.log_start("add_access_approvel")
#获取访问审批的数据
acpData = self.get_accapproval_data("add_access_approvel")
for dataRow in range(len(acpData)):
data = acpData[dataRow]
try:
#如果不是第1行,读取数据
if dataRow != 0:
if dataRow == 1:
self.acproval.click_access_approval_button(data[2])
#设置开关状态
self.authElem.set_switch_on()
self.authElem.click_add_approval_level()
self.authElem.click_add_approval(data[3])
#添加审批人
self.authElem.set_select_user_search_button()
self.acproval.check_user(data[4])
self.authElem.set_ok_button()
#设置审批级别中的通过审批人个数
self.acproval.select_approval_num(data[3], data[5])
except Exception as e:
print ("add_access_approvell fail: ") + str(e)
self.log.log_detail(u"添加访问审批成功", True)
#点击保存
self.authElem.approval_save_button()
self.cmf.click_login_msg_button()
#点击返回
self.authElem.approval_back_button()
self.log.log_end("add_access_approvel")
u'''访问审批通过流程控制拒绝审批'''
def access_deny_approvel_002(self):
self.cmf.select_role_by_text(u"运维操作员")
#日志开始记录
self.log.log_start("access_deny_approvel")
#获取访问审批申请的数据
appData = self.get_accapproval_data("access_approvel_sso")
#获取访问审批审批的数据
acpData = self.get_accapproval_data("deny_approvel")
for dataRow in range(len(appData)):
data = appData[dataRow]
try:
#如果不是第1行,读取数据
if dataRow != 0:
self.acproval.send_access_approval_applicant(data)
number = self.acproval.get_new_process_number()
self.loginElem.quit()
self.acproval.approval_by_approver(acpData, number)
except Exception as e:
print ("access_deny_approvel fail: ") + str(e)
self.log.log_end("access_deny_approvel")
u'''访问审批通过流程控制同意审批'''
def access_agree_approvel_003(self):
self.comsuit.use_new_user_login()
#日志开始记录
self.log.log_start("access_agree_approvel")
#获取访问审批申请的数据
appData = self.get_accapproval_data("access_approvel_sso")
#获取访问审批审批的数据
acpData = self.get_accapproval_data("agree_approvel")
for dataRow in range(len(appData)):
data = appData[dataRow]
try:
#如果不是第1行,读取数据
if dataRow != 0:
self.acproval.send_access_approval_applicant(data)
number = self.acproval.get_new_process_number()
#.........这里部分代码省略.........