Exemple #1
0
def delete_test_case(project, sheet_index):
    project = project.upper()
    handle = testcase.TestCase(project)
    index_list = handle.get_sheet_names()
    for info in index_list:
        if sheet_index == info["index"]:
            sheet_name = info['name']
            status, output = handle.delete_case(info['name'], **request.form)
            break
    return redirect(
        url_for("get_test_case", project=project, sheet_index=sheet_index))
Exemple #2
0
def run_test_case(project, sheet_index):
    project = project.upper()
    handle = testcase.TestCase(project)
    index_list = handle.get_sheet_names()
    count = 0
    for info in index_list:
        if sheet_index == info["index"]:
            sheet_name = info['name']
            break
        else:
            count = count + 1
        if count == len(index_list):
            sheet_name = '新需求'
    status, infoList = handle.run_case(sheet_name, **request.form)
    return render_template("caseRun.html", project=project, transList=infoList)
Exemple #3
0
def put_test_case(project, sheet_index):
    project = project.upper()
    handle = testcase.TestCase(project)
    index_list = handle.get_sheet_names()
    count = 0
    for info in index_list:
        if sheet_index == info["index"]:
            sheet_name = info['name']
            break
        else:
            count = count + 1
        if count == len(index_list):
            sheet_name = '新需求'
    status, output = handle.modify_case(sheet_name, **request.form)
    return redirect(
        url_for("get_test_case", project=project, sheet_index=sheet_index))
Exemple #4
0
def get_test_case(project, sheet_index):
    project = project.upper()
    handle = testcase.TestCase(project)
    index_list = handle.get_sheet_names()
    count = 0
    for info in index_list:
        if sheet_index == info["index"]:
            sheet_name = info['name']
            break
        else:
            count = count + 1
        if count == len(index_list):
            sheet_name = '新需求'
    if request.method == "POST":
        retList = handle.add_case(sheet_name, **request.form)
    else:
        retList = handle.get_sheet_content(sheet_name)

    return render_template("test_case.html",
                           project=project,
                           transList=retList[1:],
                           sheets_list=index_list,
                           titles=retList[0],
                           sheet_index=sheet_index)
Exemple #5
0
def split_test_case(project):
    project = project.upper()
    handle = testcase.TestCase(project)
    status, output = handle.split_case(r"新需求")
    return redirect(url_for("get_test_case", project=project, sheet_index=0))