fix spinbutton issue (#806)

This commit is contained in:
LawyZheng
2024-09-11 11:53:47 +08:00
committed by GitHub
parent 9084bca30a
commit f429d6d51e
2 changed files with 27 additions and 9 deletions

View File

@@ -197,6 +197,22 @@ class SkyvernElement:
button_type = await self.get_attr("type")
return button_type == "radio"
async def is_spinbtn_input(self) -> bool:
"""
confirm the element is:
1. <input> element
2. role=spinbutton
Usage of <input role="spinbutton">, https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role
"""
if self.get_tag_name() != InteractiveElement.INPUT:
return False
if await self.get_attr("role") == "spinbutton":
return True
return False
def is_interactable(self) -> bool:
return self.__static_element.get("interactable", False)