|
1 | | -\ |
2 | 1 | import unittest |
3 | 2 | import os |
4 | 3 | import time |
@@ -83,7 +82,8 @@ def _take_screenshot(self, name_suffix): |
83 | 82 | logger.info(f"Screenshot saved: {screenshot_name}") |
84 | 83 | except Exception as e: |
85 | 84 | logger.error(f"Error saving screenshot {screenshot_name}: {e}") |
86 | | - def _set_approval_grade(self, approval_grade_value): |
| 85 | + |
| 86 | + def _set_approval_grade(self, approval_grade_value): |
87 | 87 | logger.info(f"Setting approval grade to: {approval_grade_value} using JavaScript injection") |
88 | 88 | # Instead of navigating to settings, set the approval grade directly using JavaScript |
89 | 89 | # This is more reliable and faster than navigating through the UI |
@@ -158,7 +158,9 @@ def _get_required_grade_or_message(self): |
158 | 158 | except Exception as e: |
159 | 159 | logger.error(f"Error getting required grade/message: {e}", exc_info=True) |
160 | 160 | self._take_screenshot("get_required_grade_error") |
161 | | - return "Error: General" def _initial_setup(self): |
| 161 | + return "Error: General" |
| 162 | + |
| 163 | + def _initial_setup(self): |
162 | 164 | if not hasattr(self, 'driver') or not self.driver: |
163 | 165 | logger.error("Driver not initialized in _initial_setup. Aborting setup.") |
164 | 166 | self.fail("Driver not initialized for test setup.") |
@@ -358,7 +360,9 @@ def _add_grade_and_percentage(self, grade, percentage): |
358 | 360 | logger.error(f"Could not find input elements in the grade row: {e}") |
359 | 361 | self._take_screenshot("input_elements_not_found") |
360 | 362 | self.fail(f"Input elements not found: {e}") |
361 | | - return def _click_calculate_and_wait_for_result_page(self): |
| 363 | + return |
| 364 | + |
| 365 | + def _click_calculate_and_wait_for_result_page(self): |
362 | 366 | calculate_button = self.wait_long.until(EC.element_to_be_clickable((By.CSS_SELECTOR, self.CALCULATE_BUTTON_SELECTOR))) |
363 | 367 | calculate_button.click() |
364 | 368 | self.wait_long.until(EC.presence_of_element_located((By.CSS_SELECTOR, self.RESULT_PAGE_CONTAINER_SELECTOR))) |
|
0 commit comments