def testcycle_has_testrun(step, cycle_name, run_name):
    testcycleModel = TestcycleModel()
    testcycle_id = testcycleModel.get_resid(cycle_name)[0]

    testrun_list = testcycleModel.get_testrun_list(testcycle_id)

    found_run = [x for x in testrun_list if x[ns("name")] == run_name]
    assert len(found_run) == 1, "Expected to find name %s in:\n%s" % (
        run_name, jstr(testrun_list))
예제 #2
0
def testcycle_has_testrun(step, cycle_name, run_name):
    testcycleModel = TestcycleModel()
    testcycle_id = testcycleModel.get_resid(cycle_name)[0]

    testrun_list = testcycleModel.get_testrun_list(testcycle_id)

    found_run = [x for x in testrun_list if x[ns("name")] == run_name]
    assert len(found_run) == 1, "Expected to find name %s in:\n%s" % (run_name,
                                                                      jstr(testrun_list))
def testcycle_has_percent_complete_of_X(step, stored_testcycle, testcycle_name, exp_percent):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    act_percent = testcycleModel.get_percent_complete(testcycle_id)

    eq_(act_percent[ns("categoryValue")], int(exp_percent), "percent complete check")
def add_envgroups_to_testcycle(step, stored_testcycle, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle_name = testcycleModel.get_stored_or_store_name(stored_testcycle, testcycle_name)

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

    testcycleModel.add_environmentgroups(testcycle_name, envgrp_ids)
def add_users_to_testcycle(step, stored, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle_name = testcycleModel.get_stored_or_store_name(stored, testcycle_name)

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

    testcycleModel.add_team_members(testcycle_name, user_ids)
예제 #6
0
def add_users_to_testcycle(step, stored, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle_name = testcycleModel.get_stored_or_store_name(
        stored, testcycle_name)

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

    testcycleModel.add_team_members(testcycle_name, user_ids)
예제 #7
0
def testcycle_has_percent_complete_of_X(step, stored_testcycle, testcycle_name,
                                        exp_percent):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    act_percent = testcycleModel.get_percent_complete(testcycle_id)

    eq_(act_percent[ns("categoryValue")], int(exp_percent),
        "percent complete check")
def create_testcycle_with_name(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    post_payload = {"name": name,
                    "description": "Ahh, the cycle of life...",
                    "productId": ProductModel().get_seed_resid()[0],
                    "startDate": "2011/02/02",
                    "communityAuthoringAllowed": "true",
                    "communityAccessAllowed": "true",
                    "endDate": "2014/02/02"
                   }
    testcycleModel.create(post_payload)
예제 #9
0
def create_testcycle_with_name(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    post_payload = {
        "name": name,
        "description": "Ahh, the cycle of life...",
        "productId": ProductModel().get_seed_resid()[0],
        "startDate": "2011/02/02",
        "communityAuthoringAllowed": "true",
        "communityAccessAllowed": "true",
        "endDate": "2014/02/02"
    }
    testcycleModel.create(post_payload)
예제 #10
0
def testcycle_has_team_members(step, stored_testcycle, testcycle_name, expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    teammember_list = testcycleModel.get_team_members_list(testcycle_id)

    eq_list_length(teammember_list, step.hashes)

    for teammember in step.hashes:
        names = teammember["name"].split()

        verify_single_item_in_list(teammember_list,
                                   params = {"firstName": names[0],
                                             "lastName": names[1]}
                                   )
예제 #11
0
def create_testcycles(step):
    testcycleModel = TestcycleModel()

    for item in step.hashes:
        # must do this or it will freak out the lettuce reporting, because
        # we delete items from this before submitting.
        testcycle = item.copy()

        # get the product id from the passed product name
        product_id = ProductModel().get_resid(testcycle["product name"])[0]

        testcycle["productId"] = product_id

        if testcycle.has_key('product name'):
            del testcycle['product name']

        testcycleModel.create(testcycle)
예제 #12
0
def create_testcycles(step):
    testcycleModel = TestcycleModel()

    for item in step.hashes:
        # must do this or it will freak out the lettuce reporting, because
        # we delete items from this before submitting.
        testcycle = item.copy()

        # get the product id from the passed product name
        product_id = ProductModel().get_resid(testcycle["product name"])[0]

        testcycle["productId"] = product_id

        if testcycle.has_key('product name'):
            del testcycle['product name']

        testcycleModel.create(testcycle)
예제 #13
0
def testcycle_has_testruns(step, stored_testcycle, testcycle_name, expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    testrun_list = testcycleModel.get_testrun_list(testcycle_id)

    eq_list_length(testrun_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for testrun in step.hashes:
        # find that in the list of testcases
        exp_name = testrun["name"]

        verify_single_item_in_list(testrun_list, "name", exp_name)
예제 #14
0
def testcycle_has_testruns(step, stored_testcycle, testcycle_name, expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    testrun_list = testcycleModel.get_testrun_list(testcycle_id)

    eq_list_length(testrun_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for testrun in step.hashes:
        # find that in the list of testcases
        exp_name = testrun["name"]

        verify_single_item_in_list(testrun_list,
                                   "name",
                                   exp_name)
예제 #15
0
def testcycle_has_summary_counts(step, stored_testcycle, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    summary_list = testcycleModel.get_summary_list(testcycle_id)

    eq_list_length(summary_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for category in step.hashes:
        # find that in the list of testcases
        status_id = get_result_status_id(category["name"])
        categoryInfo = verify_single_item_in_list(summary_list, "categoryName",
                                                  status_id)
        assert str(categoryInfo[ns("categoryValue")]) == category["count"], \
            "%s count was wrong.  Expected categoryName: %s , categoryValue: %s:\n%s" % \
            (category["name"], status_id, category["count"], jstr(categoryInfo))
예제 #16
0
def testcycle_has_team_members(step, stored_testcycle, testcycle_name,
                               expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    teammember_list = testcycleModel.get_team_members_list(testcycle_id)

    eq_list_length(teammember_list, step.hashes)

    for teammember in step.hashes:
        names = teammember["name"].split()

        verify_single_item_in_list(teammember_list,
                                   params={
                                       "firstName": names[0],
                                       "lastName": names[1]
                                   })
예제 #17
0
def testcycle_has_summary_counts(step, stored_testcycle, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    summary_list = testcycleModel.get_summary_list(testcycle_id)

    eq_list_length(summary_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for category in step.hashes:
        # find that in the list of testcases
        status_id = get_result_status_id(category["name"])
        categoryInfo = verify_single_item_in_list(summary_list, "categoryName",
                                                  status_id)
        assert str(categoryInfo[ns("categoryValue")]) == category["count"], \
            "%s count was wrong.  Expected categoryName: %s , categoryValue: %s:\n%s" % \
            (category["name"], status_id, category["count"], jstr(categoryInfo))
예제 #18
0
def testcycle_has_environmentgroups(step, stored_testcycle, testcycle_name, expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    envgrp_list = testcycleModel.get_environmentgroup_list(testcycle_id)

    # this checks that the lengths match.  The expect_any holder is not used, but it allows for
    # alternate wording in the step.
    eq_list_length(envgrp_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for envgrp in step.hashes:
        # find that in the list of testcases
        exp_name = envgrp["name"]

        verify_single_item_in_list(envgrp_list,
                                   "name",
                                   exp_name)
예제 #19
0
def testcycle_has_environmentgroups(step, stored_testcycle, testcycle_name,
                                    expect_any):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)
    testcycle_id = get_resource_identity(testcycle)[0]

    # get the list of testcases for this testcycle
    envgrp_list = testcycleModel.get_environmentgroup_list(testcycle_id)

    # this checks that the lengths match.  The expect_any holder is not used, but it allows for
    # alternate wording in the step.
    eq_list_length(envgrp_list, step.hashes)

    # walk through and verify that each testcase has the expected status
    for envgrp in step.hashes:
        # find that in the list of testcases
        exp_name = envgrp["name"]

        verify_single_item_in_list(envgrp_list, "name", exp_name)
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)
예제 #21
0
def check_testcycle_existence(step, stored, name, existence):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.verify_existence_on_root(name,
                                            existence = existence)
예제 #22
0
def activate_testcycle_with_name(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.activate(name)
예제 #23
0
def delete_testcycle_with_name_foo(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.delete(name)
예제 #24
0
def delete_testcycle_with_name_foo(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.delete(name)
예제 #25
0
def activate_testcycle_with_name(step, stored, name):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.activate(name)
예제 #26
0
def check_testcycle_existence(step, stored, name, existence):
    testcycleModel = TestcycleModel()
    name = testcycleModel.get_stored_or_store_name(stored, name)

    testcycleModel.verify_existence_on_root(name, existence=existence)
예제 #27
0
def approve_all_results_for_testcycle(step, stored_testcycle, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle,
                                                       testcycle_name)

    testcycleModel.approve_all_results(testcycle)
예제 #28
0
def approve_all_results_for_testcycle(step, stored_testcycle, testcycle_name):
    testcycleModel = TestcycleModel()
    testcycle = testcycleModel.get_stored_or_store_obj(stored_testcycle, testcycle_name)

    testcycleModel.approve_all_results(testcycle)