test/framework/web/condition/web_condition_element_visible.py
croy 82d417b9e6 New StarlingX Automation Framework
Fresh start for the StarlingX automation framework.

Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
2024-11-29 16:01:57 -05:00

29 lines
798 B
Python

from framework.web.condition.web_condition import WebCondition
class WebConditionElementVisible(WebCondition):
"""
This Web Condition will check if the WebElement is Visible on the screen.
"""
def is_condition_satisfied(self, webdriver) -> bool:
"""
This function will evaluate the web_condition and return True if it is satisfied and False otherwise.
Returns:
"""
web_element = webdriver.find_elements(self.get_web_locator().get_by(), self.get_web_locator().get_locator())
is_element_found = len(web_element) > 0
return is_element_found
def __str__(self):
"""
Nice String representation for this condition.
Returns:
"""
return f"ElementVisible - {self.get_web_locator()}"