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

Add operations for automation #4250

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

Conversation

NamrathaRao24
Copy link

Description

Please include Automation development guidelines. Source of Test case - New Feature/Regression Test/Close loop of customer BZs

click to expand checklist
  • Create a test case in Polarion reviewed and approved.
  • Create a design/automation approach doc. Optional for tests with similar tests already automated.
  • Review the automation design
  • Implement the test script and perform test runs
  • Submit PR for code review and approve
  • Update Polarion Test with Automation script details and update automation fields
  • If automation is part of Close loop, update BZ flag qe-test_coverage “+” and link Polarion test

ceph/UI/helper.py Outdated Show resolved Hide resolved
def take_ss(driver, filename: str):
"""Takes a screenshot and saves it to the specified filename."""
try:
driver.save_screenshot(filename)
Copy link
Contributor

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

raise RuntimeError(f"Failed to take screenshot: {e}")


def wait_for_element(driver, element_id: str, timeout: int = 10):
Copy link
Contributor

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.

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

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.

Copy link
Contributor

@pranavprakash20 pranavprakash20 left a 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

@pranavprakash20
Copy link
Contributor

@NamrathaRao24 Please add a more meaningful commit message

@psathyan psathyan changed the base branch from master to main December 19, 2024 05:12
Copy link

github-actions bot commented Jan 3, 2025

This Pull request has been automatically marked as STALE due to inactivity for 15 days and will be CLOSED on further inactivity on the PR for another 15 days.

Copy link
Contributor

@pranavprakash20 pranavprakash20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot added the lgtm Add this label when the PR is good to be merged label Jan 8, 2025
@psathyan
Copy link
Contributor

psathyan commented Jan 8, 2025

I am unable to find selenium module installed as part of cephci requirements. This module is being referenced in the code. Are we missing something?

Copy link
Contributor

@MohitBis MohitBis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

openshift-ci bot commented Jan 13, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MohitBis, NamrathaRao24, pranavprakash20

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

@NamrathaRao24
Copy link
Author

PRs under review, and the following points need to be addressed:

  • Move the login method to dashboard.py.
  • Introduce additional operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ceph-dashboard For Ceph dashboard GUI Automation lgtm Add this label when the PR is good to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants