red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
108 stars 166 forks source link

make test_unprivileged_user_odf_access work on ROSA and ROSA HCP #10554

Open DanielOsypenko opened 1 month ago

DanielOsypenko commented 1 month ago

fix the error:

[2024-09-20T03:20:18.852Z] self = ValidationUI Web Page, locator = ('page-sidebar', 'id')
[2024-09-20T03:20:18.852Z] attribute = 'innerHTML', safe = False
[2024-09-20T03:20:18.852Z] 
[2024-09-20T03:20:18.852Z]     def get_element_attribute(self, locator, attribute, safe: bool = False):
[2024-09-20T03:20:18.852Z]         """
[2024-09-20T03:20:18.852Z]         Get attribute from WebElement
[2024-09-20T03:20:18.852Z]     
[2024-09-20T03:20:18.852Z]         Args:
[2024-09-20T03:20:18.852Z]             locator (tuple): (GUI element needs to operate on (str), type (By)).
[2024-09-20T03:20:18.852Z]             attribute (str): the value of this attribute will be extracted from WebElement
[2024-09-20T03:20:18.852Z]             safe(bool): if True exception will not raise when element not found. Default option - not safe
[2024-09-20T03:20:18.852Z]     
[2024-09-20T03:20:18.852Z]         Returns:
[2024-09-20T03:20:18.852Z]             str: value of the attribute of requested and found WebElement
[2024-09-20T03:20:18.852Z]         """
[2024-09-20T03:20:18.852Z]         web_elements = self.get_elements(locator)
[2024-09-20T03:20:18.852Z]         if safe:
[2024-09-20T03:20:18.852Z]             if not len(web_elements):
[2024-09-20T03:20:18.852Z]                 return
[2024-09-20T03:20:18.852Z] >       return web_elements[0].get_attribute(attribute)
[2024-09-20T03:20:18.852Z] E       IndexError: list index out of range
[2024-09-20T03:20:18.852Z] 
[2024-09-20T03:20:18.852Z] ocs_ci/ocs/ui/base_ui.py:465: IndexError

Test-run with failure: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster/42269/   g-drive |   | https://drive.google.com/drive/folders/1JQI9VOKrdVOR4254tajS7XDXdux2pq87?usp=sharing

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DanielOsypenko

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/red-hat-storage/ocs-ci/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
DanielOsypenko commented 1 month ago

verified https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster/42382/console