From c538891da8e933150812890f4395951af36044e5 Mon Sep 17 00:00:00 2001 From: Matyas Strelec Date: Thu, 21 Sep 2023 10:13:59 +0200 Subject: [PATCH] address comments & fix stuck modal --- airgun/entities/host_new.py | 4 +++- airgun/views/host_new.py | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/airgun/entities/host_new.py b/airgun/entities/host_new.py index 6d2c6bd3f..c1202e8d7 100644 --- a/airgun/entities/host_new.py +++ b/airgun/entities/host_new.py @@ -56,7 +56,9 @@ def get_host_statuses(self, entity_name): self.browser.plugin.ensure_page_safe() view.overview.host_status.manage_all_statuses.click() view = ManageHostStatusesView(self.browser) - return view.read() + values = view.read() + view.close_modal.click() + return values def edit_system_purpose( self, entity_name, role=None, sla=None, usage=None, release_ver=None, add_ons=None diff --git a/airgun/views/host_new.py b/airgun/views/host_new.py index c6012e497..1d4bc3b26 100644 --- a/airgun/views/host_new.py +++ b/airgun/views/host_new.py @@ -799,14 +799,14 @@ class ManageHostStatusesView(View): """Manage host statuses modal""" ROOT = './/div[@data-ouia-component-id="statuses-modal"]' - + close_modal = Button(locator='.//button[@aria-label="Close"]') host_statuses_table = PatternflyTable( component_id='statuses-table', column_widgets={ - 'Name': Text('.//td[1]'), - 'Status': Text('.//td[2]'), - 'Reported at': Text('.//td[3]'), - 3: Button(locator='.//td[4]'), + 'Name': Text('.//td[contains(@data-label, "Name")]'), + 'Status': Text('.//td[contains(@data-label, "Status")]'), + 'Reported at': Text('.//td[contains(@data-label, "Reported at")]'), + 3: Button(locator='.//td[contains(@class, "action")]'), }, )