remove useless select support legacy (#863)

This commit is contained in:
LawyZheng
2024-09-20 10:55:07 +08:00
committed by GitHub
parent 1b2bdcb949
commit fb56cba6ba
4 changed files with 1 additions and 435 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
import asyncio
import time
from typing import Any, Dict, List
from typing import Dict, List
import structlog
from playwright._impl._errors import TimeoutError
@@ -168,21 +168,6 @@ class SkyvernFrame:
js_script = "(element) => scrollToElementTop(element)"
return await self.frame.evaluate(js_script, element)
async def get_select2_options(self, element: ElementHandle) -> List[Dict[str, Any]]:
await self.frame.evaluate(JS_FUNCTION_DEFS)
js_script = "async (element) => await getSelect2Options(element)"
return await self.frame.evaluate(js_script, element)
async def get_react_select_options(self, element: ElementHandle) -> List[Dict[str, Any]]:
await self.frame.evaluate(JS_FUNCTION_DEFS)
js_script = "async (element) => await getReactSelectOptions(element)"
return await self.frame.evaluate(js_script, element)
async def get_combobox_options(self, element: ElementHandle) -> List[Dict[str, Any]]:
await self.frame.evaluate(JS_FUNCTION_DEFS)
js_script = "async (element) => await getListboxOptions(element)"
return await self.frame.evaluate(js_script, element)
async def parse_element_from_html(self, frame: str, element: ElementHandle, interactable: bool) -> Dict:
js_script = "([frame, element, interactable]) => buildElementObject(frame, element, interactable)"
return await self.frame.evaluate(js_script, [frame, element, interactable])