From 65065f532a9605bbd0c63fdff718c31ae12afbb0 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Fri, 25 Oct 2024 16:02:52 +0200 Subject: [PATCH] Add new Refresh button in capsule content --- airgun/entities/capsule.py | 18 +++++++++++++----- airgun/views/capsule.py | 7 ++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/airgun/entities/capsule.py b/airgun/entities/capsule.py index c3e711666..019179b64 100644 --- a/airgun/entities/capsule.py +++ b/airgun/entities/capsule.py @@ -281,12 +281,14 @@ 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') @@ -294,9 +296,15 @@ def refresh_lce_counts(self, capsule_name, lce_name): 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') diff --git a/airgun/views/capsule.py b/airgun/views/capsule.py index c96e817a2..0946a2330 100644 --- a/airgun/views/capsule.py +++ b/airgun/views/capsule.py @@ -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")]'), }, )