コード例 #1
0
ファイル: base_plugin.py プロジェクト: ktp420/SeleniumBase
 def configure(self, options, conf):
     super(Base, self).configure(options, conf)
     if not self.enabled:
         return
     self.options = options
     log_path = options.log_path
     self.report_on = options.report
     self.show_report = options.show_report
     if log_path.endswith("/"):
         log_path = log_path[:-1]
     if not os.path.exists(log_path):
         os.makedirs(log_path)
     else:
         archived_folder = "%s/../archived_logs/" % log_path
         if not os.path.exists(archived_folder):
             os.makedirs(archived_folder)
         archived_logs = "%slogs_%s" % (archived_folder, int(time.time()))
         shutil.move(log_path, archived_logs)
         os.makedirs(log_path)
         if not settings.ARCHIVE_EXISTING_LOGS:
             shutil.rmtree(archived_logs)
     self.successes = []
     self.failures = []
     self.duration = float(0)
     self.page_results_list = []
     self.test_count = 0
     self.import_error = False
     if self.report_on:
         report_helper.clear_out_old_report_logs(archive_past_runs=False)
コード例 #2
0
 def configure(self, options, conf):
     super(Base, self).configure(options, conf)
     if not self.enabled:
         return
     self.options = options
     log_path = options.log_path
     self.report_on = options.report
     self.show_report = options.show_report
     if log_path.endswith("/"):
         log_path = log_path[:-1]
     if not os.path.exists(log_path):
         os.makedirs(log_path)
     else:
         archived_folder = "%s/../archived_logs/" % log_path
         if not os.path.exists(archived_folder):
             os.makedirs(archived_folder)
         archived_logs = "%slogs_%s" % (archived_folder, int(time.time()))
         shutil.move(log_path, archived_logs)
         os.makedirs(log_path)
         if not settings.ARCHIVE_EXISTING_LOGS:
             shutil.rmtree(archived_logs)
     self.successes = []
     self.failures = []
     self.start_time = float(0)
     self.duration = float(0)
     self.page_results_list = []
     self.test_count = 0
     self.import_error = False
     if self.report_on:
         report_helper.clear_out_old_report_logs(archive_past_runs=False)
コード例 #3
0
 def configure(self, options, conf):
     super(Base, self).configure(options, conf)
     self.enabled = True  # Used if test class inherits BaseCase
     self.options = options
     self.report_on = options.report
     self.show_report = options.show_report
     self.successes = []
     self.failures = []
     self.start_time = float(0)
     self.duration = float(0)
     self.page_results_list = []
     self.test_count = 0
     self.import_error = False
     log_path = options.log_path
     log_helper.log_folder_setup(log_path)
     if self.report_on:
         report_helper.clear_out_old_report_logs(archive_past_runs=False)
コード例 #4
0
 def configure(self, options, conf):
     super(Base, self).configure(options, conf)
     self.enabled = True  # Used if test class inherits BaseCase
     self.options = options
     self.report_on = options.report
     self.show_report = options.show_report
     self.successes = []
     self.failures = []
     self.start_time = float(0)
     self.duration = float(0)
     self.page_results_list = []
     self.test_count = 0
     self.import_error = False
     log_path = options.log_path
     archive_logs = options.archive_logs
     log_helper.log_folder_setup(log_path, archive_logs)
     if self.report_on:
         report_helper.clear_out_old_report_logs(archive_past_runs=False)