Ejemplo n.º 1
0
def user_marks_testcase_status(step, stored_user, user_name, stored_testrun, testrun_name):
    trModel = TestrunModel()
    testrun_name = trModel.get_stored_or_store_name(stored_testrun, testrun_name)
    userModel = UserModel()
    user_name = userModel.get_stored_or_store_name(stored_user, user_name)

    # first we need the testrun id so we can get the latest version to approve
#    user_id = UserModel().get_resid(user_name)[0]
    testrun_id = trModel.get_resid(testrun_name)[0]

    # get the list of testcases for this testrun
    includedtestcase_list = trModel.get_included_testcases(testrun_id)

    for tc in step.hashes:
        testcase_id = TestcaseModel().get_resid(tc["name"])[0]

        result_obj = trModel.get_result(testcase_id,
                                    includedtestcase_list = includedtestcase_list)
        result_id = get_resource_identity(result_obj)[0]

        started_result = trModel.start_testcase(result_obj, user_name)
        started_result_version = get_resource_identity(started_result)[1]
        # now finally mark it with the specified status

        trModel.set_testcase_status(result_id, started_result_version, user_name, tc["status"])
def user_marks_testcase_status(step, stored_user, user_name, stored_testrun,
                               testrun_name):
    trModel = TestrunModel()
    testrun_name = trModel.get_stored_or_store_name(stored_testrun,
                                                    testrun_name)
    userModel = UserModel()
    user_name = userModel.get_stored_or_store_name(stored_user, user_name)

    # first we need the testrun id so we can get the latest version to approve
    #    user_id = UserModel().get_resid(user_name)[0]
    testrun_id = trModel.get_resid(testrun_name)[0]

    # get the list of testcases for this testrun
    includedtestcase_list = trModel.get_included_testcases(testrun_id)

    for tc in step.hashes:
        testcase_id = TestcaseModel().get_resid(tc["name"])[0]

        result_obj = trModel.get_result(
            testcase_id, includedtestcase_list=includedtestcase_list)
        result_id = get_resource_identity(result_obj)[0]

        started_result = trModel.start_testcase(result_obj, user_name)
        started_result_version = get_resource_identity(started_result)[1]
        # now finally mark it with the specified status

        trModel.set_testcase_status(result_id, started_result_version,
                                    user_name, tc["status"])
def add_envgroups_to_testrun(step, stored_testrun, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored_testrun, testrun_name)

    envgrp_ids = []
    for envgrp in step.hashes:
        envgrp_id = EnvironmentgroupModel().get_resid(envgrp["name"])[0]
        envgrp_ids.append(envgrp_id)

    testrunModel.add_environmentgroups(testrun_name, envgrp_ids)
Ejemplo n.º 4
0
def add_users_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    user_ids = []
    for user in step.hashes:
        user_id = UserModel().get_resid(user["name"])[0]
        user_ids.append(user_id)

    testrunModel.add_team_members(testrun_name, user_ids)
def add_users_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    user_ids = []
    for user in step.hashes:
        user_id = UserModel().get_resid(user["name"])[0]
        user_ids.append(user_id)

    testrunModel.add_team_members(testrun_name, user_ids)
Ejemplo n.º 6
0
def create_testrun_with_name(step, stored, name, testcycle_name):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)

    testcycle_id = TestcycleModel().get_resid(testcycle_name)[0]

    post_payload = {"testCycleId": testcycle_id,
                    "name": name,
                    "description": "Yeah, I'm gonna run to you...",
                    "selfAssignAllowed": "true",
                    "selfAssignPerEnvironment": "true",
                    "selfAssignLimit": 10,
                    "useLatestVersions": "true",
                    "startDate": "2011/02/02",
                    "endDate": "2012/02/02",
                    "autoAssignToTeam": "true"
                   }

    testrunModel.create(post_payload)
def create_testrun_with_name(step, stored, name, testcycle_name):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)

    testcycle_id = TestcycleModel().get_resid(testcycle_name)[0]

    post_payload = {
        "testCycleId": testcycle_id,
        "name": name,
        "description": "Yeah, I'm gonna run to you...",
        "selfAssignAllowed": "true",
        "selfAssignPerEnvironment": "true",
        "selfAssignLimit": 10,
        "useLatestVersions": "true",
        "startDate": "2011/02/02",
        "endDate": "2012/02/02",
        "autoAssignToTeam": "true"
    }

    testrunModel.create(post_payload)
Ejemplo n.º 8
0
def add_testcases_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    for tc in step.hashes:
        testrunModel.add_testcase(testrun_name, tc["testcase"])
Ejemplo n.º 9
0
def activate_testrun_with_name(step, stored, name):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)

    testrunModel.activate(name)
Ejemplo n.º 10
0
def check_testrun_existence(step, stored, name, existence):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)
    testrunModel.search_and_verify_existence(testrunModel.root_path,
                    {"name": name},
                    existence)
def add_testcases_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    for tc in step.hashes:
        testrunModel.add_testcase(testrun_name, tc["testcase"])
def activate_testrun_with_name(step, stored, name):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)

    testrunModel.activate(name)
def check_testrun_existence(step, stored, name, existence):
    testrunModel = TestrunModel()
    name = testrunModel.get_stored_or_store_name(stored, name)
    testrunModel.search_and_verify_existence(testrunModel.root_path,
                                             {"name": name}, existence)
Ejemplo n.º 14
0
def add_testsuites_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    for testsuite in step.hashes:
        testrunModel.add_testsuite(testrun_name, testsuite["name"])
def add_testsuites_to_testrun(step, stored, testrun_name):
    testrunModel = TestrunModel()
    testrun_name = testrunModel.get_stored_or_store_name(stored, testrun_name)

    for testsuite in step.hashes:
        testrunModel.add_testsuite(testrun_name, testsuite["name"])