def get_minders(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' %info) limit = info.get('limit', 10) # 每页显示的条数 offset = info.get('offset', 0) # 分片数,(页码-1)*limit,它表示一段数据的起点 log.log().logger.info('get %s' %limit) log.log().logger.info('get offset %s' %offset) id = viewutil.getInfoAttribute(info,'id') module = viewutil.getInfoAttribute(info, 'module') name = viewutil.getInfoAttribute(info, 'name') type = viewutil.getInfoAttribute(info, 'type') log.log().logger.info('module: %s' %module) rows = 100 if id !='': data = test_minder_manage.test_minder_manage().show_test_minders( conditionList=['id'],valueList=[id],rows=rows) if type == 'edit': data1 = jsonify({'code':200,'minder':data[0]}) else: data1 = jsonify({'code': 200, 'content': data[0]['content']}) else: data = test_minder_manage.test_minder_manage().show_test_minders( conditionList=['module','name'],valueList=[module,name],rows=rows) data1 = jsonify({'total': len(data), 'rows': data[int(offset):int(offset) + int(limit)]}) # print(data) log.log().logger.info('data1: %s' %data1) return data1,{'Content-Type': 'application/json'}
def search_test_api(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' % info) limit = info.get('limit', 10) # 每页显示的条数 offset = info.get('offset', 0) # 分片数,(页码-1)*limit,它表示一段数据的起点 log.log().logger.info('get %s' % limit) log.log().logger.info('get offset %s' % offset) type = viewutil.getInfoAttribute(info, 'type') id = viewutil.getInfoAttribute(info, 'id') name = viewutil.getInfoAttribute(info, 'name') product = viewutil.getInfoAttribute(info, 'product') module = viewutil.getInfoAttribute(info, 'module') conditionList = ['id', 'name', 'product', 'module'] valueList = [id, name, product, module] fieldlist = [] rows = 1000 caseList = test_api_new_manange.test_api_new_manange().show_test_api( conditionList, valueList, fieldlist, rows, type=type) log.log().logger.info(caseList) data = caseList data1 = jsonify({ 'total': len(data), 'rows': data[int(offset):int(offset) + int(limit)] }) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def attach_test_batch_to_suite(): log.log().logger.info(request) if request.method == 'POST': log.log().logger.info('post') result = jsonify({'code': 500, 'msg': 'post'}) return result else: log.log().logger.info(request.values) # log.log().logger.info(request.form) info = request.values test_suite_id = viewutil.getInfoAttribute(info,'test_suite_id') ipVal = viewutil.getInfoAttribute(info, 'ipVal') browser_list = viewutil.getInfoAttribute(info, 'browser_list') browser_list = browser_list.split(',') rows = viewutil.getInfoAttribute(info,'datarow') log.log().logger.info("ipVal %s" %ipVal) log.log().logger.info('%s, %s' %(test_suite_id,rows)) rows = rows.split(',') log.log().logger.info(rows) idrows = [] for i in range(1,len(rows)): idrows.append(rows[i]) log.log().logger.info(idrows) ipList = ipVal.split(',') for j in range(len(ipList)): if ipList[j] == '': result0 = test_batch_manage.test_batch_manage().batch_new_testcase(test_suite_id, idrows,browser_type_list=browser_list) else: result0 = test_batch_manage.test_batch_manage().batch_new_testcase_IP(test_suite_id, idrows, ipList[j]) if result0 == 0: result = jsonify({'code': 500, 'msg': 'error, please check selected test cases!'}) else: result = jsonify({'code': 200, 'msg': 'message'}) return result
def save_new_test_suite(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') return render_template("uitest/new_test_suite.html") if request.method == 'POST': info = request.values log.log().logger.info('info :%s' %info) name = viewutil.getInfoAttribute(info,'name') run_type = viewutil.getInfoAttribute(info,'run_type') description = viewutil.getInfoAttribute(info,'description') if run_type == '' or name == '' : message = '必填字段不得为空!' code = 500 else: import random, time batchId = str(random.randint(10000, 99999)) + str(time.time()) test_suite_manage.test_suite_manage().new_test_suite(name, run_type, description, batchId) newId = test_suite_manage.test_suite_manage().show_test_suites(["batchId"], [batchId], ['id'], 1) log.log().logger.info('newid %s' %newId) if len(newId): ext=newId[0]['id'] log.log().logger.info('ext %s' %ext) message = 'success!' code = 200 # return redirect('attach_test_batch?test_suite_id=%s' %ext) else: ext='' message = 'add failed!' code = 500 result = jsonify({'code': code, 'msg': message,'ext':ext}) log.log().logger.info(result) # log.log().logger.info('code is : %s'%result['code']) return result
def edit_test_suite(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info('id: %s' % id) return render_template("uitest/edit_test_suite.html", id=id) if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') name = viewutil.getInfoAttribute(info, 'name') run_type = viewutil.getInfoAttribute(info, 'run_type') description = viewutil.getInfoAttribute(info, 'description') if run_type == '' or name == '': message = '必填字段不得为空!' code = 500 else: test_suite_manage.test_suite_manage().update_test_suite( id, ['name', 'run_type', 'description'], [name, run_type, description]) message = 'success!' code = 200 result = jsonify({'code': code, 'msg': message}) return render_template("uitest/test_suite.html")
def save_new_test_case(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') return render_template("uitest/new_test_cases.html") if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) name = viewutil.getInfoAttribute(info, 'name') module = viewutil.getInfoAttribute(info, 'module') description = viewutil.getInfoAttribute(info, 'description') steps = viewutil.getInfoAttribute(info, 'steps') log.log().logger.info("steps: %s" % steps) steps = steps.replace('"', "'") log.log().logger.info("steps: %s" % steps) type = viewutil.getInfoAttribute(info, 'type') if module == '' or name == '' or steps == '' or type == '': return '必填字段不得为空!' else: if type == '公共用例': isPublic = 1 else: isPublic = 0 test_case_manage.test_case_manage().new_test_case( module, name, steps, description, isPublic) # return render_template("test_cases.html") return redirect('test_cases')
def test_keywords(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' % info) limit = info.get('limit', 10) # 每页显示的条数 offset = info.get('offset', 0) # 分片数,(页码-1)*limit,它表示一段数据的起点 log.log().logger.info('get %s' % limit) log.log().logger.info('get offset %s' % offset) id = viewutil.getInfoAttribute(info, 'id') keyword = viewutil.getInfoAttribute(info, 'keyword') if id == '': conditionList = ['keyword'] valueList = [keyword] else: conditionList = ['id'] valueList = [id] fieldlist = [] rows = 1000 caseList = test_keyword_manage.test_keyword_manage( ).show_test_keywords(conditionList, valueList, fieldlist, rows) log.log().logger.info(caseList) data = caseList data1 = jsonify({'total': len(data), 'rows': data}) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def add_hub(): info = request.values log.log().logger.info('info : %s' % info) host = viewutil.getInfoAttribute(info, 'host') port = viewutil.getInfoAttribute(info, 'port') status = viewutil.getInfoAttribute(info, 'status') hubs.hubs().updateHub(host, port, '0', status) result = jsonify({'code': 200, 'msg': '新增成功'}) return result, {'Content-Type': 'application/json'}
def search_test_cases(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' % info) limit = info.get('limit', 10) # 每页显示的条数 offset = info.get('offset', 0) # 分片数,(页码-1)*limit,它表示一段数据的起点 log.log().logger.info('get %s' % limit) log.log().logger.info('get offset %s' % offset) id = viewutil.getInfoAttribute(info, 'id') module = viewutil.getInfoAttribute(info, 'module') type = viewutil.getInfoAttribute(info, 'type') log.log().logger.info('module: %s' % module) module = module.split(',') log.log().logger.info(module) name = viewutil.getInfoAttribute(info, 'name') conditionList = ['name'] valueList = [name] if type == 'unattach' and 'public' in module: module.remove('public') elif type != 'test_case': if len(module) != 0 and module[0] != 'All' and module[0] != '': conditionList.append('module') valueList.append(module) log.log().logger.info( 'info content: id- %s, module - %s, name - %s, type - %s' % (id, module, name, type)) else: conditionList = ['id'] valueList = [id] log.log().logger.info( 'info content: id- %s, module - %s, name - %s, type - %s' % (id, module, name, type)) # else: fieldlist = [] rows = 1000 if type == 'unattach': caseList = test_case_manage.test_case_manage( ).show_test_cases_unattach(id, conditionList, valueList, fieldlist, rows) else: caseList = test_case_manage.test_case_manage().show_test_cases( conditionList, valueList, fieldlist, rows) log.log().logger.info(caseList) data = caseList if type == 'test_case': data1 = jsonify({'total': len(data), 'rows': data[0]}) else: data1 = jsonify({ 'total': len(data), 'rows': data[int(offset):int(offset) + int(limit)] }) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def view_test_suite_screenshot(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') test_batch_id = viewutil.getInfoAttribute(info, 'test_batch_id') type = viewutil.getInfoAttribute(info, 'type') index = viewutil.getInfoAttribute(info, 'index') if index == '': index = 1 else: index = int(index) + 1 log.log().logger.info('id: %s' % id) log.log().logger.info('test_batch_id: %s' % test_batch_id) data = test_batch_manage.test_batch_manage().show_test_batch( ['id'], [id], ['screenshot'], 1) log.log().logger.info(data) if data[0]['screenshot'] is None: imgUrl0 = [] elif len(data[0]['screenshot']): log.log().logger.info( '%s, %s' % (len(data[0]['screenshot']), data[0]['screenshot'])) imgUrl0 = data[0]['screenshot'].split("'") else: imgUrl0 = [] imgUrl = [] imgTitle = [] for i in range(len(imgUrl0)): if i > 0 and i < len(imgUrl0) - 1 and len(imgUrl0[i]) > 5: imgUrl.append(imgUrl0[i].replace('\\', '/')) imgTitle.append(imgUrl0[i]) log.log().logger.info('%s, %s, %s ' % (imgUrl0[i], len(imgUrl0[i]), i)) if len(imgUrl) == 0: return render_template('uitest/view_test_suite_screenshot.html', imgTitle='no screenshot!', imgCnt=len(imgUrl), id=id, test_batch_id=test_batch_id, type=type) else: log.log().logger.info(imgUrl) index = index % len(imgUrl) return render_template('uitest/view_test_suite_screenshot.html', imgUrl=imgUrl[index], index=index, id=id, imgTitle=imgTitle[index], imgCnt=len(imgUrl), test_batch_id=test_batch_id, type=type)
def save_new_test_keyword(): log.log().logger.info(request) info = request.form log.log().logger.info('info : %s' %info) name = viewutil.getInfoAttribute(info,'name') paraCount = viewutil.getInfoAttribute(info,'paraCount') description = viewutil.getInfoAttribute(info,'description') template = viewutil.getInfoAttribute(info,'template') example = viewutil.getInfoAttribute(info, 'example') result0 = test_keyword_manage.test_keyword_manage().new_test_keyword(name, paraCount, description, template,example) return redirect('/testkeywords')
def search_test_suite(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' % info) limit = info.get('limit', 10) # 每页显示的条数 offset = info.get('offset', 0) # 分片数,(页码-1)*limit,它表示一段数据的起点 log.log().logger.info('get %s' % limit) log.log().logger.info('get offset %s' % offset) id = viewutil.getInfoAttribute(info, 'id') type = viewutil.getInfoAttribute(info, 'type') log.log().logger.info('type %s' % type) run_type = viewutil.getInfoAttribute(info, 'run_type') status = viewutil.getInfoAttribute(info, 'status') name = viewutil.getInfoAttribute(info, 'name') if id == '': if status == 'All': status = '' log.log().logger.info('info content: %s, %s, %s, %s' % (id, status, run_type, name)) conditionList = ['status', 'run_type', 'name'] valueList = [status, run_type, name] else: if type == 'testview': statusList = test_batch_manage.test_batch_manage( ).show_test_batch_status(id) else: statusList = [] log.log().logger.info('info content: %s, %s, %s, %s' % (id, status, run_type, name)) conditionList = ['id'] valueList = [id] fieldlist = [] rows = 1000 caseList = test_suite_manage.test_suite_manage().show_test_suites( conditionList, valueList, fieldlist, rows) log.log().logger.info(caseList) data = caseList if id != '': data1 = jsonify({ 'total': len(data), 'rows': data[0], 'status': statusList }) else: data1 = jsonify({ 'total': len(data), 'rows': data[int(offset):int(offset) + int(limit)] }) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def runtest(): log.log().logger.info(request) if request.method == 'POST': log.log().logger.info('post') result = jsonify({'code': 500, 'msg': 'should be get!'}) return result else: log.log().logger.info(request.values) # log.log().logger.info(request.form) info = request.values id = viewutil.getInfoAttribute(info, 'id') test_case_id = viewutil.getInfoAttribute(info, 'test_case_id') ipVal = viewutil.getInfoAttribute(info, 'ipVal') type = viewutil.getInfoAttribute(info, 'type') if type == 'test_suite': test_suite_manage.test_suite_manage().new_test_run_list(id) result = jsonify({'code': 200, 'msg': 'success!'}) elif type == 'test_suite_rerun_all': ipList = ipVal.split(',') for i in range(len(ipList)): test_suite_manage.test_suite_manage().new_test_run_list(id) if ipList[i] == '': test_batch_manage.test_batch_manage().rerun_test_batch( id, 'all') else: test_batch_manage.test_batch_manage().rerun_test_batch_Ip( id, 'all', ipList[i]) result = jsonify({'code': 200, 'msg': 'success!'}) elif type == 'test_suite_rerun_part': test_suite_manage.test_suite_manage().new_test_run_list(id) test_batch_manage.test_batch_manage().rerun_test_batch(id, 'part') result = jsonify({'code': 200, 'msg': 'success!'}) elif type == 'test_batch': # test_suite_manage.test_suite_manage().new_test_run_list(id) test_batch_manage.test_batch_manage().rerun_test_batch_record( id, test_case_id) result = jsonify({'code': 200, 'msg': 'success!'}) elif type == 'test_case': ipList = ipVal.split(',') for i in range(len(ipList)): if ipList[i] == '': test_batch_manage.test_batch_manage().batch_new_testcase( '0', [id]) else: test_batch_manage.test_batch_manage( ).batch_new_testcase_IP('0', [id], str(ipList[i])) result = jsonify({'code': 200, 'msg': 'success!'}) else: result = jsonify({'code': 500, 'msg': 'type is not defined!'}) return result
def update_test_api_new(): log.log().logger.info(request) if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') name = viewutil.getInfoAttribute(info, 'name') description = viewutil.getInfoAttribute(info, 'description') module = viewutil.getInfoAttribute(info, 'module') product = viewutil.getInfoAttribute(info, 'product') url = viewutil.getInfoAttribute(info, 'url') paras = viewutil.getInfoAttribute(info, 'paras') osign_list = viewutil.getInfoAttribute(info, 'osign_list') result = test_api_new_manange.test_api_new_manange().update_test_api( id, fieldlist=[ 'product', 'module', 'name', 'url', 'paras', 'osign_list', 'description' ], valueList=[ product, module, name, url, paras, osign_list, description ]) if result: data1 = jsonify({'code': 200}) else: data1 = jsonify({'code': 500}) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def copy_test_suite(): log.log().logger.info(request) log.log().logger.info(request.method) # log.log().logger.info(request.value) if request.method == 'GET': log.log().logger.info('post') result = jsonify({'code': 500, 'msg': 'should be get!'}) return result if request.method == 'POST': info = request.form log.log().logger.info('info : %s' %info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info("id: %s" %id) if id=='': result = jsonify({'code': 500, 'msg': 'test suite is not found!'}) else: import random, time batchId = str(random.randint(10000, 99999)) + str(time.time()) test_suite_manage.test_suite_manage().copy_test_suite(id, batchId) newId = test_suite_manage.test_suite_manage().show_test_suites(["batchId"], [batchId], ['id'], 1) log.log().logger.info('newid %s' %newId) if len(newId): ext = newId[0]['id'] log.log().logger.info('ext is: %s, id is: %s' %(ext, id)) if ext !='0': test_batch_manage.test_batch_manage().copy_test_batch(ext, id) message = 'success!' code = 200 result = jsonify({'code': 200, 'msg': 'copy success!'}) else: result = jsonify({'code': 500, 'msg': 'test suite is not found!'}) return result
def test_api_single_test_page(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info(request.values) info = request.values id = viewutil.getInfoAttribute(info, 'id') return render_template('apinew/test_api_case_new_run.html', id=id)
def copy_test_minder(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') return redirect("test_minders") if request.method == 'POST': info = request.values log.log().logger.info('info :%s' %info) id = viewutil.getInfoAttribute(info,'id') print(id) if id == '' : message = '必填字段不得为空!' code = 500 else: result = test_minder_manage.test_minder_manage().copy_test_minder(id) if result['code']: message = 'success!' code = 200 id = result['id'] else: message = 'error!' code = 500 result = jsonify({'code': code, 'msg': message,'id':id}) log.log().logger.info(result) log.log().logger.info('code is : %s'%code) return result,{'Content-Type': 'application/json'}
def copy_test_case(): log.log().logger.info(request) log.log().logger.info(request.method) # log.log().logger.info(request.value) if request.method == 'GET': log.log().logger.info('post') result = jsonify({'code': 500, 'msg': 'should be get!'}) return result if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info(id) if id == '': result = jsonify({'code': 500, 'msg': 'test case is not found!'}) else: result0 = test_case_manage.test_case_manage().copy_test_case(id) if result0: result = jsonify({'code': 200, 'msg': 'copy success!'}) else: result = jsonify({ 'code': 500, 'msg': 'test case is not found!' }) return result
def test_case_runhistory_report2(): REMOTE_HOST = "https://pyecharts.github.io/assets/js" bar = pyecharts.Pie() bar.add("Sports", ["Football", "Basketball", "Baseball", "Tennis", "Swimming"], [23, 34, 45, 56, 67], is_more_utils=True) log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info('id: %s' % id) if len(test_case_manage.test_case_manage().show_test_cases(['id'], [id], [], 2)) == 1: return render_template("uitest/test_batch_result.html", id=id, type='test_case', test_suite_id='', myechart=bar.render_embed(), host=REMOTE_HOST, script_list=bar.get_js_dependencies()) else: return render_template("uitest/test_cases.html") else: return render_template("uitest/test_cases.html")
def test_batch_detail_report(): REMOTE_HOST = "https://pyecharts.github.io/assets/js" bar = pyecharts.Pie() bar.width = 700 bar.height = 400 log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'test_suite_id') log.log().logger.info('id: %s' % id) statusList = test_batch_manage.test_batch_manage( ).show_test_batch_status(id) nameList, valueList = bar.cast(statusList) bar.add("results", ['失败', '待执行', '执行中', '成功'], valueList[0:4], is_more_utils=True, is_area_show=True, is_label_show=True, legend_pos="50%") return render_template("uitest/test_batch_detail_report.html", id=id, myechart=bar.render_embed(), host=REMOTE_HOST, script_list=bar.get_js_dependencies()) # return render_template("uitest/test_batch_report.html", id=id) else: return render_template('test_suite.html')
def add_user(): list = session.get('user', None) info = request.values log.log().logger.info('info : %s' % info) username = viewutil.getInfoAttribute(info, 'username') password = viewutil.getInfoAttribute(info, 'password') log.log().logger.info('password : %s' % password) md5Password = util.util().md5(password) log.log().logger.info('md5Password : %s' % md5Password) result0 = test_user_manage.test_user_manage().new_user( username, md5Password) if result0: result = jsonify({'code': 200, 'msg': '新增成功'}) return result, {'Content-Type': 'application/json'} else: result = jsonify({'code': 500, 'msg': '用户已存在!'}) return result, {'Content-Type': 'application/json'}
def edit_test_case(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info('id: %s' % id) return render_template("uitest/edit_test_cases.html", id=id) if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') name = viewutil.getInfoAttribute(info, 'name') module = viewutil.getInfoAttribute(info, 'module') description = viewutil.getInfoAttribute(info, 'description') steps = viewutil.getInfoAttribute(info, 'steps') log.log().logger.info("steps: %s" % steps) steps = steps.replace('"', "'") log.log().logger.info("steps: %s" % steps) type = viewutil.getInfoAttribute(info, 'type') if module == '' or name == '' or steps == '' or type == '': return '必填字段不得为空!' else: if type == '公共用例': isPublic = 1 else: isPublic = 0 test_case_manage.test_case_manage().update_test_case( id, ['module', 'name', 'steps', 'description', 'isPublicFunction'], [module, name, steps, description, isPublic]) return render_template("uitest/test_batch2.html", id=id, type='test_suite')
def save_new_test_api(): log.log().logger.info(request) if request.method == 'POST': info = request.form log.log().logger.info('info : %s' % info) name = viewutil.getInfoAttribute(info, 'name') description = viewutil.getInfoAttribute(info, 'description') module = viewutil.getInfoAttribute(info, 'module') product = viewutil.getInfoAttribute(info, 'product') url = viewutil.getInfoAttribute(info, 'url') paras = viewutil.getInfoAttribute(info, 'paras') osign_list = viewutil.getInfoAttribute(info, 'osign_list') osign_list = osign_list.replace('[', '').replace(']', '').replace( "'", '').replace(" ", '') result = test_api_new_manange.test_api_new_manange().new_test_api( product, module, name, url, paras, osign_list, description) if result: code = 200 message = 'success' else: code = 500 message = 'failed' data1 = jsonify({'code': code, 'msg': message}) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}
def edit_test_api(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'id') log.log().logger.info('id: %s' % id) return render_template("apinew/edit_test_api.html", id=id)
def edit_test_minder_page(): log.log().logger.info(request) if request.method == 'POST': log.log().logger.info('POST') return redirect("test_minders") if request.method == 'GET': info = request.values log.log().logger.info('info :%s' %info) minder_id = viewutil.getInfoAttribute(info,'id') return render_template("minder/edit_test_minder.html",minder_id=minder_id)
def view_unitest_results(): info = request.values log.log().logger.info('info : %s' %info) id = viewutil.getInfoAttribute(info, 'id') # from app import test_unittest_manage data = test_unittest_manage.test_unittest_manage().show_unittest_records(['id'], [id], [], 100) if len(data): filename = data[0]['file_name'] return render_template("reports/"+filename) else: return render_template("util/unittest_records.html")
def attach_test_batch(): log.log().logger.info(request) if request.method == 'GET': log.log().logger.info('post') info = request.values log.log().logger.info('info : %s' % info) id = viewutil.getInfoAttribute(info, 'test_suite_id') log.log().logger.info('id: %s' % id) return render_template("uitest/attach_test_batch.html", id=id) else: return render_template("uitest/test_suite.html")
def edit_hub(): info = request.values id = viewutil.getInfoAttribute(info, 'id') data = hubs.hubs().searchHubs(id) if len(data): host = data[0]['ip'] port = data[0]['port'] else: host = '' port = 4444 return render_template("util/new_hub.html", host=host, port=port)
def test_api_reosign(): log.log().logger.info(request) if request.method == 'POST': log.log().logger.info('post') result = jsonify({'code': 500, 'msg': 'should be get!'}) return result else: log.log().logger.info(request.values) info = request.values osign_list = viewutil.getInfoAttribute(info, 'osign_list').split(',') context = viewutil.getInfoAttribute(info, 'context') import json context = json.loads(context) # print(type(context)) # print(context['appId']) # print(osign,context) log.log().logger.info('context is : %s' % context) print(len(osign_list), osign_list, 'osign info') if len(osign_list) > 1: log.log().logger.info('osign is not empty!') from app.api_new import api_manage appKey = 'abc' context = api_manage.api_manage().api_osign(osign_list=osign_list, para_info=context, appkey=appKey) log.log().logger.info(context['osign']) result = jsonify({ 'code': 200, 'rows': [{ 'context': str(context) }] }) else: log.log().logger.info('osign list is empty!') result = jsonify({ 'code': 200, 'rows': [{ 'context': str(context) }] }) return result
def split_test_api_url(): if request.method == 'POST': log.log().logger.info('post') if request.method == 'GET': info = request.values log.log().logger.info('info : %s' % info) url = viewutil.getInfoAttribute(info, 'url') api_info = api_manage.api_manage().split_api_info(url) data1 = jsonify(api_info) log.log().logger.info('data1: %s' % data1) return data1, {'Content-Type': 'application/json'}