use 'click' for radio button (#506)

This commit is contained in:
LawyZheng
2024-06-25 10:26:14 +08:00
committed by GitHub
parent e9846b9e3f
commit 76255c01b1
2 changed files with 29 additions and 8 deletions

View File

@@ -79,6 +79,22 @@ class SkyvernElement:
or (tag_name == "input" and "select2-input" in element_class)
)
async def is_checkbox(self) -> bool:
tag_name = self.get_tag_name()
if tag_name != "input":
return False
button_type = await self.get_attr("type")
return button_type == "checkbox"
async def is_radio(self) -> bool:
tag_name = self.get_tag_name()
if tag_name != "input":
return False
button_type = await self.get_attr("type")
return button_type == "radio"
def get_tag_name(self) -> str:
return self.__static_element.get("tagName", "")