Skip to content

Commit

Permalink
Raise exception when delete modal isn't showing
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Nov 27, 2023
1 parent 89bf8d4 commit 36b6255
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airgun/entities/all_hosts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from widgetastic.exceptions import NoSuchElementException

from airgun.entities.base import BaseEntity
from airgun.navigation import NavigateStep, navigator
from airgun.utils import retry_navigation
Expand Down Expand Up @@ -28,6 +30,8 @@ def delete(self, host_name):
delete_modal = HostDeleteDialog(self.browser)
if delete_modal.is_displayed:
delete_modal.confirm_delete.click()
else:
raise NoSuchElementException("Delete Modal was not displayed.")
view = self.navigate_to(self, 'All')
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
Expand Down

0 comments on commit 36b6255

Please sign in to comment.