add angualar date picker support (#1955)

Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
This commit is contained in:
Shuchang Zheng
2025-03-17 12:12:16 -07:00
committed by GitHub
parent 2dbc00385f
commit 6cc595d04c
3 changed files with 71 additions and 15 deletions

View File

@@ -1101,22 +1101,9 @@ async def handle_select_option_action(
await incremental_scraped.start_listen_dom_increment()
await skyvern_element.scroll_into_view()
try:
await skyvern_element.get_locator().click(timeout=timeout)
except Exception:
LOG.info(
"fail to open dropdown by clicking, try to press ArrowDown to open",
exc_info=True,
element_id=skyvern_element.get_id(),
task_id=task.task_id,
step_id=step.step_id,
)
await skyvern_element.scroll_into_view()
await skyvern_element.press_key("ArrowDown")
await skyvern_element.click(page=page, dom=dom, timeout=timeout)
# wait 5s for options to load
await asyncio.sleep(5)
is_open = True
incremental_element = await incremental_scraped.get_incremental_element_tree(
clean_and_remove_element_tree_factory(task=task, step=step, check_filter_funcs=[dom.check_id_in_dom]),
@@ -1140,6 +1127,7 @@ async def handle_select_option_action(
if len(incremental_element) == 0:
raise NoIncrementalElementFoundForCustomSelection(element_id=skyvern_element.get_id())
is_open = True
# TODO: support sequetially select from dropdown by value, just support single select now
result = await sequentially_select_from_dropdown(
action=action,
@@ -2222,7 +2210,7 @@ async def select_from_dropdown(
return single_select_result
await selected_element.scroll_into_view()
await selected_element.get_locator().click(timeout=timeout)
await selected_element.click(page=page, timeout=timeout)
single_select_result.action_result = ActionSuccess()
return single_select_result
except (MissingElement, MissingElementDict, MissingElementInCSSMap, MultipleElementsFound):