From 29d345eb1db1ec7fd75b35ee98f16d09c52c123a Mon Sep 17 00:00:00 2001 From: Saqib Date: Fri, 11 Sep 2026 17:09:54 +0530 Subject: [PATCH] fix: scope SDG Goals and Geography locators to combobox role TAGS_INPUT and SECTOR_INPUT in the same file already scope their following::input search to [@role='combobox'], but SDG_GOALS_CONTAINER and GEOGRAPHY_CONTAINER were never updated to match -- both still used the bare unscoped following::input[1], which can grab any intervening non-combobox input (date pickers, file uploads, etc.) depending on render timing/DOM state. This is exactly the aliasing class of bug get_pill_texts() was already hardened against (see its docstring) -- but that only helps once the input locator itself is correct. Reproduced live: a real deploy run's smoke test read back 'Budget' as the selected SDG goal instead of the requested '13' (Climate Action) -- prod's actual SDG data is fully correct (verified directly), confirming the wrong was targeted, not a data issue. --- locators/provider/create_usecase_locators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locators/provider/create_usecase_locators.py b/locators/provider/create_usecase_locators.py index ec5a26d..9029eb3 100644 --- a/locators/provider/create_usecase_locators.py +++ b/locators/provider/create_usecase_locators.py @@ -24,10 +24,10 @@ class CreateUsecaseLocators: SECTOR_INPUT = (By.XPATH,"//label[normalize-space()='Sectors' or normalize-space()='Sectors *']/following::input[@role='combobox'][1]") SECTOR_DROPDOWN_ITEM = "//div[@role='option' and normalize-space(.)='{value}']" - GEOGRAPHY_CONTAINER = (By.XPATH,"//label[normalize-space()='Geographies' or normalize-space()='Geography *' or normalize-space()='Geography']/following::input[1]") + GEOGRAPHY_CONTAINER = (By.XPATH,"//label[normalize-space()='Geographies' or normalize-space()='Geography *' or normalize-space()='Geography']/following::input[@role='combobox'][1]") GEO_OPTION = "//div[@role='option' and starts-with(normalize-space(.), '{value}')]" - SDG_GOALS_CONTAINER = (By.XPATH,"//label[normalize-space()='SDG Goals *' or normalize-space()='SDG Goal *' or contains(text(),'SDG')]/following::input[1]") + SDG_GOALS_CONTAINER = (By.XPATH,"//label[normalize-space()='SDG Goals *' or normalize-space()='SDG Goal *' or contains(text(),'SDG')]/following::input[@role='combobox'][1]") SDG_GOALS_OPTION = "//div[@role='option' and normalize-space(.)='{value}']" STARTED_ON_INPUT = (By.XPATH, "//input[@type='date' and @name='startedOn']")