Adding some more check for exists in web ui classes
Another simple test with some more examples. Change-Id: I4188eb6a743123eee22ce7bf48915f055922f3e9 Signed-off-by: jpike <jason.pike@windriver.com>
This commit is contained in:
29
framework/web/action/web_action_is_exists.py
Normal file
29
framework/web/action/web_action_is_exists.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
|
||||
from framework.web.action.web_action import WebAction
|
||||
|
||||
|
||||
class WebActionIsExists(WebAction):
|
||||
"""
|
||||
Class representing a Web Is Exists action.
|
||||
"""
|
||||
|
||||
def perform_action(self, web_element: WebElement, *args):
|
||||
"""
|
||||
Override the parent's perform action with a check for exists
|
||||
Args:
|
||||
web_element: Element to check if it exists.
|
||||
*args: Unused arguments to follow the override signature.
|
||||
|
||||
Returns: None
|
||||
|
||||
"""
|
||||
return web_element.is_displayed()
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
String representation of this action.
|
||||
Returns:
|
||||
|
||||
"""
|
||||
return "IS_EXISTS"
|
||||
Reference in New Issue
Block a user