-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add operations for automation #4250
base: main
Are you sure you want to change the base?
Add operations for automation #4250
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: NamrathaRao24 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 |
ceph/UI/helper.py
Outdated
from selenium.webdriver.support.ui import WebDriverWait | ||
|
||
|
||
def take_ss(driver, filename: str): |
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 give meaningful method name. "capture_screen" or "screenshot" etc
ceph/UI/helper.py
Outdated
def take_ss(driver, filename: str): | ||
"""Takes a screenshot and saves it to the specified filename.""" | ||
try: | ||
driver.save_screenshot(filename) |
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.
Add logic on returning the screenshot path. The user should be able to get the file name upon calling this method
ceph/UI/helper.py
Outdated
raise RuntimeError(f"Failed to take screenshot: {e}") | ||
|
||
|
||
def wait_for_element(driver, element_id: str, timeout: int = 10): |
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.
Extend the logic for all element types like class, name, xpath, css selector etc and not just to id.
ceph/UI/operations.py
Outdated
try: | ||
username_field = self.driver.find_element_by_id("username") | ||
password_field = self.driver.find_element_by_id("password") | ||
login_button = self.driver.find_element_by_id("login") |
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.
Add logic to make it generic. Not always its the id, it can accept all other identifiers.
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 revisit the changes requested
@NamrathaRao24 Please add a more meaningful commit message |
Signed-off-by: nrao <nrao@redhat.com>
6592faa
to
388b6e0
Compare
Description
Please include Automation development guidelines. Source of Test case - New Feature/Regression Test/Close loop of customer BZs
click to expand checklist