From a3fbe7c57f274199ebb581a6be315bc1c1481c10 Mon Sep 17 00:00:00 2001 From: David Moore Date: Thu, 17 Oct 2024 08:40:04 -0400 Subject: [PATCH] New UI, CV and CVV Delete --- airgun/entities/contentview_new.py | 27 +++++++++++++++++++++++++++ airgun/views/contentview_new.py | 21 +++++++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/airgun/entities/contentview_new.py b/airgun/entities/contentview_new.py index a27987aca..53c49b452 100644 --- a/airgun/entities/contentview_new.py +++ b/airgun/entities/contentview_new.py @@ -60,6 +60,33 @@ def publish(self, entity_name, values=None, promote=False, lce=None): view.wait_displayed() return view.versions.table.read() + def delete(self, entity_name): + """Deletes the content view by name""" + view = self.navigate_to(self, 'Edit', entity_name=entity_name) + self.browser.plugin.ensure_page_safe(timeout='5s') + view.wait_displayed() + # click the 'cv-details-action' dropdown, then click 'Delete' + view.cv_actions.click() + view.cv_delete.click() + view.wait_displayed() + # Remove from environment(s) wizard, if it appears + if view.next_button.is_displayed: + view.next_button.click() + view.delete_finish.click() + + def delete_version(self, entity_name, version): + """Deletes the specified version of the content view""" + view = self.navigate_to(self, 'Version', entity_name=entity_name, version=version) + self.browser.plugin.ensure_page_safe(timeout='10s') + view.wait_displayed() + result = view.version_dropdown.item_select('Delete') + view.wait_displayed() + # Remove from environment(s) wizard, if it appears + if view.next_button.is_displayed: + view.next_button.click() + view.delete_finish.click() + return result + def add_content(self, entity_name, content_name): """Add specified content to the given Content View""" view = self.navigate_to(self, 'Edit', entity_name=entity_name) diff --git a/airgun/views/contentview_new.py b/airgun/views/contentview_new.py index 2d36608ed..a49903647 100644 --- a/airgun/views/contentview_new.py +++ b/airgun/views/contentview_new.py @@ -111,9 +111,19 @@ def after_fill(self, value): class ContentViewEditView(BaseLoggedInView): breadcrumb = BreadCrumb('breadcrumbs-list') search = PF4Search() - actions = ActionsDropdown(".//button[contains(@id, 'toggle-dropdown')]") - publish = PF4Button('cv-details-publish-button') dialog = ConfirmationDialog() + publish = PF4Button('cv-details-publish-button') + # click the cv_actions dropdown, then click copy or delete + cv_actions = ActionsDropdown('//div[@data-ouia-component-id="cv-details-actions"]') + cv_copy = Text('//a[@data-ouia-component-id="cv-copy"]') + cv_delete = Text('//a[@data-ouia-component-id="cv-delete"]') + + # buttons for wizard: deleting a CV with Version promoted to environment(s) + next_button = Button('Next') + delete_finish = Button('Delete') + back_button = Button('Back') + cancel_button = Button('Cancel') + close_button = Button('Close') @property def is_displayed(self): @@ -258,6 +268,13 @@ class ContentViewVersionDetailsView(BaseLoggedInView): editDescription = PF4Button( locator='.//button[@data-ouia-component-id="edit-button-description"]' ) + # buttons for wizard: deleting a version promoted to environment(s) + next_button = Button('Next') + delete_finish = Button('Delete') + back_button = Button('Back') + cancel_button = Button('Cancel') + close_button = Button('Close') + progressbar = PF4ProgressBar('.//div[contains(@class, "pf-c-wizard__main-body")]') @View.nested class repositories(Tab):