Skip to content

Commit

Permalink
Add new Refresh button in capsule content
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik authored and pondrejk committed Nov 29, 2024
1 parent 7a4c7b0 commit 65065f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
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 @@ -186,7 +186,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

0 comments on commit 65065f5

Please sign in to comment.