def get_project(self):
     project = Properties.get_zephyr_session().get_project()
     sc = self.get_search_criteria('', '', '')
     projects_list = self.client.service.getProjectsByCriteria(sc, 'true', self.session)
     for element in projects_list:
         if element.name == project:
             return element
     raise RuntimeError(
         "Zephyr integration error, unable to find project [" + project + "] in list " + projects_list.__str__())
 def get_release(self):
     release = Properties.get_zephyr_session().get_release()
     project = self.get_project()
     sc = self.get_search_criteria('', '', '')
     rr = self.client.service.getReleasesByCriteria(sc, 'true', self.session)
     for key in rr:
         if key.remoteProjectData.remoteData.name == project.name and key.name == release:
             return key
     raise RuntimeError(
         "Zephyr integration error, unable to find release [" + release + "] in list " + releases.__str__())
Beispiel #3
0
def fin(request):
    yield
    if not ZephyrTestOptions.is_reportable():
        return

    test_end = time.time()
    test_duration = request.node.rep_call.duration
    test_start = test_end - test_duration

    start_time = Properties.get_zephyr_session().get_start_time()
    build = Properties.get_zephyr_session().get_build()
    environment = Properties.get_external_parameters().get_firmware_version()
    test_cases_path = Properties.get_zephyr_session().get_test_cases_root()

    test_name = '%s.%s - %s' % (environment, build, start_time)

    zm = ZephyrManager()
    zm.login()

    test_case_tree = zm.get_test_case_tree(test_cases_path)
    zm.logout()
    ZephyrTestOptions.reset()
    """
 def create_test_execution(self, name, start_date, end_date):
     ret = 0
     try:
         rel_id = self.get_release()
         cycle = self.client.factory.create('remoteCycle')
         cycle.name = name
         cycle.build = Properties.get_zephyr_session().get_build()
         cycle.environment = Properties.get_external_parameters().get_firmware_version()
         cycle.startDate = start_date
         cycle.endDate = end_date
         cycle.releaseId = rel_id
         ret = self.client.service.createNewCycle(cycle, self.session)
     except Exception as e:
         print 'Error creating new test cycle: %s' % e
     return ret
 def __init__(self):
     self.user_name = Properties.get_zephyr_session().get_user_name()
     self.password = Properties.get_zephyr_session().get_user_password()
     self.url = Properties.get_zephyr_session().get_url()
     self.client = Client(self.url)
     self.session = None