Update locator and create host entity - #1936
Merged
LadislavVasina1 merged 1 commit intoAug 12, 2025
Merged
Conversation
Contributor
Reviewer's GuideThe PR refines element locators in HostsView for improved reliability and adds a wait_for wrapper around the host creation form fill to ensure synchronization before proceeding. Sequence diagram for host creation with wait_for synchronizationsequenceDiagram
participant Test as Test Code
participant HostEntity
participant Browser
participant HostsView
Test->>HostEntity: create(values)
HostEntity->>HostsView: navigate_to(self, 'New')
HostEntity->>HostsView: wait_for(view.fill(values), timeout=60)
HostsView-->>HostEntity: Form filled
HostEntity->>Browser: click(view.submit, ignore_ajax=True)
HostEntity->>Browser: plugin.ensure_page_safe(timeout='800s')
HostEntity->>NewHostDetailsView: instantiate with browser
Class diagram for updated HostsView and HostEntityclassDiagram
class HostsView {
+Text title
+PF5Button manage_columns
+Text export
+Text new
+PF4Button register
+Text new_ui_button
+Checkbox select_all
+SatTable table
+displayed_table_headers
}
class HostEntity {
+create(values)
}
HostsView --> SatTable : contains
SatTable --> Checkbox : column_widgets[0]
SatTable --> Text : column_widgets['Name']
SatTable --> Text : column_widgets['Recommendations']
SatTable --> ActionsDropdown : column_widgets['Actions']
HostEntity --> HostsView : uses in create()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @amolpati30 - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `airgun/entities/host.py:46` </location>
<code_context>
def create(self, values):
"""Create new host entity"""
view = self.navigate_to(self, 'New')
- view.fill(values)
+ wait_for(lambda: view.fill(values), timeout=60)
self.browser.click(view.submit, ignore_ajax=True)
self.browser.plugin.ensure_page_safe(timeout='800s')
</code_context>
<issue_to_address>
Host creation now waits for the fill operation to complete.
Confirm that view.fill is idempotent or that wait_for won't invoke it multiple times, to avoid unintended side effects from repeated calls.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| def create(self, values): | ||
| """Create new host entity""" | ||
| view = self.navigate_to(self, 'New') | ||
| view.fill(values) |
Contributor
There was a problem hiding this comment.
issue (bug_risk): Host creation now waits for the fill operation to complete.
Confirm that view.fill is idempotent or that wait_for won't invoke it multiple times, to avoid unintended side effects from repeated calls.
amolpati30
force-pushed
the
Locator_updated_and_host_entity
branch
from
July 26, 2025 16:30
861f6a5 to
ff17297
Compare
Contributor
Author
|
trigger: test-robottelo |
LadislavVasina1
approved these changes
Jul 28, 2025
vijaysawant
reviewed
Aug 5, 2025
amolpati30
force-pushed
the
Locator_updated_and_host_entity
branch
from
August 11, 2025 09:13
ff17297 to
521c919
Compare
vijaysawant
approved these changes
Aug 11, 2025
Contributor
|
LadislavVasina1
approved these changes
Aug 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Update various element locators in Hosts view and improve host creation stability.
Bug Fixes:
Enhancements: