diff --git a/config.xml b/config.xml index 16a0a41..17a5995 100644 --- a/config.xml +++ b/config.xml @@ -1,4 +1,4 @@ - v2.7.20 + v2.7.21 Configuration file for the application \ No newline at end of file diff --git a/ui/analytics/analytics_widget.py b/ui/analytics/analytics_widget.py index 656c98c..057b34b 100644 --- a/ui/analytics/analytics_widget.py +++ b/ui/analytics/analytics_widget.py @@ -47,7 +47,7 @@ def _init_ui(self): # Export Button self.export_button = QPushButton() - self.export_button.setIcon(QIcon(resource_path("images/excel.png"))) # Use your Excel icon + self.export_button.setIcon(QIcon(resource_path("images/excel.png"))) self.export_button.setIconSize(QSize(16, 16)) self.export_button.setText(" Export Analytics") self.export_button.setStyleSheet(""" diff --git a/ui/help/help_widget.py b/ui/help/help_widget.py index d7c09bf..09d126f 100644 --- a/ui/help/help_widget.py +++ b/ui/help/help_widget.py @@ -21,9 +21,9 @@ def __init__(self, icon_path, text="", parent=None): self.text = text self.icon = QIcon(resource_path(f"images/{icon_path}")) self.icon_size = 60 - self._radius = 45 # Internal radius property + self._radius = 45 self.hover_radius = 50 - self.base_radius = 45 # Added missing attribute + self.base_radius = 45 # Colors self.base_color = QColor(69, 71, 90, 80) @@ -72,7 +72,7 @@ def enterEvent(self, event): def leaveEvent(self, event): self.animation.stop() self.animation.setStartValue(self._radius) - self.animation.setEndValue(self.base_radius) # Now using the correct attribute + self.animation.setEndValue(self.base_radius) self.animation.start() super().leaveEvent(event) @@ -206,8 +206,8 @@ def init_ui(self): layout.addLayout(buttons_layout) config_paths = [ - 'config.xml', # Development path - os.path.join(os.path.dirname(sys.executable), 'config.xml'), # EXE location + 'config.xml', + os.path.join(os.path.dirname(sys.executable), 'config.xml'), ] config_loaded = False diff --git a/ui/main_window.py b/ui/main_window.py index 4efc8f5..a10363a 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -46,11 +46,10 @@ def __init__(self): def _load_config(self): try: - # Try multiple paths to locate the config file config_paths = [ - 'config.xml', # Development path - os.path.join(os.path.dirname(sys.executable), 'config.xml'), # EXE location - os.path.join(sys._MEIPASS, 'config.xml') # PyInstaller temp directory + 'config.xml', + os.path.join(os.path.dirname(sys.executable), 'config.xml'), + os.path.join(sys._MEIPASS, 'config.xml') ] config_loaded = False diff --git a/utils/dashboard_utils.py b/utils/dashboard_utils.py index 42caf48..d076673 100644 --- a/utils/dashboard_utils.py +++ b/utils/dashboard_utils.py @@ -38,12 +38,12 @@ def load_data(self): for suite in root.findall('.//suite'): status = suite.find('.//status') if status is not None: - # Parse Robot Framework timestamp format (YYYYMMDD HH:MM:SS.SSS) + timestamp_str = status.get('starttime') try: timestamp = datetime.strptime(timestamp_str, "%Y%m%d %H:%M:%S.%f") except ValueError: - # Fallback if milliseconds are missing + timestamp = datetime.strptime(timestamp_str, "%Y%m%d %H:%M:%S") stats['recent_runs'].append({ @@ -52,7 +52,7 @@ def load_data(self): 'status': 'PASS' if status.get('status') == 'PASS' else 'FAIL' }) - # Calculate execution time + endtime_str = status.get('endtime') try: endtime = datetime.strptime(endtime_str, "%Y%m%d %H:%M:%S.%f") diff --git a/utils/file_utils.py b/utils/file_utils.py index 393cd38..218392a 100644 --- a/utils/file_utils.py +++ b/utils/file_utils.py @@ -9,10 +9,10 @@ def select_directory(window): window.label.setText(f"Selected: {dir_path}") os.makedirs(os.path.join(dir_path, "Results"), exist_ok=True) window.testList.clear() - from utils.test_utils import load_tests # Import here to avoid circular import + from utils.test_utils import load_tests load_tests(window) else: - from utils.display_utils import show_cross # Import here + from utils.display_utils import show_cross show_cross(window) window.label.setStyleSheet("color: #ad402a") @@ -22,10 +22,10 @@ def select_output_directory(window): window.output_directory = dir_path window.fileLabel.setText(f"Results saved in: {dir_path}") window.fileLabel.setStyleSheet("color: green") - # Update the dashboard loader + if hasattr(window, 'dashboard_loader'): window.dashboard_loader.set_results_dir(dir_path) - # Optional: trigger immediate refresh + window.dashboard_loader.load_data(force=True) def clear_results_directory(window): diff --git a/utils/resource_utils.py b/utils/resource_utils.py index 5ce45c0..49fa80f 100644 --- a/utils/resource_utils.py +++ b/utils/resource_utils.py @@ -4,11 +4,10 @@ def resource_path(relative_path): """Get absolute path to resource, works for dev and for PyInstaller""" try: - # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: - base_path = os.path.abspath(".") # Use current directory as base path + base_path = os.path.abspath(".") full_path = os.path.join(base_path, relative_path) - print(f"Looking for resource at: {full_path}") # Debug print + print(f"Looking for resource at: {full_path}") return full_path \ No newline at end of file diff --git a/utils/test_utils.py b/utils/test_utils.py index 746fbbf..fc99d18 100644 --- a/utils/test_utils.py +++ b/utils/test_utils.py @@ -89,8 +89,8 @@ def run_tests(window): # Wait for output.xml to be generated output_path = os.path.join(window.output_directory, "output.xml") - max_wait = 15 # seconds - wait_interval = 0.5 # seconds + max_wait = 15 + wait_interval = 0.5 for _ in range(int(max_wait / wait_interval)): if os.path.exists(output_path) and os.path.getsize(output_path) > 0: @@ -264,7 +264,7 @@ def export_results(window): try: os.startfile(excel_path) except: - pass # Silently fail if can't auto-open + pass else: window.resultLabel.setText("Failed to create report file") window.resultLabel.setStyleSheet("color: #ad402a")