def create_testplan(project_id, release_testplan, build_testplan):
    """
    Creates release test plan and build test plan
    """
    from pylero.plan import Plan

    release_testplan_id = release_testplan.replace(".", "_")
    build_testplan_id = build_testplan.replace(".", "_")
    rst_res = Plan.search("id:{}".format(release_testplan_id))
    if rst_res == []:
        Plan.create(release_testplan_id, release_testplan, project_id, None,
                    "release")
    else:
        print("release test plan {} already exists".format(release_testplan))
    plan = Plan(project_id=project_id, plan_id=release_testplan_id)
    if plan.status == "open":
        plan.status = "inprogress"
        plan.update()

    btp_res = Plan.search("id:{}".format(build_testplan_id))
    if btp_res == []:
        res = Plan.create(build_testplan_id, build_testplan, project_id,
                          release_testplan_id, "iteration")
    else:
        res = True
        print("build test plan {} already exists".format(build_testplan))

    plan = Plan(project_id=project_id, plan_id=build_testplan_id)
    if plan.status == "open":
        plan.status = "inprogress"
        plan.update()

    return res
Exemple #2
0
 def setUpClass(cls):
     tc1 = TestCase.create(DEFAULT_PROJ,
                           "regression",
                           "regression",
                           caseimportance="high",
                           caselevel="component",
                           caseautomation="notautomated",
                           caseposneg="positive",
                           testtype="functional",
                           subtype1="-")
     cls.NEW_TEST_CASE = tc1.work_item_id
     tc2 = TestCase.create(DEFAULT_PROJ,
                           "regression",
                           "regression",
                           caseimportance="high",
                           caselevel="component",
                           caseautomation="notautomated",
                           caseposneg="positive",
                           testtype="functional",
                           subtype1="-")
     cls.NEW_TEST_CASE2 = tc2.work_item_id
     Plan.create(plan_id=PLAN_ID,
                 plan_name="regression",
                 project_id=DEFAULT_PROJ,
                 parent_id=None,
                 template_id="release")
     cls.NEW_PLAN = PLAN_ID
Exemple #3
0
 def test_002_create_plan(self):
     """This test does the following:
     * creates a test riun based on the template created in previous test
     * Verifies that the returned object exists and is not a template
     """
     plan = Plan.create(PLAN_ID, "Regression", DEFAULT_PROJ, None,
                        TEMPLATE_ID)
     self.assertIsNotNone(plan.plan_id)
     self.assertFalse(plan.is_template)