Skip to content

Commit 089faeb

Browse files
test: Update selectors in US05, US06, US07, and US08 for consistency and accuracy
1 parent 2eb6603 commit 089faeb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

tests/us5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _get_required_grade_or_message(self):
137137

138138
# Check for impossible to approve scenario
139139
# In result.jsx, if requiredGrade > maxValue (5), it would display an impossible value
140-
if "No es posible aprobar la materia" in raw_text or "Necesitas 11 en el" in raw_text or "Necesitas -1 en el" in raw_text:
140+
if "No es posible aprobar la materia" in raw_text or "Necesitas más de 5.0" in raw_text or "Necesitas una nota mayor a 5.0" in raw_text: # Adjusted conditions
141141
return "No es posible aprobar"
142142

143143
# Try to extract the required grade

tests/us6.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class US06Tests(unittest.TestCase):
3131
HOME_CONTAINER_SELECTOR = "div.home__container"
3232

3333
# Selector for US06 - Final Estimated Status
34-
FINAL_STATUS_DISPLAY_SELECTOR = "#final-status-display" # Based on selenium-test-dev.md (id="final-status-display")
34+
FINAL_STATUS_DISPLAY_SELECTOR = "p.result__card-final" # Updated selector based on result.jsx (p class="result__card-final")
3535

3636
# Selectors needed for setting up scenarios (from US05, though not directly tested here)
3737
REQUIRED_GRADE_DISPLAY_SELECTOR = "p.result__card-needed"

tests/us7.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class US07Tests(unittest.TestCase):
3737

3838
# Placeholder for reset button - User Story 07
3939
# The selenium-test-dev.md does not specify a selector. Common patterns: id="reset-button", text "Reiniciar", type="reset"
40-
RESET_BUTTON_SELECTOR = "button[aria-label='Reiniciar formulario de notas']" # Using aria-label for robustness
40+
RESET_BUTTON_SELECTOR = "button[aria-label='Reiniciar formulario de notas']" # Using aria-label
4141

4242
# Selectors needed for setting up scenarios (from US05, though not directly tested here)
4343
SETTINGS_NAV_BUTTON_XPATH = "//button[contains(@class, 'nav-bar__button') and .//span[contains(@class, 'settings-icon')]/svg[contains(@class, 'lucide-settings')]]"
@@ -284,7 +284,7 @@ def _get_current_weighted_average_text(self): # Adapted from US04
284284
)
285285
time.sleep(0.2)
286286
raw_text = display_element.text.strip()
287-
logger.info(f"Raw current average text: '{raw_text}'")
287+
logger.info(f"Raw current average text: \'{raw_text}\'") # Corrected f-string
288288
return raw_text
289289
except TimeoutException:
290290
logger.error(f"Timeout waiting for current average display: {self.CURRENT_AVERAGE_DISPLAY_SELECTOR}")

tests/us8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class US08Tests(unittest.TestCase):
3333
# Selectors for results verification (from US4, US5, US6)
3434
CURRENT_AVERAGE_DISPLAY_SELECTOR = "p.result__card-current"
3535
REQUIRED_GRADE_DISPLAY_SELECTOR = "p.result__card-needed"
36-
FINAL_STATUS_DISPLAY_SELECTOR = "#final-status-display"
36+
FINAL_STATUS_DISPLAY_SELECTOR = "p.result__card-final" # Corrected based on previous step for US6
3737

3838
# Selectors needed for setting up scenarios (from US05)
3939
SETTINGS_NAV_BUTTON_XPATH = "//button[contains(@class, 'nav-bar__button') and .//span[contains(@class, 'settings-icon')]/svg[contains(@class, 'lucide-settings')]]"

0 commit comments

Comments
 (0)