botcity-dev / botcity-framework-web-python

BotCity Framework Web - Python
https://documentation.botcity.dev/frameworks/web/
Apache License 2.0
40 stars 19 forks source link

FIX: 'click_on()' method #34

Closed lf2a closed 2 years ago

lf2a commented 2 years ago

@only_if_element raises an error because self.state.element is None. self.click(x, y) doesn't have x, y params.

@only_if_element
def click_on(self, label):
    """
    Click on the element.

    Args:
        label (str): The image identifier
    """
    x, y = self.get_element_coords_centered(label)
    self.click(x, y)