From e36818e591c2e7127c1689e41db550d1a489dfd0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 28 May 2020 14:27:20 -0700 Subject: [PATCH] snapshot: tests: functional: Delete all snapshots properly Don't depend on number of snapshots being 0 to conclude that all snapshots have been deleted instead use the disabled state of the 'Delete Selected' button. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/snapshot/tests/test_functional.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plinth/modules/snapshot/tests/test_functional.py b/plinth/modules/snapshot/tests/test_functional.py index 0a5fc1894..6016ad957 100644 --- a/plinth/modules/snapshot/tests/test_functional.py +++ b/plinth/modules/snapshot/tests/test_functional.py @@ -77,9 +77,11 @@ def snapshot_assert_configuration(session_browser, free_space, def _delete_all(browser): - if _get_count(browser): + functional.visit(browser, '/plinth/sys/snapshot/manage/') + delete_button = browser.find_by_name('delete_selected').first + if not delete_button['disabled']: browser.find_by_id('select-all').check() - functional.submit(browser, browser.find_by_name('delete_selected')) + functional.submit(browser, delete_button) confirm_button = browser.find_by_name('delete_confirm') if confirm_button: # Only if redirected to confirm page