Esempio n. 1
0
 def attach(self, title, contents, attach_type):
     """
     Attaches ``contents`` with ``title`` and ``attach_type`` to the current active thing
     """
     attach = Attach(source=self._save_attach(contents, attach_type=attach_type),
                     title=title,
                     type=attach_type)
     self.stack[-1].attachments.append(attach)
Esempio n. 2
0
 def attach(self, title, contents, attach_type):
     """
     Store attachment object in current state for later actual write in the `AllureAgregatingListener.write_attach`
     """
     attach = Attach(source=contents,  # we later re-save those, oh my...
                     title=title,
                     type=attach_type)
     self.stack[-1].attachments.append(attach)
Esempio n. 3
0
 def attach(self, title, contents, attach_type=AttachmentType.PNG):
     """
     This functions created the attachments and append it to the test.
     """
     contents = os.path.join(self.logdir, contents)
     with open(contents, 'rb') as f:
         file_contents = f.read()
     
     attach = Attach(source=self.AllureImplc._save_attach(file_contents, attach_type),
                     title=title,
                     type=attach_type)
     self.stack[-1].attachments.append(attach)
     return
    def attach(self, title, contents, attach_type=AttachmentType.PNG):
        """
        This functions created the attachments and append it to the test.
        """
#         logger.console("attach-title: "+title)
        contents = os.path.join(BuiltIn().get_variable_value('${OUTPUT_DIR}'), contents)
        with open(contents, 'rb') as f:
            file_contents = f.read()
        
        attach = Attach(source=self.AllureImplc._save_attach(file_contents, attach_type),
                        title=title,
                        type=attach_type)

        self.stack[-1].attachments.append(attach)
        return