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 entity that reads filled searchbox on new and old hosts pages #1589

Merged

Conversation

LadislavVasina1
Copy link
Contributor

Add an entity read_filled_searchbox to the host.py (old hosts UI) and all_hosts.py (new hosts UI) so that it can be used in the automation.

Usage:

  • Old UI
with target_sat.ui_session() as session:
    session.host.search('some_search_string')
    read_searchbox_value = session.host.read_filled_searchbox()
    print(read_searchbox_value)
  • New UI
with target_sat.ui_session() as session:
    session.all_hosts.search('some_search_string')
    read_searchbox_value = session.all_hosts.read_filled_searchbox()
    print(read_searchbox_value)

@LadislavVasina1 LadislavVasina1 added entity Related to entity coverage CherryPick PR needs CherryPick to previous branches 6.16.z labels Oct 7, 2024
@LadislavVasina1 LadislavVasina1 self-assigned this Oct 7, 2024
Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

Codewisely looks good to me, one question - shouldn't this be always True?

read_searchbox_value == 'some_search_string'

Or what should I expect to change here and why?

@LadislavVasina1
Copy link
Contributor Author

@vsedmik I don't know if I get your last comment, where do you specifically see usage of the == operator?

@vsedmik
Copy link
Contributor

vsedmik commented Oct 7, 2024

@LadislavVasina1 I just meant the example you provided in the PR description

with target_sat.ui_session() as session:
    session.all_hosts.search('some_search_string')
    read_searchbox_value = session.all_hosts.read_filled_searchbox()
    # here I would always expect read_searchbox_value == 'some_search_string'
    # so I just wondered why we need the read function

@LadislavVasina1
Copy link
Contributor Author

@vsedmik I made this read function for vijay so he has an easier job in his current work, if that's what you are asking

Comment on lines +87 to +93
def read_filled_searchbox(self):
"""Read filled searchbox"""
view = self.navigate_to(self, 'All')
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
return view.searchbox.read()

Copy link
Contributor

Choose a reason for hiding this comment

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

These changes are working absolutely fine, I tested it locally, and now running in CI as part of this robottelo PR SatelliteQE/robottelo#16641
These changes are here in another airgun PR #1593

@vijaysawant vijaysawant merged commit 4cb153e into SatelliteQE:master Oct 10, 2024
7 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 10, 2024
)

* Add entity that reads filled searchbox on new and old hosts pages

* Change docstrings

(cherry picked from commit 4cb153e)
vsedmik pushed a commit that referenced this pull request Oct 10, 2024
) (#1594)

* Add entity that reads filled searchbox on new and old hosts pages

* Change docstrings

(cherry picked from commit 4cb153e)

Co-authored-by: Ladislav Vašina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.16.z CherryPick PR needs CherryPick to previous branches entity Related to entity coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants