Skip to content

Commit

Permalink
New UI, CV and CVV Delete
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Oct 17, 2024
1 parent 56c28ed commit 943cdd4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
29 changes: 25 additions & 4 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,31 @@ def create(self, values, composite=False):
view.submit.click()

def delete(self, entity_name):
"""Deletes the supplied content view"""
"""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 supplied version of the content view"""
"""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 search(self, value):
"""Search for content view"""
Expand Down Expand Up @@ -88,7 +109,7 @@ def add_cv(self, ccv_name, cv_name, always_update=False, version=None):
return view.content_views.resources.read()

def read_cv(self, entity_name, version_name):
"""Reads the table for a specified Content View's specified Version"""
"""Reads the table for a specified Content View Version"""
view = self.navigate_to(self, 'Edit', entity_name=entity_name)
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
Expand All @@ -103,7 +124,7 @@ def read_repositories(self, entity_name):
def read_version_table(self, entity_name, version, tab_name, search_param=None):
"""Reads a specific table for a CV Version"""
view = self.navigate_to(self, 'Version', entity_name=entity_name, version=version)
self.browser.plugin.ensure_page_safe(timeout='5s')
self.browser.plugin.ensure_page_safe(timeout='10s')
view.wait_displayed()
# This allows dynamic access to the proper table
getattr(view, tab_name).table.wait_displayed()
Expand Down
21 changes: 19 additions & 2 deletions airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,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()
# 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"]')
publish = PF4Button('cv-details-publish-button')

# wizard for deleting CV 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):
Expand Down Expand Up @@ -257,6 +267,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):
Expand Down

0 comments on commit 943cdd4

Please sign in to comment.