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 new Refresh button in capsule content #1605

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions airgun/entities/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,30 @@ def complete_sync(self, capsule_name):

self.sync(capsule_name, 'Complete Sync')

def refresh_lce_counts(self, capsule_name, lce_name):
def refresh_lce_counts(self, capsule_name, lce_name, cv_name=None):
"""
Function that refreshes LCE counts of given capsule
Function that refreshes the content counts of given capsule

Args:
capsule_name (str): Name of capsule to be refreshed
lce_name (str): Name of LCE to be refreshed
cv_name (str, optional): Name of CV within LCE to be refreshed only
"""

view = self.navigate_to(self, 'Capsules')
view.wait_displayed()
view.table.row(name=capsule_name)['Name'].click()
view = CapsuleDetailsView(self.browser)
view.wait_displayed()
view.content.top_content_table.row(Environment=lce_name)[3].widget.item_select(
'Refresh counts'
)
if not cv_name:
view.content.top_content_table.row(Environment=lce_name)[3].widget.item_select(
'Refresh counts'
)
else:
view.content.top_content_table.row(Environment=lce_name)[0].click()
view.content.mid_content_table.row(content_view=cv_name)[5].widget.item_select(
'Refresh counts'
)


@navigator.register(CapsuleEntity, 'Capsules')
Expand Down
7 changes: 6 additions & 1 deletion airgun/views/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ class content(SatTab):
mid_content_table = ExpandableTable(
component_id='expandable-content-views',
column_widgets={
'cv_info_list': ItemsList(locator='//ul'),
0: Button(locator='./button[@aria-label="Details"]'),
'Content view': Text('./span/a'),
'Version': Text('./a'),
'Last published': Text('./span'),
'Synced': Text('./svg'),
5: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'),
},
)

Expand Down