diff options
Diffstat (limited to 'tests/GuiReceiveTest.py')
-rw-r--r-- | tests/GuiReceiveTest.py | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/tests/GuiReceiveTest.py b/tests/GuiReceiveTest.py index c4bfa884..80e05250 100644 --- a/tests/GuiReceiveTest.py +++ b/tests/GuiReceiveTest.py @@ -66,31 +66,6 @@ class GuiReceiveTest(GuiBaseTest): r = requests.get('http://127.0.0.1:{}/close'.format(self.gui.app.port)) self.assertEqual(r.status_code, 401) - def uploading_zero_files_shouldnt_change_ui(self, mode, public_mode): - '''If you submit the receive mode form without selecting any files, the UI shouldn't get updated''' - url = 'http://127.0.0.1:{}/upload'.format(self.gui.app.port) - - # What were the counts before submitting the form? - before_in_progress_count = mode.history.in_progress_count - before_completed_count = mode.history.completed_count - before_number_of_history_items = len(mode.history.item_list.items) - - # Click submit without including any files a few times - if public_mode: - r = requests.post(url, files={}) - r = requests.post(url, files={}) - r = requests.post(url, files={}) - else: - auth = requests.auth.HTTPBasicAuth('onionshare', mode.web.password) - r = requests.post(url, files={}, auth=auth) - r = requests.post(url, files={}, auth=auth) - r = requests.post(url, files={}, auth=auth) - - # The counts shouldn't change - self.assertEqual(mode.history.in_progress_count, before_in_progress_count) - self.assertEqual(mode.history.completed_count, before_completed_count) - self.assertEqual(len(mode.history.item_list.items), before_number_of_history_items) - # 'Grouped' tests follow from here def run_all_receive_mode_setup_tests(self, public_mode): @@ -127,14 +102,13 @@ class GuiReceiveTest(GuiBaseTest): # Test uploading the same file twice at the same time, and make sure no collisions self.upload_file(public_mode, '/tmp/test.txt', 'test.txt', True) self.counter_incremented(self.gui.receive_mode, 6) - self.uploading_zero_files_shouldnt_change_ui(self.gui.receive_mode, public_mode) - self.history_indicator(self.gui.receive_mode, public_mode) + self.history_indicator(self.gui.receive_mode, public_mode, "2") self.server_is_stopped(self.gui.receive_mode, False) self.web_server_is_stopped() self.server_status_indicator_says_closed(self.gui.receive_mode, False) self.server_working_on_start_button_pressed(self.gui.receive_mode) self.server_is_started(self.gui.receive_mode) - self.history_indicator(self.gui.receive_mode, public_mode) + self.history_indicator(self.gui.receive_mode, public_mode, "2") def run_all_receive_mode_unwritable_dir_tests(self, public_mode): '''Attempt to upload (unwritable) files in receive mode and stop the share''' @@ -153,3 +127,12 @@ class GuiReceiveTest(GuiBaseTest): self.autostop_timer_widget_hidden(self.gui.receive_mode) self.server_timed_out(self.gui.receive_mode, 15000) self.web_server_is_stopped() + + def run_all_clear_all_button_tests(self, public_mode): + """Test the Clear All history button""" + self.run_all_receive_mode_setup_tests(public_mode) + self.upload_file(public_mode, '/tmp/test.txt', 'test.txt') + self.history_widgets_present(self.gui.receive_mode) + self.clear_all_history_items(self.gui.receive_mode, 0) + self.upload_file(public_mode, '/tmp/test.txt', 'test.txt') + self.clear_all_history_items(self.gui.receive_mode, 2) |