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 98c53e4 commit b4098ed
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
27 changes: 27 additions & 0 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 22 additions & 2 deletions airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -252,12 +262,22 @@ class ContentViewVersionPromoteView(Modal):
class ContentViewVersionDetailsView(BaseLoggedInView):
breadcrumb = BreadCrumb()
version = Text(locator='.//h2[@data-ouia-component-id="cv-version"]')
version_dropdown = Dropdown(
locator='.//div[@data-ouia-component-id="cv-version-header-actions-dropdown"]'
)
promoteButton = PF4Button(
locator='.//button[@data-ouia-component-id="cv-details-publish-button"]'
)
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 b4098ed

Please sign in to comment.