Esempio n. 1
0
    def activate(self, testcase_name):
        testcase_id = self.get_resid(testcase_name)[0]
        testcaseversion_id, version = self.get_latestversion_resid(testcase_id)

        do_put(
            "%s/versions/%s/activate" % (self.root_path, testcaseversion_id),
            {"originalVersionId": version})
Esempio n. 2
0
    def add_team_members(self, tcm_name, user_ids):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/team/members" % (self.root_path, tcm_id), {
            "userIds": user_ids,
            "originalVersionId": version
        })
Esempio n. 3
0
    def add_environmentgroups(self, tcm_name, envgrp_ids):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/environmentgroups" % (self.root_path, tcm_id), {
            "environmentGroupIds": envgrp_ids,
            "originalVersionId": version
        })
Esempio n. 4
0
def change_user_password(step, new_pw, stored, name):
    name = get_stored_or_store_name("user", stored, name)
    user_id, version = UserModel().get_resid(name)

    do_put(
        UserModel().root_path + "/" + "%s/passwordchange/%s" %
        (user_id, new_pw), {"originalVersionId": version})
Esempio n. 5
0
 def set_roles(self, user_name, role_ids):
     '''
         replace the users roles with these roles
     '''
     user_id, user_version = self.get_resid(user_name)
     do_put("%s/%s/roles/" % (self.root_path, user_id),
         {"originalVersionId": user_version,
          "roleIds": role_ids})
Esempio n. 6
0
 def set_roles(self, user_name, role_ids):
     '''
         replace the users roles with these roles
     '''
     user_id, user_version = self.get_resid(user_name)
     do_put("%s/%s/roles/" % (self.root_path, user_id), {
         "originalVersionId": user_version,
         "roleIds": role_ids
     })
Esempio n. 7
0
    def approve_by_user(self, testcase_name, user_name):
        # first we need the testcase id so we can get the latest version to approve
        testcase_id, version = self.get_resid(testcase_name)
        testcaseversion_id = self.get_latestversion_resid(testcase_id)[0]

        # do the approval of the testcase
        uri = "%s/versions/%s/approve/" % (self.root_path, testcaseversion_id)
        headers = get_form_headers(UserModel().get_auth_header(user_name))

        do_put(uri, {"originalVersionId": version}, headers=headers)
Esempio n. 8
0
    def set_testcase_status(self, result_id, started_result_version, user_name, status):
        status_map = {"Passed": "finishsucceed",
                      "Failed": "finishfail",
                      "Skipped": "finishskip",
                      "Invalidated": "finishinvalidate"}

        headers = get_form_headers(UserModel().get_auth_header(user_name))

        do_put("%s/results/%s/%s" % (self.root_path, result_id, status_map[status]),
               {"originalVersionId": started_result_version},
               headers = headers)
Esempio n. 9
0
def update_user_with_name(step, stored, name):
    name = get_stored_or_store_name("user", stored, name)

    user_id, version = UserModel().get_resid(name)

    new_values = step.hashes[0].copy()
    company_id = CompanyModel().get_resid(new_values["company name"])
    new_values["companyId"] = company_id
    del new_values["company name"]
    new_values["originalVersionId"] = version

    do_put(UserModel().root_path + "/" + str(user_id), new_values)
Esempio n. 10
0
    def approve_by_user(self, testcase_name, user_name):
                # first we need the testcase id so we can get the latest version to approve
        testcase_id, version = self.get_resid(testcase_name)
        testcaseversion_id = self.get_latestversion_resid(testcase_id)[0]


        # do the approval of the testcase
        uri = "%s/versions/%s/approve/" % (self.root_path, testcaseversion_id)
        headers = get_form_headers(UserModel().get_auth_header(user_name))

        do_put(uri,
               {"originalVersionId": version},
                headers = headers)
Esempio n. 11
0
def update_user_with_name(step, stored, name):
    name = get_stored_or_store_name("user", stored, name)


    user_id, version = UserModel().get_resid(name)

    new_values = step.hashes[0].copy()
    company_id = CompanyModel().get_resid(new_values["company name"])
    new_values["companyId"] = company_id
    del new_values["company name"]
    new_values["originalVersionId"] = version

    do_put(UserModel().root_path + "/" + str(user_id), new_values)
Esempio n. 12
0
    def set_testcase_status(self, result_id, started_result_version, user_name,
                            status):
        status_map = {
            "Passed": "finishsucceed",
            "Failed": "finishfail",
            "Skipped": "finishskip",
            "Invalidated": "finishinvalidate"
        }

        headers = get_form_headers(UserModel().get_auth_header(user_name))

        do_put("%s/results/%s/%s" %
               (self.root_path, result_id, status_map[status]),
               {"originalVersionId": started_result_version},
               headers=headers)
Esempio n. 13
0
def log_out(step, stored, user_name):
    user_name = get_stored_or_store_name("user", stored, user_name)

    headers = {'cookie': world.auth_cookie,
               'Content-Type':'application/json' }

    return do_put(UserModel().root_path + "/" + "logout", "", headers)
Esempio n. 14
0
    def approve_result(self, testrun_id, testcase_id):

        #/testruns/results/{resultId}/approve/
        result_obj = self.get_result(testcase_id, testrun_id)
        result_id, version = get_resource_identity(result_obj)
        return do_put("%s/results/%s/approve" % (self.root_path, result_id),
                      body={"originalVersionId": version})
Esempio n. 15
0
    def approve_result(self, testrun_id, testcase_id):

        #/testruns/results/{resultId}/approve/
        result_obj = self.get_result(testcase_id, testrun_id)
        result_id, version = get_resource_identity(result_obj)
        return do_put("%s/results/%s/approve" % (self.root_path,
                                                 result_id),
                      body = {"originalVersionId": version}
                      )
Esempio n. 16
0
    def start_testcase(self, result_obj, user_name):
        result_id, result_version = get_resource_identity(result_obj)

        # start the test
        headers = get_form_headers(UserModel().get_auth_header(user_name))
        testresult = do_put("%s/results/%s/start" % (self.root_path, result_id),
                            {"originalVersionId": result_version}, headers)
        started_result = json_to_obj(testresult)[ns("testresult")][0]
        return started_result
Esempio n. 17
0
    def start_testcase(self, result_obj, user_name):
        result_id, result_version = get_resource_identity(result_obj)

        # start the test
        headers = get_form_headers(UserModel().get_auth_header(user_name))
        testresult = do_put(
            "%s/results/%s/start" % (self.root_path, result_id),
            {"originalVersionId": result_version}, headers)
        started_result = json_to_obj(testresult)[ns("testresult")][0]
        return started_result
Esempio n. 18
0
def confirm_user_email(step, stored, name):
    name = get_stored_or_store_name("user", stored, name)
    user_id, version = UserModel().get_resid(name)

    do_put(UserModel().root_path + "/" + "%s/emailconfirm" % (user_id),
           {"originalVersionId": version})
Esempio n. 19
0
    def activate(self, tcm_name):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/activate" % (self.root_path, tcm_id),
               {"originalVersionId": version})
Esempio n. 20
0
    def add_team_members(self, tcm_name, user_ids):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/team/members" % (self.root_path, tcm_id),
           {"userIds": user_ids,
            "originalVersionId": version})
Esempio n. 21
0
def change_user_password(step, new_pw, stored, name):
    name = get_stored_or_store_name("user", stored, name)
    user_id, version = UserModel().get_resid(name)

    do_put(UserModel().root_path + "/" + "%s/passwordchange/%s" % (user_id, new_pw),
           {"originalVersionId": version})
Esempio n. 22
0
 def approve_all_results(self, testcycle):
     tcm_id, version = get_resource_identity(testcycle)
     return do_put("%s/%s/approveallresults" % (self.root_path,
                                              tcm_id),
                   body = {"originalVersionId": version}
                   )
Esempio n. 23
0
    def add_environmentgroups(self, tcm_name, envgrp_ids):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/environmentgroups" % (self.root_path, tcm_id),
               {"environmentGroupIds": envgrp_ids,
                "originalVersionId": version})
Esempio n. 24
0
 def deactivate(self, user_name):
     user_id, version = self.get_resid(user_name)
     do_put("%s/%s/deactivate" % (self.root_path, user_id),
            {"originalVersionId": version})
Esempio n. 25
0
def log_out(step, stored, user_name):
    user_name = get_stored_or_store_name("user", stored, user_name)

    headers = {'cookie': world.auth_cookie, 'Content-Type': 'application/json'}

    return do_put(UserModel().root_path + "/" + "logout", "", headers)
Esempio n. 26
0
def confirm_user_email(step, stored, name):
    name = get_stored_or_store_name("user", stored, name)
    user_id, version = UserModel().get_resid(name)

    do_put(UserModel().root_path + "/" + "%s/emailconfirm" % (user_id),
           {"originalVersionId": version})
Esempio n. 27
0
 def add_environments(self, envgrp_id, version, env_ids):
     do_put("%s/%s/environments" % (self.root_path, envgrp_id),
            {"environmentIds": env_ids,
             "originalVersionId": version})
Esempio n. 28
0
 def deactivate(self, user_name):
     user_id, version = self.get_resid(user_name)
     do_put("%s/%s/deactivate" % (self.root_path, user_id), {"originalVersionId": version})
Esempio n. 29
0
 def add_environments(self, envgrp_id, version, env_ids):
     do_put("%s/%s/environments" % (self.root_path, envgrp_id), {
         "environmentIds": env_ids,
         "originalVersionId": version
     })
Esempio n. 30
0
    def activate(self, testcase_name):
        testcase_id = self.get_resid(testcase_name)[0]
        testcaseversion_id, version = self.get_latestversion_resid(testcase_id)

        do_put("%s/versions/%s/activate" % (self.root_path, testcaseversion_id),
                  {"originalVersionId": version})
Esempio n. 31
0
 def approve_all_results(self, testcycle):
     tcm_id, version = get_resource_identity(testcycle)
     return do_put("%s/%s/approveallresults" % (self.root_path, tcm_id),
                   body={"originalVersionId": version})
Esempio n. 32
0
    def activate(self, tcm_name):
        tcm_id, version = self.get_resid(tcm_name)

        do_put("%s/%s/activate" % (self.root_path, tcm_id),
                  {"originalVersionId": version})