Skip to content

Commit

Permalink
add redunancy _check_all_rules_exist (#8713)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Osypenko <[email protected]>
  • Loading branch information
DanielOsypenko authored Nov 13, 2023
1 parent 41418ab commit e3343af
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions ocs_ci/ocs/ui/page_objects/data_foundation_tabs_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ocs_ci.utility.retry import retry
from ocs_ci.ocs.ui.base_ui import logger, wait_for_element_to_be_visible
from ocs_ci.ocs.ui.page_objects.page_navigator import PageNavigator
from ocs_ci.utility.utils import TimeoutSampler


class CreateResourceForm(PageNavigator):
Expand Down Expand Up @@ -61,16 +62,27 @@ def check_error_messages(self):
def _verify_input_requirements(self):
"""
Verify that all input requirements are met.
"""
rules_texts_ok = self._check_all_rules_exist(
self.generic_locators["text_input_popup_rules"]
)
self.test_results.loc[len(self.test_results)] = [
None,
self._check_all_rules_exist.__name__,
rules_texts_ok,
]
Function retries to get all error message rule texts during 120 seconds.
"""
# verify that all rules exist when input rules popup is visible
for sample in TimeoutSampler(
120,
3,
self._check_all_rules_exist,
self.generic_locators["text_input_popup_rules"],
):
if sample:
self.test_results.loc[len(self.test_results)] = [
None,
self._check_all_rules_exist.__name__,
True,
]
break
else:
self.do_click(self.validation_loc["input_value_validator_icon"])
logger.info("retrying get all error message rule texts")

# invoke execution of every rule-checker function
for rule, func in self.rules.items():
res = func(rule)
self.test_results.loc[len(self.test_results)] = [rule, func.__name__, res]
Expand Down

0 comments on commit e3343af

Please sign in to comment.