mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-06 08:25:15 -04:00
#1116 Add a Clear All button in the File List area for share modes
This commit is contained in:
parent
ff15c045e6
commit
54b70aef82
5 changed files with 77 additions and 5 deletions
|
@ -55,6 +55,14 @@ class TestShare(GuiBaseTest):
|
|||
).item_button.click()
|
||||
self.file_selection_widget_has_files(tab, num_files)
|
||||
|
||||
def add_a_file_and_delete_using_clear_all_widget(self, tab):
|
||||
"""Test that we can also delete all files by clicking on the Clear All widget"""
|
||||
tab.get_mode().server_status.file_selection.file_list.add_file(self.tmpfiles[0])
|
||||
tab.get_mode().server_status.file_selection.file_list.add_file(self.tmpfiles[1])
|
||||
tab.get_mode().clear_all_button.click()
|
||||
# Should be no files after clearing all
|
||||
self.file_selection_widget_has_files(tab, 0)
|
||||
|
||||
def file_selection_widget_read_files(self, tab):
|
||||
"""Re-add some files to the list so we can share"""
|
||||
num_files = tab.get_mode().server_status.file_selection.get_num_files()
|
||||
|
@ -269,7 +277,7 @@ class TestShare(GuiBaseTest):
|
|||
self.run_all_share_mode_started_tests(tab)
|
||||
self.run_all_share_mode_download_tests(tab)
|
||||
|
||||
def run_all_clear_all_button_tests(self, tab):
|
||||
def run_all_clear_all_history_button_tests(self, tab):
|
||||
"""Test the Clear All history button"""
|
||||
self.run_all_share_mode_setup_tests(tab)
|
||||
self.run_all_share_mode_started_tests(tab)
|
||||
|
@ -279,6 +287,11 @@ class TestShare(GuiBaseTest):
|
|||
self.individual_file_is_viewable_or_not(tab)
|
||||
self.clear_all_history_items(tab, 2)
|
||||
|
||||
def run_all_clear_all_file_selection_button_tests(self, tab):
|
||||
"""Test the Clear All File Selection button"""
|
||||
self.run_all_share_mode_setup_tests(tab)
|
||||
self.add_a_file_and_delete_using_clear_all_widget(tab)
|
||||
|
||||
def run_all_share_mode_individual_file_tests(self, tab):
|
||||
"""Tests in share mode when viewing an individual file"""
|
||||
self.run_all_share_mode_setup_tests(tab)
|
||||
|
@ -375,18 +388,31 @@ class TestShare(GuiBaseTest):
|
|||
self.close_all_tabs()
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_clear_all_button(self):
|
||||
def test_clear_all_history_button(self):
|
||||
"""
|
||||
Test canceling a scheduled share
|
||||
Test clearing all history items
|
||||
"""
|
||||
tab = self.new_share_tab()
|
||||
tab.get_mode().autostop_sharing_checkbox.click()
|
||||
|
||||
self.run_all_common_setup_tests()
|
||||
self.run_all_clear_all_button_tests(tab)
|
||||
self.run_all_clear_all_history_button_tests(tab)
|
||||
|
||||
self.close_all_tabs()
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_clear_all_file_selection_button(self):
|
||||
"""
|
||||
Test clearing all file items at once
|
||||
"""
|
||||
tab = self.new_share_tab()
|
||||
|
||||
self.run_all_common_setup_tests()
|
||||
self.run_all_clear_all_file_selection_button_tests(tab)
|
||||
|
||||
self.close_all_tabs()
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_public_mode(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue