Skip to content

Commit

Permalink
Take more screenshot and add logs for BM LSO deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Balogh <[email protected]>
  • Loading branch information
petr-balogh committed Aug 1, 2024
1 parent 6088591 commit a94c262
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocs_ci/ocs/ui/base_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,21 @@ def select_checkbox_status(self, status, locator):
if status != current_status:
self.do_click(locator=locator)

def check_element_text(self, expected_text, element="*"):
def check_element_text(self, expected_text, element="*", take_screenshot=False):
"""
Check if the text matches the expected text.
Args:
expected_text (string): The expected text.
element (str): element (default: *)
take_screenshot (bool): if screenshot should be taken
return:
bool: True if the text matches the expected text, False otherwise
"""
if take_screenshot:
self.take_screenshot()
element_list = self.driver.find_elements_by_xpath(
f"//{element}[contains(text(), '{expected_text}')]"
)
Expand Down
4 changes: 4 additions & 0 deletions ocs_ci/ocs/ui/deployment_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ def verify_disks_lso_attached(self, timeout=600, sleep=20):
capacity_str = str(capacity / 1024).rstrip("0").rstrip(".") + " TiB"
else:
capacity_str = str(capacity) + " GiB"
logger.info(f"Waiting for {capacity_str}")
sample = TimeoutSampler(
timeout=timeout,
sleep=sleep,
func=self.check_element_text,
expected_text=capacity_str,
take_screenshot=True,
)
if not sample.wait_for_func_status(result=True):
raise TimeoutExpiredError(f"Disks are not attached after {timeout} seconds")
Expand Down Expand Up @@ -226,6 +228,7 @@ def install_lso_cluster(self):
text=constants.LOCAL_BLOCK_RESOURCE,
timeout=300,
)
self.take_screenshot()
self.do_send_keys(
locator=self.dep_loc["sc_name"], text=constants.LOCAL_BLOCK_RESOURCE
)
Expand All @@ -238,6 +241,7 @@ def install_lso_cluster(self):
constants.BAREMETAL_PLATFORM,
constants.HCI_BAREMETAL,
]:
self.take_screenshot()
self.verify_disks_lso_attached()
timeout_next = 60
else:
Expand Down

0 comments on commit a94c262

Please sign in to comment.