Esempio n. 1
0
def http_testCaseStepCheck(request):
    context = {}

    context["testCaseStepCheck"] = "current-page"
    context["userName"] = request.session.get("userName")
    context["checkBusinessLine"] = dbModelListToListDict(
        BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(
        ModulesService.getAllModules())
    if not isRelease:
        context["env"] = "test"
    #文本
    text = {}
    text["pageTitle"] = "HTTP用例步骤查看"
    context["text"] = text
    context["uri"] = UriService.getUri(request, "HTTP")
    context["page"] = 1
    return render(request,
                  "InterfaceTest/HTTPTestCase/HTTP_testCaseStep_check.html",
                  context)
Esempio n. 2
0
def taskAdd(request, context):
    langDict = getLangTextDict(request)
    context["interfacePage"] = 1
    context["testCasePage"] = 1
    context["option"] = "add"
    if not isRelease:
        context["env"] = "test"
    context["taskAdd"] = "current-page"
    context["checkBusinessLine"] = dbModelListToListDict(
        BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(
        ModulesService.getAllModules())
    context.update(getServiceConf(request))
    text = {}
    text["pageTitle"] = langDict["web"]["httpTaskPageHeadings_%s" %
                                        context["option"]]
    text["subPageTitle"] = langDict["web"]["httpTaskSubPageTitle_%s" %
                                           context["option"]]
    context["text"] = text
    # return request.session.get("loginName"),request, "InterfaceTest/HTTPTask/HTTP_taskAdd.html", context
    return render(request, "InterfaceTest/HTTPTask/HTTP_taskAdd.html", context)
Esempio n. 3
0
def dubbo_testCaseCheck(request):
    langDict = getLangTextDict(request)
    context = {}

    context["dubbo_testCaseCheck"] = "current-page"
    context["userName"] = request.session.get("userName")
    context["checkBusinessLine"] = dbModelListToListDict(
        BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(
        ModulesService.getAllModules())
    if not isRelease:
        context["env"] = "test"
    # 文本
    text = {}
    text["pageTitle"] = langDict["dubbo"]["dubboTestCasePageHeadings_check"]
    context["text"] = text

    context["page"] = 1

    # context["lang"] = getLangTextDict(request)
    context["title"] = "DUBBO业务流"
    return render(request, "dubbo/testcase/testCase_check.html", context)
Esempio n. 4
0
def srcFileCheck(request):
    langDict = getLangTextDict(request)
    context = {}

    context["srcFileAnalyze"] = "open"
    context["userName"] = request.session.get("userName")
    if not isRelease:
        context["env"] = "test"

    # 文本
    text = {}
    text["pageTitle"] = langDict["web"]["srcFileAnalyzePageTitle"]
    text["subPageTitle"] = langDict["web"][
        "httpUserCenterGlobalVarsSubPageTitle"]
    context["text"] = text
    context["checkBusinessLine"] = dbModelListToListDict(
        BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(
        ModulesService.getAllModules())

    context["page"] = 1
    return render(request, "InterfaceTest/src_file_analyze/src_file.html",
                  context)
Esempio n. 5
0
def http_interfaceCheck(request):
    request.session['groupLevel1'] = groupLevel1
    request.session['groupLevel2'] = groupLevel2
    request.session['isReleaseEnv'] = isRelease

    langDict = getLangTextDict(request)
    context = {}
    if not isRelease:
        context["env"] = "test"
    context["mockinterfaceCheck"] = "current-page"
    context["userName"] = request.session.get("userName")
    context["checkBusinessLine"] = dbModelListToListDict(BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(ModulesService.getAllModules())
    # 文本
    text = {}
    text["pageTitle"] = "MOCK接口查看"
    context["text"] = text
    context["page"] = 1
    # context["lang"] = getLangTextDict(request)
    context["uri"] = UriService.getUri(request,"HTTP")

    addUserLog(request, "MOCK管理->查看MOCK->页面展示->成功", "PASS")
    context["title"] = "HTTP MOCK"
    return render(request, "mock_server/http/HTTP_interface_check.html", context)
Esempio n. 6
0
def srcFileList(request):

    page = request.POST.get("page")
    if isInt(page):
        page = int(page)
    else:
        return HttpResponse("<script>alert('请验证页数参数');</script>")
    checkArr = json.loads(parse.unquote(request.POST.get("queryArr")))
    orderBy = request.POST.get("orderBy")
    if isSqlInjectable(orderBy):
        return HttpResponse("<script>alert('查询条件非法');</script>")

    if VersionService.isCurrentVersion(request):
        tbName = "tb_standard_interface"
        versionCondition = ""
    else:
        tbName = "tb_version_standard_interface"
        versionCondition = "and g.versionName='%s'" % request.session.get(
            "version")

    execSql = "SELECT g.*,m.moduleName,b.bussinessLineName FROM %s g LEFT JOIN tb_modules m on g.moduleId = m.id LEFT JOIN tb_business_line b on g.businessLineId = b.id WHERE g.state=1 %s" % (
        tbName, versionCondition)
    checkList = []
    for key in checkArr:
        if checkArr[key] == "":
            continue
        elif key == "businessLine":
            checkList.append("%%%s%%" % checkArr[key])
            execSql += """ and b.bussinessLineName LIKE %s """
            continue
        elif key == "module":
            checkList.append("%%%s%%" % checkArr[key])
            execSql += """ and m.moduleName LIKE %s """
            continue
        elif key == "fileRealPath":
            checkList.append("%%%s%%" % checkArr[key])
            execSql += """ and g.fileName LIKE %s """
            continue
        elif key == "interfaceUrl":
            checkList.append("%%%s%%" % checkArr[key])
            execSql += """ and g.interfaceUrl LIKE %s """
            continue
        elif key == "apiStatus":
            statusDict = {"有效": "1", "废弃": "0", "未发现注释": "3", "注释不合法": "4"}
            statusValue = statusDict[checkArr[key]]
            checkList.append("%s" % statusValue)
            execSql += """ and g.apiStatus = %s """
            continue
        checkList.append("%%%s%%" % checkArr[key])
        execSql += """ and g.%s """ % key
        execSql += """ LIKE %s"""
    execSql += """ ORDER BY %s""" % orderBy
    print(execSql)
    context = pagination(sqlStr=execSql,
                         attrList=checkList,
                         page=page,
                         pageNum=commonWebConfig.standardInterfacePageNum)
    context["checkBusinessLine"] = dbModelListToListDict(
        BusinessService.getAllBusinessLine())
    context["checkModules"] = dbModelListToListDict(
        ModulesService.getAllModules())
    response = render(
        request,
        "InterfaceTest/src_file_analyze/SubPages/src_file_sub_page.html",
        context)
    return response