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

Testing new Object Storage Page[WIP] #11083

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AviadP
Copy link
Contributor

@AviadP AviadP commented Dec 29, 2024

4.18 new feature

@AviadP AviadP requested review from a team as code owners December 29, 2024 09:46
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines label Dec 29, 2024
Copy link

openshift-ci bot commented Dec 29, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines and removed size/M PR that changes 30-99 lines labels Dec 30, 2024
create bucket via OBC
create bucket via s3
upload folder and file to bucket

Signed-off-by: Aviadp <[email protected]>
"""
A class representation for abstraction of Buckets tab related OpenShift UI actions
"""

def __init__(self):
super().__init__()
Copy link
Contributor

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
Copy link
Contributor

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,
)
Copy link
Contributor

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?

Copy link
Contributor Author

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,
),
Copy link
Contributor

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"])
Copy link
Contributor

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):
Copy link
Contributor

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L PR that changes 100-499 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants