Skip to content

Commit 2a97432

Browse files
test: Enhance US04 test with additional logging and screenshot after clicking calculate button
1 parent 8d77239 commit 2a97432

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/us4.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,15 @@ def test_us04_verify_calculation_of_current_weighted_average(self):
248248
self._add_grade_and_percentage("4.5", "20") # Adds and clicks "Agregar nota"
249249

250250
calculate_button = self.wait_long.until(EC.element_to_be_clickable((By.CSS_SELECTOR, self.CALCULATE_BUTTON_SELECTOR)))
251+
logger.info(f"Before clicking 'Calcular'. Current URL: {self.driver.current_url}")
251252
calculate_button.click()
252-
logger.info("Clicked 'Calcular' button. Expecting navigation to /result.")
253+
logger.info(f"Immediately after attempting to click 'Calcular'. Current URL: {self.driver.current_url}")
254+
self._take_screenshot("after_calculate_click_attempt") # Screenshot right after click
255+
time.sleep(1) # Small pause to allow DOM changes/navigation to initiate
253256

254-
# Wait for navigation to result page and for the average display to be ready
255-
self.wait_long.until(EC.url_contains("/result"))
256-
logger.info(f"Navigated to {self.driver.current_url}")
257+
logger.info(f"After 1s delay. Current URL: {self.driver.current_url}. Now waiting for URL to contain '/result'...")
258+
self.wait_long.until(EC.url_contains("/result")) # This is where the timeout occurs
259+
logger.info(f"Successfully navigated to {self.driver.current_url}. Checking for result container.")
257260

258261
current_avg_1 = self._get_current_weighted_average()
259262
expected_avg_1 = 0.9 # (4.5 * 20) / 100 = 90 / 100 = 0.9

0 commit comments

Comments
 (0)