示例#1
0
 def log_file_path(self, doc="this returns the path till logs folder"):
     """
     this returns the path till logs folder
     """
     try:
         log_path = os.path.join("logs")
         GenericFunctions.isdir_present(log_path)
         return log_path
     except Exception as e:
         print("Error in log_file_path" + str(e))
示例#2
0
 def archive_screenshot_path(self,
                             doc="this returns the path of archive folder"):
     """
     This returns the path of execution report
     """
     try:
         archive_path = os.path.join("resources", "archive")
         GenericFunctions.isdir_present(archive_path)
         return archive_path
     except Exception as e:
         print("Error in execution report path" + str(e))
示例#3
0
 def execution_report_path(
         self, doc="this returns the path of execution report folder"):
     """
     This returns the path of execution report
     """
     try:
         report_path = os.path.join("target", "execution_report")
         GenericFunctions.isdir_present(report_path)
         return report_path
     except Exception as e:
         print("Error in execution report path" + str(e))
示例#4
0
    def screenshot_folder_path(
            self, doc="this returns the path till screenshot folder"):
        """
        this returns the path till screenshot folder
        """
        try:

            screenshot_path = os.path.join("resources", "screenshots")
            GenericFunctions.isdir_present(screenshot_path)
            return screenshot_path
        except Exception as e:
            print("Error in screenshot_folder_path" + str(e))
    def move_to_archive(self, archive_dir_path, source_dir):
        """
        Moving old files to archive folder. This is specially for execution reports
        """
        dir_name = GenericFunctions.get_filename_datetimestamp()

        print("dir_name  ", dir_name)

        if 'windows' in GenericFunctions.get_os().casefold():
            GenericFunctions.isdir_present(archive_dir_path + "\\", dir_name)
            GenericFunctions.move_directories(
                source_dir, archive_dir_path + "\\" + dir_name)
        else:
            # code for linux or mac
            pass