Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take more screenshot and add logs for BM LSO deployment #10232

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
6 changes: 5 additions & 1 deletion 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 @@ -234,10 +237,11 @@ def install_lso_cluster(self):
self.do_click(
locator=self.dep_loc["all_nodes_create_sc"], enable_screenshot=True
)
if config.ENV_DATA.get("platform") in [
if config.ENV_DATA.get("platform") not in [
constants.BAREMETAL_PLATFORM,
constants.HCI_BAREMETAL,
]:
self.take_screenshot()
self.verify_disks_lso_attached()
timeout_next = 60
else:
Expand Down
Loading