From bd3a7be43308d509e8728d588246c818f90cc156 Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Thu, 2 Nov 2023 15:07:46 -0400 Subject: [PATCH 1/3] Adding views and entities for sca only tests --- airgun/entities/subscription.py | 10 ++++++++++ airgun/views/activationkey.py | 1 + airgun/views/contenthost.py | 1 + airgun/views/organization.py | 1 + airgun/views/subscription.py | 1 + 5 files changed, 14 insertions(+) diff --git a/airgun/entities/subscription.py b/airgun/entities/subscription.py index 348634538..14c16c068 100644 --- a/airgun/entities/subscription.py +++ b/airgun/entities/subscription.py @@ -178,6 +178,16 @@ def read_subscriptions(self): view = self.navigate_to(self, 'All') return view.table.read() + def sca_alert(self): + view = self.navigate_to(self, 'All') + # return view.sca_alert.read() + wait_for( + lambda: view.sca_alert.read(), + handle_exception=True, + timeout=10, + ) + return view.sca_alert.read() + class SubscriptionNavigationStep(NavigateStep): """To ensure that we reached the destination, some targets need extra post navigation tasks""" diff --git a/airgun/views/activationkey.py b/airgun/views/activationkey.py index 219dafdd3..baf64122a 100644 --- a/airgun/views/activationkey.py +++ b/airgun/views/activationkey.py @@ -59,6 +59,7 @@ class ActivationKeyEditView(BaseLoggedInView): breadcrumb = BreadCrumb() actions = ActionsDropdown("//div[contains(@class, 'btn-group')]") dialog = ConfirmationDialog() + sca_alert = Text('//div[contains(@class,"alert-warning")]') @property def is_displayed(self): diff --git a/airgun/views/contenthost.py b/airgun/views/contenthost.py index 3e2a02c02..9027f3bab 100644 --- a/airgun/views/contenthost.py +++ b/airgun/views/contenthost.py @@ -136,6 +136,7 @@ def is_displayed(self): @View.nested class details(SatTab): # Basic information + sca_alert = Text('//div[contains(@class,"alert-warning")]') name = EditableEntry(name='Name') uuid = ReadOnlyEntry(name='Subscription UUID') bios_uuid = ReadOnlyEntry(name='BIOS UUID') diff --git a/airgun/views/organization.py b/airgun/views/organization.py index f39bfc4bb..7c4fdb815 100644 --- a/airgun/views/organization.py +++ b/airgun/views/organization.py @@ -78,6 +78,7 @@ class primary(SatVerticalTab): name = TextInput(id='organization_name') label = TextInput(id='organization_label') default_system_sla = FilteredDropdown(id='organization_service_level') + sca_alert = Text('//div[contains(@class,"alert-warning")]') description = TextInput(id='organization_description') @View.nested diff --git a/airgun/views/subscription.py b/airgun/views/subscription.py index ec0b23b27..0daf8e6f5 100644 --- a/airgun/views/subscription.py +++ b/airgun/views/subscription.py @@ -118,6 +118,7 @@ def fill(self, values): class SubscriptionListView(BaseLoggedInView, SubscriptionSearchableViewMixin): """List of all subscriptions.""" + sca_alert = Text('//div[contains(@class,"alert-warning")]') table = SatSubscriptionsViewTable( locator='//div[@id="subscriptions-table"]//table', column_widgets={ From d85b4c1e7a06cd4ac499c24d58d145a974d8245a Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Wed, 8 Nov 2023 12:38:27 -0500 Subject: [PATCH 2/3] Adding sca view to new org page --- airgun/views/organization.py | 1 + 1 file changed, 1 insertion(+) diff --git a/airgun/views/organization.py b/airgun/views/organization.py index 7c4fdb815..3e4032135 100644 --- a/airgun/views/organization.py +++ b/airgun/views/organization.py @@ -30,6 +30,7 @@ class OrganizationCreateView(BaseLoggedInView): breadcrumb = BreadCrumb() name = TextInput(id='organization_name') label = TextInput(id='organization_label') + sca = Checkbox(locator=".//input[@id='simple_content_access' and @type='checkbox']") description = TextInput(id='organization_description') submit = Text('//input[@name="commit"]') From f6f2277408a497c87a811d4d526b150a3c2a5747 Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Mon, 11 Dec 2023 08:35:51 -0500 Subject: [PATCH 3/3] removed comment --- airgun/entities/subscription.py | 1 - 1 file changed, 1 deletion(-) diff --git a/airgun/entities/subscription.py b/airgun/entities/subscription.py index 14c16c068..20b8e812c 100644 --- a/airgun/entities/subscription.py +++ b/airgun/entities/subscription.py @@ -180,7 +180,6 @@ def read_subscriptions(self): def sca_alert(self): view = self.navigate_to(self, 'All') - # return view.sca_alert.read() wait_for( lambda: view.sca_alert.read(), handle_exception=True,