diff --git a/README.md b/README.md index 53c5359e3f..aae1263334 100644 --- a/README.md +++ b/README.md @@ -322,11 +322,11 @@ To generate new cassettes, follow these instructions: ``` 2. Start the dev server: `NUM_SOURCES=0 make dev` 3. Set up the dev server with data required for functional tests to pass and run in any order: - - Create 5 new sources, each with one submission that contains both a file and a message. The message should be set to `this is the message`. The file should be called `hello.txt` and contain a single line of text: `hello`. + - Create 3 new sources, each with one submission that contains both a file and a message. The message should be set to `this is the message`. The file should be called `hello.txt` and contain a single line of text: `hello`. 3. Delete all the old cassettes by running `rm -r tests/functional/cassettes` or just delete the cassettes you wish to regenerate. 4. Run `make test-functional` which will regenerate cassettes for any that are missing in the `tests/functional/cassettes` folder. -Note: After generating new cassettes, the test server will be in a state with only 3 sources. If for some reason you need to try again, make sure the server has the expected 5 sources, each with one submission that contains both the expected file and message before repeating the process of deleting cassettes and regenerating them. +Note: After generating new cassettes, the test server will be in a state with only one source, because there are two tests that delete one source each. If for some reason your need to try again, make sure the server has the expected 3 sources, each with one submission that contains both the expected file and message before repeating the process of deleting cassettes and regenerating them. ## Making a Release diff --git a/tests/functional/test_download_file.py b/tests/functional/test_download_file.py index 75a4093a2a..9b6671775c 100644 --- a/tests/functional/test_download_file.py +++ b/tests/functional/test_download_file.py @@ -41,14 +41,14 @@ def conversation_with_file_is_rendered(): assert gui.main_view.view_layout.itemAt(0) conversation = gui.main_view.view_layout.itemAt(0).widget() assert conversation - file_id = list(conversation.conversation_view.current_messages.keys())[-1] + file_id = list(conversation.conversation_view.current_messages.keys())[1] file_widget = conversation.conversation_view.current_messages[file_id] assert isinstance(file_widget, FileWidget) # Get the selected source conversation that contains a file attachment qtbot.waitUntil(conversation_with_file_is_rendered, timeout=TIME_RENDER_CONV_VIEW) conversation = gui.main_view.view_layout.itemAt(0).widget() - file_id = list(conversation.conversation_view.current_messages.keys())[-1] + file_id = list(conversation.conversation_view.current_messages.keys())[1] file_widget = conversation.conversation_view.current_messages[file_id] # Click on the download button for the file diff --git a/tests/functional/test_export_dialog.py b/tests/functional/test_export_dialog.py index 639f9e9705..aeb02e3184 100644 --- a/tests/functional/test_export_dialog.py +++ b/tests/functional/test_export_dialog.py @@ -42,14 +42,14 @@ def conversation_with_file_is_rendered(): assert gui.main_view.view_layout.itemAt(0) conversation = gui.main_view.view_layout.itemAt(0).widget() assert conversation - file_id = list(conversation.conversation_view.current_messages.keys())[-1] + file_id = list(conversation.conversation_view.current_messages.keys())[1] file_widget = conversation.conversation_view.current_messages[file_id] assert isinstance(file_widget, FileWidget) # Get the selected source conversation that contains a file attachment qtbot.waitUntil(conversation_with_file_is_rendered, timeout=TIME_RENDER_CONV_VIEW) conversation = gui.main_view.view_layout.itemAt(0).widget() - file_id = list(conversation.conversation_view.current_messages.keys())[-1] + file_id = list(conversation.conversation_view.current_messages.keys())[1] file_widget = conversation.conversation_view.current_messages[file_id] # If the file is not downloaded, click on the download button diff --git a/tests/functional/test_send_reply.py b/tests/functional/test_send_reply.py index 33314ec3b8..80e541b6f3 100644 --- a/tests/functional/test_send_reply.py +++ b/tests/functional/test_send_reply.py @@ -22,12 +22,12 @@ def test_send_reply_to_source(functional_test_logged_in_context, qtbot, mocker): def check_for_sources(): assert len(list(gui.main_view.source_list.source_items.keys())) - # Select the first source in the source list + # Select the last source in the source list qtbot.waitUntil(check_for_sources, timeout=TIME_RENDER_SOURCE_LIST) source_ids = list(gui.main_view.source_list.source_items.keys()) - first_source_item = gui.main_view.source_list.source_items[source_ids[0]] - first_source_widget = gui.main_view.source_list.itemWidget(first_source_item) - qtbot.mouseClick(first_source_widget, Qt.LeftButton) + last_source_item = gui.main_view.source_list.source_items[source_ids[0]] + last_source_widget = gui.main_view.source_list.itemWidget(last_source_item) + qtbot.mouseClick(last_source_widget, Qt.LeftButton) qtbot.wait(TIME_CLICK_ACTION) def check_for_conversation():