def stop_current_test(self, name, attributes): uuid = self.stack.pop() test = self.reporter.get_test(uuid) test.status = utils.get_allure_status(attributes.get('status')) test.labels.extend(utils.get_allure_suites(attributes.get('longname'))) test.labels.extend(allure_tags(attributes)) for label_type in (LabelType.EPIC, LabelType.FEATURE, LabelType.STORY): test.labels.extend(allure_labels(attributes, label_type)) for link_type in (LinkType.ISSUE, LinkType.TEST_CASE, LinkType.LINK): test.links.extend(allure_links(attributes, link_type)) test.labels.append(Label(name=LabelType.THREAD, value=self.pool_id)) test.labels.append(Label(name=LabelType.HOST, value=host_tag())) test.labels.append( Label(name=LabelType.FRAMEWORK, value='robotframework')) test.labels.append( Label(name=LabelType.LANGUAGE, value=platform_label())) test.statusDetails = StatusDetails(message=attributes.get('message'), trace=self.get_traceback_message()) test.description = attributes.get('doc') last_link = list(self.links.values())[-1] if self.links else None if attributes.get(Severity.CRITICAL, 'no') == 'yes': test.labels.append( Label(name=LabelType.SEVERITY, value=Severity.CRITICAL)) if last_link: test.links.append(Link(LinkType.LINK, last_link, 'Link')) test.stop = now() self.reporter.close_test(uuid)
def stop_current_test(self, name, attributes): uuid = self.stack.pop() test = self.reporter.get_test(uuid) test.status = utils.get_allure_status(attributes.get('status')) test.labels.extend(utils.get_allure_suites(attributes.get('longname'))) test.labels.extend(utils.get_allure_tags(attributes.get('tags'))) test.labels.append(utils.get_allure_thread(self.pool_id)) test.labels.append(Label(LabelType.HOST, value=host_tag())) test.statusDetails = StatusDetails(message=attributes.get('message')) test.description = attributes.get('doc') last_link = list(self.links.values())[-1] if self.links else None if last_link: test.links.append(Link(LinkType.LINK, last_link, 'Link')) test.stop = now() self.reporter.close_test(uuid)
def stop_test(self, _, attributes, messages): self._report_messages(messages) if 'skipped' in [tag.lower() for tag in attributes['tags']]: attributes['status'] = RobotStatus.SKIPPED with self.lifecycle.update_test_case() as test_result: test_result.stop = now() test_result.description = attributes.get('doc') test_result.status = get_allure_status(attributes.get('status')) test_result.labels.extend( get_allure_suites(attributes.get('longname'))) test_result.labels.append( Label(name=LabelType.FRAMEWORK, value='robotframework')) test_result.labels.append( Label(name=LabelType.LANGUAGE, value=self._platform)) test_result.labels.append( Label(name=LabelType.HOST, value=self._host)) test_result.labels.append( Label(name=LabelType.THREAD, value=pool_id())) test_result.labels.extend(allure_tags(attributes)) test_result.statusDetails = StatusDetails( message=self._current_msg or attributes.get('message'), trace=self._current_tb) if attributes.get('critical') == 'yes': test_result.labels.append( Label(name=LabelType.SEVERITY, value=Severity.CRITICAL)) for label_type in (LabelType.EPIC, LabelType.FEATURE, LabelType.STORY): test_result.labels.extend(allure_labels( attributes, label_type)) for link_type in (LinkType.ISSUE, LinkType.TEST_CASE, LinkType.LINK): test_result.links.extend(allure_links(attributes, link_type)) self._current_tb, self._current_msg = None, None
def stop_current_test(self, name, attributes): uuid = self.stack.pop() test = self.reporter.get_test(uuid) test.status = utils.get_allure_status(attributes.get('status')) test.labels.extend(utils.get_allure_suites(attributes.get('longname'))) test.labels.extend(utils.get_allure_tags(attributes.get('tags'))) test.labels.append(utils.get_allure_thread(self.pool_id)) test.labels.append(Label(LabelType.HOST, value=host_tag())) test.labels.append( Label(name=LabelType.FRAMEWORK, value='robotframework')) test.labels.append( Label(name=LabelType.LANGUAGE, value=platform_label())) test.statusDetails = StatusDetails(message=attributes.get('message')) test.description = attributes.get('doc') last_link = list(self.links.values())[-1] if self.links else None if attributes.get(Severity.CRITICAL, 'no') == 'yes': test.labels.append( Label(name=LabelType.SEVERITY, value=Severity.CRITICAL)) if last_link: test.links.append(Link(LinkType.LINK, last_link, 'Link')) test.stop = now() self.reporter.close_test(uuid)
def stop_current_test(self, name, attributes): uuid = self.stack.pop() test = self.reporter.get_test(uuid) test.status = utils.get_allure_status(attributes.get('status')) test.labels.extend(utils.get_allure_suites(attributes.get('longname'))) test.labels.extend(allure_tags(attributes)) for label_type in (LabelType.EPIC, LabelType.FEATURE, LabelType.STORY): test.labels.extend(allure_labels(attributes, label_type)) for link_type in (LinkType.ISSUE, LinkType.TEST_CASE, LinkType.LINK): test.links.extend(allure_links(attributes, link_type)) test.labels.append(Label(name=LabelType.THREAD, value=self.pool_id)) test.labels.append(Label(name=LabelType.HOST, value=host_tag())) test.labels.append(Label(name=LabelType.FRAMEWORK, value='robotframework')) test.labels.append(Label(name=LabelType.LANGUAGE, value=platform_label())) test.statusDetails = StatusDetails(message=attributes.get('message'), trace=self.get_traceback_message()) test.description = attributes.get('doc') last_link = list(self.links.values())[-1] if self.links else None if attributes.get(Severity.CRITICAL, 'no') == 'yes': test.labels.append(Label(name=LabelType.SEVERITY, value=Severity.CRITICAL)) if last_link: test.links.append(Link(LinkType.LINK, last_link, 'Link')) test.stop = now() self.reporter.close_test(uuid)