From ca9c131486e353a97592aa20f8b1e411cb88038f Mon Sep 17 00:00:00 2001 From: jpike Date: Wed, 20 Aug 2025 08:39:43 -0400 Subject: [PATCH] Adding some more check for exists in web ui classes Another simple test with some more examples. Change-Id: I4188eb6a743123eee22ce7bf48915f055922f3e9 Signed-off-by: jpike --- framework/web/action/web_action_is_exists.py | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 framework/web/action/web_action_is_exists.py diff --git a/framework/web/action/web_action_is_exists.py b/framework/web/action/web_action_is_exists.py new file mode 100644 index 00000000..bb88c2b5 --- /dev/null +++ b/framework/web/action/web_action_is_exists.py @@ -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"