def test_a(login): driver = login driver = BasePage(driver) driver.click(level1menu, "子系统菜单") if open1menu: driver.click(open1menu, "展开菜单") else: pass driver.click(level2menu, "业务规范设置管理菜单")
class TestRiskRulesApproval(): @allure.story("内控风险规则审批") # 对应用例标题 @pytest.mark.parametrize("rulename, appopinion", NkData.TestRiskRulesApproval) @allure.title("打开内控风险规则审批模块") def test_RiskRulesApproval(self, login, rulename, appopinion): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "内控规则管理流程菜单") self.driver.move(level3menu, "内控风险规则审批模块") self.driver.click(level3menu, "内控风险规则审批模块") with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "内控风险规则审批首页") with allure.step('查询内控规则信息'): # 查询内控规则信息 self.driver.send_keys(rule_name, rulename, '内控风险规则审批首页') self.driver.click(query_button, '内控风险规则审批首页') with allure.step('点击审批'): # 点击审批按钮 try: self.driver.click(button, '内控风险规则审批首页') except: self.driver.click(button1, '内控风险规则审批首页') # 点击审批按钮--软集 # button = self.driver.find_elements(By.XPATH, '//button[@type="button"and@title="审批"]')[0] # self.driver.execute_script("arguments[0].click();", button) with allure.step('填写审批结果'): # 点击审批结果 self.driver.click(app_result, "审批界面") # 选择审批结果 self.driver.click(app_result_list, "审批界面") # 输入审批意见 self.driver.send_keys(app_opinion, appopinion, "审批界面") with allure.step('保存审批结果'): # 点击审批 self.driver.click(approval_button, "审批界面") with allure.step('获取提示结果信息'): # 获取提示结果继续操作 result1 = self.driver.text(txt1, '内控风险规则审批首页') assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, '内控风险规则审批首页')
class TestRiskControlParameters(): @allure.story("内控参数设置维护") # 对应allure报告用例标题 # pytest参数化数据信息 @pytest.mark.parametrize('rulename, paracode, paraname, paraval, paradesc', NkData.TestRiskControlParameters) @allure.title("内控参数设置") # 对应allure报告 def test_RiskControlParameters(self, login, rulename, paracode, paraname, paraval, paradesc): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.move(level2menu, "内控功能模块管理") # self.driver.click(level2menu, "内控功能模块管理") self.driver.move(level3menu, "受控模块审批模块") self.driver.click(level3menu, "受控模块审批模块") with allure.step('内控弹框点掉'): # 内控弹框点掉 try: js = ( By.XPATH, '//div[@id="app"]/following-sibling::div[@class="el-dialog__wrapper"]//*[text()="我已阅读并知晓"]' ) self.driver.execute_script(js, "内控参数设置首页") except: pass with allure.step('转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "内控参数设置首页") with allure.step('内控弹框点掉'): # 查询受内控规则 self.driver.send_keys(rule_name, rulename, "内控参数设置首页") self.driver.click(query_button, "内控参数设置首页") with allure.step('点击维护'): # 点击维护--自用 try: self.driver.click(information, "内控参数设置首页") except: self.driver.click(information1, "内控参数设置首页") # 点击维护--软集 # maintenance = self.driver.find_elements(By.XPATH, '//button[@title="维护"]/i')[0] # self.driver.execute_script("arguments[0].click();", maintenance) with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "规则参数信息页") with allure.step('内控弹框点掉'): # 输入参数编码 self.driver.send_keys(para_code, paracode, '参数信息') # 输入参数名称 self.driver.send_keys(para_name, paraname, '参数信息') # 点击参数类型 self.driver.click(para_type, '参数信息') # 选择参数类型 self.driver.click(para_type_list, '参数信息') # 输入参数值 self.driver.send_keys(para_val, paraval, '参数信息') # 输入参数描述 self.driver.send_keys(para_desc, paradesc, '参数信息') with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, '参数信息') with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result1 = self.driver.text(txt1, "规则参数信息页") assert "成功" in result1 with allure.step('内控弹框点掉'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "内控参数设置首页")
class TestArchivesStandardMaintenance(): @allure.story("档案规范维护模块新增") # 对应用例标题 @pytest.mark.parametrize("mattname, filename, filecnt, filedescribe", NkData.TestArchivesStandardMaintenance) @allure.title("打开档案规范维护模块") def test_ArchivesStandardMaintenance(self, login, mattname, filename, filecnt, filedescribe): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "档案规范维护模块") self.driver.click(level3menu, "档案规范维护模块") with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "档案规范维护首页") with allure.step('查询服务事项信息'): # 查询服务事项信息 self.driver.send_keys(matt_name, mattname, "档案规范维护首页") self.driver.click(query_button, "档案规范维护首页") with allure.step('点击编辑'): # 点击编辑 try: self.driver.click(information, "档案规范维护首页") except: self.driver.click(information1, "档案规范维护首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "服务事项环节档案规范信息表") # 输入档案材料名称 self.driver.send_keys(file_name, filename, "服务事项环节档案规范信息表") # 输入档案材料数量 self.driver.send_keys(file_cnt, filecnt, "服务事项环节档案规范信息表") # 输入档案材料说明 self.driver.send_keys(file_describe, filedescribe, "服务事项环节档案规范信息表") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "服务事项环节档案规范信息表") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "服务事项环节档案规范信息表") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "档案规范维护首页")
class TestRiskRulesInvalid(): @allure.story("内控风险规则作废") # 对应用例标题 @pytest.mark.parametrize("rulename, Invalidreason", NkData.TestRiskRulesInvalid) @allure.title("打开内控风险规则作废模块") def test_RiskRulesInvalid(self, login, rulename, Invalidreason): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "内控规则管理流程菜单") self.driver.move(level3menu, "内控风险规则作废模块") self.driver.click(level3menu, "内控风险规则作废模块") with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "内控风险规则作废首页") with allure.step('查询信息'): # 查询子系统信息 self.driver.send_keys(rule_name, rulename, "内控风险规则作废首页") self.driver.click(query_button, "内控风险规则作废首页") with allure.step('点击作废'): # 点击作废按钮--自用 try: self.driver.click(Invalid_button, "内控风险规则作废首页") except: self.driver.click(Invalid_button1, "内控风险规则作废首页") # 点击审批按钮--软集 # Invalid_button = self.driver.find_elements(By.XPATH, '//button[@type="button"and@title="作废"]')[0] # self.driver.execute_script("arguments[0].click();", Invalid_button) with allure.step('输入作废原因'): # 输入作废原因 self.driver.send_keys(Invalid_reason, Invalidreason, '作废界面') with allure.step('保存结果'): # 点击关闭 self.driver.click(close_button, '作废界面') # with allure.step('获取提示结果继续操作'): # # 获取提示结果继续操作 # result1 = self.driver.text(txt1, "内控风险规则作废首页") # assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "内控风险规则作废首页")
class TestItemEventMaintenance(): @allure.story("事项事件维护模块新增") # 对应用例标题 @pytest.mark.parametrize("mattname, evtno, evtname, evtdescribe", NkData.TestItemEventMaintenance) @allure.title("打开事项事件维护模块") def test_ItemEventMaintenance(self, login, mattname, evtno, evtname, evtdescribe): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): self.driver.click(level1menu, "子系统菜单") if open1menu: self.driver.click(open1menu, "展开菜单") else: pass self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "事项事件维护模块") self.driver.click(level3menu, "事项事件维护模块") # with allure.step('内控弹框点掉'): # 内控弹框点掉 # try: # js = 'document.querySelector' \ # '("body > div.el-dialog__wrapper > div > div.el-dialog__body > div.confirm-button").click();' # self.driver.execute_script(js) # self.logger.info('点击内控弹框') # except: # self.logger.info('没有内控弹框') with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "事项事件维护首页") with allure.step('查询并选择服务事项'): # 查询服务事项信息 self.driver.send_keys(matt_name, mattname, '事项事件维护首页') self.driver.click(query_button, '事项事件维护首页') # 选择查询服务事项信息 try: self.driver.click(information, '事项事件维护首页') except: self.driver.click(information1, '事项事件维护首页') # 选择查询服务事项信息--软集 # radio = self.driver.find_elements(By.XPATH, '//input[@type="radio"and@class="el-radio__original"]')[0] # self.driver.execute_script("arguments[0].click();", radio) with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, '事项事件维护首页') with allure.step('输入信息'): # 输入事件编号 self.driver.send_keys(evt_no, evtno, "服务事项事件信息表") # 输入事件名称 self.driver.send_keys(evt_name, evtname, "服务事项事件信息表") # 输入事件描述 self.driver.send_keys(evt_describe, evtdescribe, "服务事项事件信息表") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "服务事项事件信息表") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "事项事件维护首页") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "事项事件维护首页")
class TestPolicyInformationMaintenance(): @allure.story("政策信息维护模块新增") # 对应用例标题 @pytest.mark.parametrize( "polno, yeardata, indxdata, ttldata, reguldata, pfzdata, sbjwdata, regulcontdata", NkData.TestPolicyInformationMaintenance) @allure.title("打开政策信息维护模块") def test_PolicyInformationMaintenance(self, login, polno, yeardata, indxdata, ttldata, reguldata, pfzdata, sbjwdata, regulcontdata): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "政策信息维护模块") self.driver.click(level3menu, "政策信息维护模块") # with allure.step('内控弹框点掉'): # 内控弹框点掉 # try: # js = 'document.querySelector' \ # '("body > div.el-dialog__wrapper > div > div.el-dialog__body > div.confirm-button").click();' # self.driver.execute_script(js) # self.logger.info('点击内控弹框') # except: # self.logger.info('没有内控弹框') with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "政策信息维护首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "政策信息维护首页") with allure.step('输入信息'): # 输入政策法规编号 self.driver.send_keys(pol_no, polno, "政策法规信息表") # 输入年份 self.driver.send_keys(year, yeardata, "政策法规信息表") self.driver.send_keys(year, Keys.ENTER, "政策法规信息表") # 输入索引号 self.driver.send_keys(indx, indxdata, "政策法规信息表") # # 输入发布日期 # rls_date = (By.XPATH, '//label[@for="rlsDate"]/..//input') # self.driver.send_keys(rls_date, "2020-05-01", "政策法规信息表") # 输入标题 self.driver.send_keys(ttl, ttldata, "政策法规信息表") # 输入政策法规来源 self.driver.send_keys(regulations_sources, reguldata, "政策法规信息表") # 输入发文字号 self.driver.send_keys(post_fonts_z, pfzdata, "政策法规信息表") # 输入主题词 self.driver.send_keys(sbjwd, sbjwdata, "政策法规信息表") # 输入法规摘要 self.driver.send_keys(regulations_cont, regulcontdata, "政策法规信息表") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "政策法规信息表") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "政策信息维护首页") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "政策信息维护首页")
class TestEventMaintenance: @allure.story("业务环节维护模块维护") # 对应用例标题 @pytest.mark.parametrize( 'mattname,mattnodeno,mattnodename,opttimelmt,suscnt,taskcnt,nodedsc', NkData.TestEventMaintenance) @allure.title("业务环节维护模块新增") def test_EventMaintenance(self, login, mattname, mattnodeno, mattnodename, opttimelmt, suscnt, taskcnt, nodedsc): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "业务环节维护模块") self.driver.click(level3menu, "业务环节维护模块") with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "业务环节维护首页") with allure.step('查询并选择服务事项'): # 查询服务事项名称 self.driver.send_keys(matt_name, mattname, "业务环节维护首页") self.driver.click(query_button, "业务环节维护首页") # 选择服务事项信息 try: self.driver.click(information, "业务环节维护首页") except: self.driver.click(information1, "业务环节维护首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "业务环节维护首页") with allure.step('输入信息'): # 输入服务事项环节编号 self.driver.send_keys(matt_node_no, mattnodeno, "服务事项环节信息表界面页") # 输入服务事项环节名称 self.driver.send_keys(matt_node_name, mattnodename, "服务事项环节信息表界面页") # 点击经办时限 self.driver.send_keys(opt_time_lmt, opttimelmt, "服务事项环节信息表界面页") # 输入每月要求处理疑点数量 self.driver.send_keys(sus_cnt, suscnt, "服务事项环节信息表界面页") # 输入每月要求处理任务数量 self.driver.send_keys(task_cnt, taskcnt, "服务事项环节信息表界面页") # 输入服务事项环节说明 self.driver.send_keys(node_dsc, nodedsc, "服务事项环节信息表界面页") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "服务事项环节信息表界面页") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "业务环节维护首页") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "业务环节维护首页")
class TestControlledModuleEffective(): @allure.story("受控模块生效申请维护") # 对应allure报告用例标题 # pytest参数化数据信息 @pytest.mark.parametrize('menuname, applydesc', NkData.TestControlledModuleEffective) @allure.title("受控模块生效申请") # 对应allure报告 def test_ControlledModuleEffective(self, login, menuname, applydesc): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.move(level2menu, "内控功能模块管理") # self.driver.click(level2menu, "受控模块登记模块") self.driver.move(level3menu, "受控模块登记模块") self.driver.click(level3menu, "受控模块登记模块") with allure.step('转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "受控模块生效申请首页") with allure.step('查询信息'): # 查询子系统信息 self.driver.send_keys(menu_name, menuname, "受控模块生效申请首页") self.driver.click(query_button, "受控模块生效申请首页") with allure.step('点击提交申请'): # 点击提交申请 try: self.driver.click(information, "受控模块生效申请首页") except: self.driver.click(information1, "受控模块生效申请首页") # 点击提交申请--软集 # submit = self.driver.find_elements(By.XPATH, '//button[@title="提交申请"]/i')[0] # self.driver.execute_script("arguments[0].click();", title) with allure.step('输入申请原因'): # 输入申请原因 self.driver.send_keys(apply_describe, applydesc, "生效申请信息页") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "生效申请信息页") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result1 = self.driver.text(txt1, "受控模块生效申请首页") assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "受控模块生效申请首页")
class TestControlledModuleApproval(): @allure.story("受控模块审批") # 对应allure报告用例标题 # pytest参数化数据信息 @pytest.mark.parametrize('skname, approvalopinion', NkData.TestControlledModuleApproval) @allure.title("受控模块审批") # 对应allure报告 def test_ControlledModuleApproval(self, login, skname, approvalopinion): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.move(level2menu, "内控功能模块管理") # self.driver.click(level2menu, "内控功能模块管理") self.driver.move(level3menu, "受控模块审批模块") self.driver.click(level3menu, "受控模块审批模块") with allure.step('转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "受控模块审批首页") with allure.step('查询信息'): # 查询受控模块信息 self.driver.send_keys(name, skname, "受控模块审批首页") self.driver.click(query_button, "受控模块审批首页") with allure.step('点击审批'): # 点击审批 try: self.driver.click(information, "受控模块审批首页") except: self.driver.click(information1, "受控模块审批首页") # 点击审批--软集 # approval = self.driver.find_elements(By.XPATH, '//button[@title="审批"]/i')[0] # self.driver.execute_script("arguments[0].click();", approval) with allure.step('输入审批结果'): # 点击审批结果 self.driver.click(apply_result, "审批信息页") # 选择审批结果 self.driver.click(apply_result_list, "审批信息页") # 输入审批意见 self.driver.send_keys(approval_opinion, approvalopinion, "审批信息页") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "审批信息页") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result1 = self.driver.text(txt1, "审批信息页") assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "审批信息页")
class TestEventRuleMaintenance(): @allure.story("业务环节经办规则维护") # 对应用例标题 @pytest.mark.parametrize("mattname, chkrulename, chkrulenode", NkData.TestEventRuleMaintenance) @allure.title("业务环节经办规则维护模块新增") def test_EventRuleMaintenance(self, login, mattname, chkrulename, chkrulenode): driver = login self.driver = BasePage(driver) with allure.step("打开菜单"): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "业务环节经办规则维护模块") self.driver.click(level3menu, "业务环节经办规则维护模块") # 内控弹框点掉 # try: # js = 'document.querySelector' \ # '("body > div.el-dialog__wrapper > div > div.el-dialog__body > div.confirm-button").click();' # self.driver.execute_script(js) # self.logger.info('点击内控弹框') # except: # self.logger.info('没有内控弹框') with allure.step("界面使用iframe,转换成iframe进行定位"): self.driver.switch_frame(iframe, "业务环节经办规则维护首页") with allure.step('查询并选择服务事项'): # 查询服务事项名称 self.driver.send_keys(matt_name, mattname, "业务环节经办规则维护首页") self.driver.click(query_button, "业务环节经办规则维护首页") # 选择服务事项信息--自用 try: self.driver.click(information, "业务环节经办规则维护首页") except: self.driver.click(information1, "业务环节经办规则维护首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "业务环节经办规则维护首页") with allure.step('输入信息'): # 输入经办规则编号 # self.driver.send_keys(chk_rule_id, chkruleid, "服务事项环节校验信息表") # 输入经办规则名称 self.driver.send_keys(chk_rule_name, chkrulename, "服务事项环节校验信息表") # 输入经办规则说明 self.driver.send_keys(chk_rule_node, chkrulenode, "服务事项环节校验信息表") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "服务事项环节校验信息表") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "业务环节经办规则维护首页") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "业务环节经办规则维护首页")
class TestServiceMaintenance: @allure.story("服务事项维护") # 对应allure报告用例标题 # pytest参数化数据信息,前5个是模块需要的数据,NkData.TestServiceMaintenance是取NkData.py文件中的TestServiceMaintenance @pytest.mark.parametrize( 'sermattno, sermattname, subsystemname, opttimelmt, sermattdesc', NkData.TestServiceMaintenance) @allure.title("服务事项维护新增") # 对应allure报告title # login是传递登录信息,后边的是@pytest.mark.parametrize的参数数据信息 def test_servicemaintenance(self, login, sermattno, sermattname, subsystemname, opttimelmt, sermattdesc): driver = login # 将登陆后获取的driver传递出来 self.driver = BasePage(driver) # 脚本需要用到 basepage.py中BasePage类的方法, # 故把带有登录信息的driver传递给BasePage在赋值给self.driver with allure.step('打开菜单'): # 对应allure报告中测试步骤,固定写法 self.driver.click(level1menu, "子系统菜单") # 点击菜单self.driver为上述引用固定写法,click为BasePage中方法,括号内为click方法中固定写法 if open1menu: # 如果医保局项目菜单未展开则点击展开 self.driver.click(open1menu, "展开菜单") else: pass self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.click(level3menu, "服务事项维护模块") with allure.step('界面使用iframe,转换成iframe进行定位'): self.driver.switch_frame(iframe, "服务事项维护首页") with allure.step('点击新增'): self.driver.click(add_button, "服务事项维护首页") with allure.step('输入信息'): # 输入服务事项编号 self.driver.send_keys(ser_matt_no, sermattno, "服务事项信息界面页") # 输入服务事项名称 self.driver.send_keys(ser_matt_name, sermattname, "服务事项信息界面页") # 点击子系统编号 self.driver.click(sub_sys_id, "服务事项信息界面页") # 子系统信息界面,输入子系统名称 self.driver.send_keys(sub_system_name, subsystemname, "子系统信息界面页") # 点击查询 self.driver.click(query_button, "子系统信息界面页") # 选择信息 try: self.driver.click(information, "子系统信息界面页") except: self.driver.click(information1, "子系统信息界面页") # 点击确认 self.driver.click(confirm_button, "子系统信息界面页") # 输入经办时限 self.driver.send_keys(opt_time_lmt, opttimelmt, "服务事项信息界面页") # 输入服务事项说明 self.driver.send_keys(ser_matt_desc, sermattdesc, "服务事项信息界面页") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "服务事项信息界面页") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "服务事项维护首页") assert "成功" in result with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "服务事项维护首页")
class TestIncompatibleRoleMaintenance(): @allure.story("不相容角色维护模块新增") # 对应用例标题 @pytest.mark.parametrize("rolename, businname, busin2name, roledesc", NkData.TestIncompatibleRoleMaintenance) @allure.title("打开不相容角色维护模块") def test_IncompatibleRoleMaintenance(self, login, rolename, businname, busin2name, roledesc): driver = login self.driver = BasePage(driver) driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): # self.driver.click(level1menu, "子系统菜单") # if open1menu: # self.driver.click(open1menu, "展开菜单") # else: # pass # self.driver.click(level2menu, "业务规范设置管理菜单") self.driver.move(level3menu, "不相容角色维护模块") self.driver.click(level3menu, "不相容角色维护模块") with allure.step('转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, '不相容角色维护首页') with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, '不相容角色维护首页') with allure.step('输入信息'): # 输入互斥角色规范名称 self.driver.send_keys(role_name, rolename, "互斥规范页面") # 点击角色1编号 self.driver.click(role1_no) # 查询业务角色名称 self.driver.send_keys(business_role_name, businname, '业务角色信息界面') self.driver.click(quer_button, "业务角色信息界面") # 选择业务角色信息 try: self.driver.click(informatio, "业务角色信息界面") except: self.driver.click(informatio1, "业务角色信息界面") # 选择信息--软集 # radio = self.driver.find_elements(By.XPATH, '//input[@type="radio"and@class="el-radio__original"]')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击确定 self.driver.click(confirm_button_1, "业务角色信息界面") # 点击角色2编号 self.driver.click(role2_no, "互斥规范页面") # 查询业务角色2名称 self.driver.send_keys(business_role2_name, busin2name, "业务角色信息界面") self.driver.click(query_button, "业务角色信息界面") # 选择业务角色信息 try: self.driver.click(information, "业务角色信息界面") except: self.driver.click(information1, "业务角色信息界面") # 选择信息--软集 # radio = self.driver.find_elements(By.XPATH, '//input[@type="radio"and@class="el-radio__original"]')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击确定 self.driver.click(confirm_button, "业务角色信息界面") # 输入互斥原因 self.driver.send_keys(role_describe, roledesc, "互斥规范页面") # 点击保存 self.driver.click(save_button, "互斥规范页面") # 获取提示结果继续操作 result = self.driver.text(txt, '不相容角色维护首页') assert "成功" in result # 关闭模块 self.driver.switch_back() self.driver.click(close, '不相容角色维护首页')
class TestRiskControlRules(): @allure.story("内控风险规则登记模块新增") # 对应用例标题 @pytest.mark.parametrize( "mattname, mattnodename, rulecode, rulename, ctrlruledesc, msgContdesc, sermattname", NkData.TestRiskControlRules) @allure.title("打开内控风险规则登记模块") def test_RiskControlRules( self, login, mattname, mattnodename, rulecode, rulename, ctrlruledesc,msgContdesc, sermattname): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): self.driver.click(level1menu, "子系统菜单") if open1menu: self.driver.click(open1menu, "展开菜单") else: pass self.driver.click(level2menu, "内控规则管理流程菜单") self.driver.click(level3menu, "内控风险规则登记模块") with allure.step('界面使用iframe,转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "内控风险规则登记首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "内控风险规则登记首页") with allure.step('输入信息'): # 点击服务事项编号 self.driver.click(matt_no, "维护信息界面") # 查询服务事项信息 self.driver.send_keys(matt_name, mattname, '服务事项信息界面') self.driver.click(risk_querybutton, '服务事项信息界面') # 选择服务事项信息 try: self.driver.click(risk_information, '服务事项信息界面') except: self.driver.click(risk_information1, '服务事项信息界面') # 选择信息--软集 # radio = self.driver.find_elements(By.XPATH, '//input[@type="radio"and@class="el-radio__original"]')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击确定 self.driver.click(confirm_button, '服务事项信息界面') # 点击业务环节编号 self.driver.click(matt_node_no, "维护信息界面") # 查询子系统信息 self.driver.send_keys(matt_node_name, mattnodename, '服务事项环节信息界面') self.driver.click(query_button, '服务事项环节信息界面') # 选择服务事项环节信息 try: self.driver.click(information, '服务事项环节信息界面') except: self.driver.click(information1, '服务事项环节信息界面') # 选择服务事项环节信息--软集 # radio = self.driver.find_elements(By.XPATH, '//input[@type="radio"and@class="el-radio__original"]')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击确定 self.driver.click(confirm_button1, '服务事项环节信息界面') # 输入内控规则编号 self.driver.send_keys(rule_code, rulecode, "维护信息界面") # 输入内控规则名称 self.driver.send_keys(rule_name, rulename, "维护信息界面") # 点击内控程度 self.driver.click(ctrl_degree, "维护信息界面") # 选择内控程度 self.driver.click(ctrl_degree_list, "维护信息界面") # 点击规则类别 self.driver.click(ctrl_rule_type, "维护信息界面") # 选择规则类别 self.driver.click(ctrl_rule_type_list, "维护信息界面") # 输入内控规则描述 self.driver.send_keys(ctrl_rule_describe, ctrlruledesc, "维护信息界面") # 输入消息内容 self.driver.send_keys(msgCont, msgContdesc, "维护信息界面") with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "维护信息界面") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result = self.driver.text(txt, "内控风险规则登记首页") assert "成功" in result # time.sleep(3) with allure.step('首页界面查询框点击查询'): # 首页界面查询框点击查询 self.driver.send_keys(ser_matt_name, sermattname, "内控风险规则登记首页") self.driver.click(query_button1, "内控风险规则登记首页") with allure.step('点击提交'): # 点击提交 try: self.driver.click(submit, "内控风险规则登记首页") except: self.driver.click(submit1, "内控风险规则登记首页") # 点击提交 # submit = self.driver.find_elements(By.XPATH, '//button[@type="button"and@title="提交"]')[0] # self.driver.execute_script("arguments[0].click();", submit) # 点击确定 self.driver.click(confirm_button2, "内控风险规则登记首页") # 获取提示结果继续操作 result1 = self.driver.text(txt1, "内控风险规则登记首页") assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "内控风险规则登记首页")
class TestControlledModuleRegistration(): @allure.story("受控模块登记模块维护") # 对应allure报告用例标题 # pytest参数化数据信息 @pytest.mark.parametrize('mattnodename, menuname, warncont', NkData.TestControlledModuleRegistration) @allure.title("受控模块登记") # 对应allure报告 def test_ControlledModuleRegistration(self, login, mattnodename, menuname, warncont): driver = login self.driver = BasePage(driver) with allure.step('打开菜单'): self.driver.click(level1menu, "子系统菜单") if open1menu: self.driver.click(open1menu, "展开菜单") else: pass self.driver.move(level2menu, "内控功能模块管理") self.driver.click(level2menu, "内控功能模块管理") self.driver.move(level3menu, "内控功能模块管理") self.driver.click(level3menu, "受控模块登记模块") with allure.step('转换成iframe进行定位'): # 界面使用iframe,转换成iframe进行定位 self.driver.switch_frame(iframe, "受控模块登记模块首页") with allure.step('点击新增'): # 点击新增 self.driver.click(add_button, "受控模块登记模块首页") with allure.step('输入新增信息'): # 点击业务环节名称 self.driver.click(servMattNodeName, "受控模块登记界面") # 查询业务环节名称 self.driver.send_keys(matt_node_name, mattnodename, "服务事项环节选择界面") # 点击查询 self.driver.click(query_button, "服务事项环节选择界面") # 点击选择 try: self.driver.click(information1, "服务事项环节选择界面") except: self.driver.click(information, "服务事项环节选择界面") # 选择业务环节信息--软集 # radio = self.driver.find_elements(By.XPATH, '//button[@title="选择"]/i')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击菜单编码 self.driver.click(menu_no, "受控模块登记界面") # 查询菜单信息 self.driver.send_keys(menu_name, menuname, "菜单选择界面") self.driver.click(menu_query_button, "菜单选择界面") # 选择菜单信息 try: self.driver.click(skmkinf, "菜单选择界面") except: self.driver.click(skmkinf1, "菜单选择界面") # 选择菜单信息--软集 # radio = self.driver.find_elements(By.XPATH, '//button[@title="选择"]/i')[0] # self.driver.execute_script("arguments[0].click();", radio) # 点击事前提醒 self.driver.click(warn, "受控模块登记界面") # 选择是否提醒 self.driver.click(warn_list, "受控模块登记界面") # 输入提醒内容 self.driver.send_keys(warn_cont, warncont, "受控模块登记界面") # 点击事中记录 self.driver.click(rcd, "受控模块登记界面") # 选择是否记录 self.driver.click(rcd_list, "受控模块登记界面") # 选择规则信息 try: self.driver.click(SERVMATinf, "受控模块登记界面") except: self.driver.click(SERVMATinf1, "受控模块登记界面") # 选择规则信息--软集 # checkbox = self.driver.find_elements(By.XPATH, '//input[@type="checkbox"and@class="el-checkbox__inner"]')[0] # self.driver.execute_script("arguments[0].click();", checkbox) with allure.step('点击保存'): # 点击保存 self.driver.click(save_button, "受控模块登记界面") with allure.step('获取提示结果继续操作'): # 获取提示结果继续操作 result1 = self.driver.text(txt1, "受控模块登记模块首页") assert "成功" in result1 with allure.step('关闭模块'): # 关闭模块 self.driver.switch_back() self.driver.click(close, "受控模块登记模块首页")