-
Notifications
You must be signed in to change notification settings - Fork 170
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
Testing new Object Storage Page[WIP] #11083
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AviadP The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
create bucket via OBC create bucket via s3 upload folder and file to bucket Signed-off-by: Aviadp <[email protected]>
Signed-off-by: Aviadp <[email protected]>
""" | ||
A class representation for abstraction of Buckets tab related OpenShift UI actions | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we do serious changes here, can you pls along this remove super().__init__()
from the constructor? it is unnecessary and takes time to instantiate parents up to BaseUI.
|
||
folder_path = self.generate_folder_with_file() | ||
|
||
time.sleep(2) # Wait for folder navigation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally we try to find wait-and-check solutions if we depend on timing
arguments[0].style.opacity = '1'; | ||
""", | ||
file_input, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use js scripts. It is not checking UX, because all the web elements may be hidden or overlayed but still be available for script.
remove webkitdirectory
changes the behavior of the product, s we check not management-console, but modified management-console.
arguments[0].removeAttribute('directory') same as above; this way we make input element accept files, not directories.
Question: is something in UI hidden or not interactable via locators that forces us to use this script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is something in UI hidden or not interactable via locators that forces us to use this script?
As far as i could find, yes
"submit_button_obc": ( | ||
"[data-test='obc-create']", | ||
By.CSS_SELECTOR, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apart from these locators: [data-test='bucket-name'], [data-test='obc-create'], //*[@id='yaml-create'], //button[contains(text(), 'Upload')]" that are unique other locators cant be considered good. HTML changes and even slight change of the DOM will shift indexes, relation between css elements, etc.
We need to find unique locators, not using indexes of common elements. Also this relation with multiple parents and childen elements]/section/div[2]/div[1]/div/div[2]/div[1]/div[2]
may change even without changes from devs, but with different user inputs.
In opposite, rigid locators, like "//*[@id='yaml-create'] or [data-test='bucket-name'] will continue work even with changes on page from development.
self.do_click(self.bucket_tab["create_bucket_button_obc"]) | ||
self.do_click(self.bucket_tab["storage_class_dropdown"]) | ||
self.do_click(self.bucket_tab["storage_class_noobaa_option"]) | ||
self.do_click(self.bucket_tab["submit_button_obc"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this function return Page Object. It should return the instance of the web-page where user left after clicking submit_button_obc
|
||
return folder_path | ||
|
||
def create_bucket_ui(self, method): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this function return Page Object. It should return the instance of the web-page where user left after clicking self.create_bucket_via_obc() or self.create_bucket_via_s3()
4.18 new feature