Skip to content

search button not getting clicked on activation key page due to different locator - #1939

Merged
LadislavVasina1 merged 2 commits into
SatelliteQE:masterfrom
jnagare-redhat:search_activation_key_fix
Aug 4, 2025
Merged

search button not getting clicked on activation key page due to different locator#1939
LadislavVasina1 merged 2 commits into
SatelliteQE:masterfrom
jnagare-redhat:search_activation_key_fix

Conversation

@jnagare-redhat

@jnagare-redhat jnagare-redhat commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Summary:
Search button not getting clicked on activation key page due to different locator
Reason:

  • We have search button on activation key page
  • But other pages have search arrow and currently we are using locator of search arrow Fix :
  • We can add locator with or condition to avoid breaking existing test cases
  • PF5Button(locator=".//button[@aria-label='Search'] | .//button[span[normalize-space(.)='Search']]")

Summary by Sourcery

Fix search button locator to support both activation key and other pages and ensure activation key view is displayed before interaction

Bug Fixes:

  • Correct search button locator in Search widget to handle activation key page button

Enhancements:

  • Add view.wait_displayed() in ActivationKeyEntity.create to wait for the view before filling values

… to wrong locator

Reason:
- We have search button on activation key page
- But other pages have search arrow and currently we are using locator of search arrow
Fix :
- We can add locator with or condition to avoid breaking existing test cases
- PF5Button(locator=".//button[@aria-label='Search'] | .//button[span[normalize-space(.)='Search']]")
@sourcery-ai

sourcery-ai Bot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR enhances the search button locator to support both activation key and other pages without breaking existing tests, and adds a wait step to the activation key creation workflow to ensure the form is ready before interaction.

Sequence diagram for activation key creation with wait step

sequenceDiagram
    actor Tester
    participant ActivationKeyEntity
    participant View
    Tester->>ActivationKeyEntity: create(values)
    ActivationKeyEntity->>View: navigate_to('New')
    ActivationKeyEntity->>View: wait_displayed()
    ActivationKeyEntity->>View: fill(values)
    ActivationKeyEntity->>View: submit.click()
Loading

Class diagram for updated Search widget and ActivationKeyEntity

classDiagram
    class Search {
        +PF5Button search_button
        +Text clear_button
    }
    class PF5Button {
        +locator
    }
    class ActivationKeyEntity {
        +create(values)
    }
    Search --> PF5Button : uses
    ActivationKeyEntity --> "1" View : uses
    class View {
        +wait_displayed()
        +fill(values)
        +submit
    }
Loading

File-Level Changes

Change Details Files
Broadened search button locator to match both span-based and aria-label-based buttons
  • Replaced locator string with an or-condition combining span text and aria-label selectors
airgun/widgets.py
Added synchronization before interacting with the activation key creation view
  • Inserted view.wait_displayed() immediately after navigation to the 'New' activation key view
airgun/entities/activationkey.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @jnagare-redhat - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jnagare-redhat jnagare-redhat added No-CherryPick PR doesnt need CherryPick to previous branches pre-commit.ci autofix labels Jul 31, 2025
@jnagare-redhat

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k test_positive_create_with_cv

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jul 31, 2025
@jnagare-redhat

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k test_positive_create_with_cv

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Aug 1, 2025

@LadislavVasina1 LadislavVasina1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK, good addition @jnagare-redhat!

@LadislavVasina1
LadislavVasina1 merged commit 6418245 into SatelliteQE:master Aug 4, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants