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]}
                                   )
Exemple #2
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)
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)
def testrun_has_team_members(step, stored_testrun, testrun_name):
    testrunModel = TestrunModel()
    testrun = testrunModel.get_stored_or_store_obj(stored_testrun,
                                                   testrun_name)
    testrun_id = get_resource_identity(testrun)[0]

    teammember_list = testrunModel.get_team_members_list(testrun_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]
                                   })
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))
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 product_has_environmentgroups(step, stored_product, product_name, expect_any):
    productModel = ProductModel()
    product = productModel.get_stored_or_store_obj(stored_product, product_name)
    product_id = get_resource_identity(product)[0]

    # get the list of testcases for this product
    envgrp_list = productModel.get_environmentgroup_list(product_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)
Exemple #8
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))
def testcases_have_pending_result_statuses(step, stored_testrun, testrun_name):
    trModel = TestrunModel()
    testrun = trModel.get_stored_or_store_obj(stored_testrun, testrun_name)

    testrun_id = get_resource_identity(testrun)[0]
    status_id = get_result_status_id("Pending")
    # get the list of testcases for this testrun
    result_list = trModel.search_for_results_by_result_status(testrun_id,
                                                              status_id)

    eq_list_length(result_list, step.hashes)

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

        result = verify_single_item_in_list(result_list, "testCaseId", testcase_id)

        # ok, we have the tc result in question, now check that its status matches expectations
        eq_(result[ns("testRunResultStatusId")],
            status_id,
            "testRunResultStatusId check")
def testcases_have_pending_result_statuses(step, stored_testrun, testrun_name):
    trModel = TestrunModel()
    testrun = trModel.get_stored_or_store_obj(stored_testrun, testrun_name)

    testrun_id = get_resource_identity(testrun)[0]
    status_id = get_result_status_id("Pending")
    # get the list of testcases for this testrun
    result_list = trModel.search_for_results_by_result_status(
        testrun_id, status_id)

    eq_list_length(result_list, step.hashes)

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

        result = verify_single_item_in_list(result_list, "testCaseId",
                                            testcase_id)

        # ok, we have the tc result in question, now check that its status matches expectations
        eq_(result[ns("testRunResultStatusId")], status_id,
            "testRunResultStatusId check")