Skip to content

Commit

Permalink
Fixed the functional tests based on UI changes
Browse files Browse the repository at this point in the history
Updated all the tests and also VCR cassets for the latest master
code.
  • Loading branch information
kushaldas authored and sssoleileraaa committed Mar 18, 2020
1 parent 41f860a commit 78d1bbe
Show file tree
Hide file tree
Showing 7 changed files with 1,033 additions and 763 deletions.
759 changes: 467 additions & 292 deletions tests/functional/cassettes/test_delete_source_and_their_docs.yaml

Large diffs are not rendered by default.

1,021 changes: 558 additions & 463 deletions tests/functional/cassettes/test_receive_message_from_source.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/functional/test_delete_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def test_delete_source_and_their_docs(qtbot, mocker):
"""
It's possible to delete a source and see it removed from the UI.
"""
totp = "192894"
totp = "177711"
tempdir = get_safe_tempdir()
gui, controller = get_logged_in_test_context(tempdir, qtbot, totp)
qtbot.wait(1000)

def check_for_sources():
assert len(list(gui.main_view.source_list.source_widgets.keys()))

qtbot.waitUntil(check_for_sources, timeout=10000)
qtbot.waitUntil(check_for_sources, timeout=20000)
source_ids = list(gui.main_view.source_list.source_widgets.keys())
assert len(source_ids) == 2
first_source_id = source_ids[0]
Expand All @@ -43,4 +43,4 @@ def check_source_list():
# Confirm there is now only one source in the client list.
assert gui.main_view.source_list.count() == 1

qtbot.waitUntil(check_source_list, timeout=10000)
qtbot.waitUntil(check_source_list, timeout=20000)
2 changes: 1 addition & 1 deletion tests/functional/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_login_ensure_errors_displayed(qtbot, mocker):
assert login_dialog.error_bar.error_status_bar.text() == ""
qtbot.keyClicks(login_dialog.username_field, "journalist")
qtbot.mouseClick(login_dialog.submit, Qt.LeftButton)
expected = "Please enter a username, password and two-factor code."
expected = "Please enter a username, passphrase and two-factor code."
actual = login_dialog.error_bar.error_status_bar.text()
assert actual == expected

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_receive_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_receive_message_from_source(qtbot, mocker):
It's possible to receive a new message from a source and see it show up in
the conversation window.
"""
totp = "625486"
totp = "795461"
tempdir = get_safe_tempdir()
gui, controller = get_logged_in_test_context(tempdir, qtbot, totp)
qtbot.wait(1000)
Expand All @@ -26,7 +26,7 @@ def check_for_sources():

qtbot.waitUntil(check_for_sources, timeout=10000)
source_ids = list(gui.main_view.source_list.source_widgets.keys())
first_source_id = source_ids[0]
first_source_id = source_ids[2]
first_source_widget = gui.main_view.source_list.source_widgets[first_source_id]
qtbot.mouseClick(first_source_widget, Qt.LeftButton)

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_star_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_for_sources():

qtbot.waitUntil(check_for_sources, timeout=10000)
source_ids = list(gui.main_view.source_list.source_widgets.keys())
first_source_id = source_ids[0]
first_source_id = source_ids[1]
first_source_widget = gui.main_view.source_list.source_widgets[first_source_id]
qtbot.mouseClick(first_source_widget, Qt.LeftButton)

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_unstar_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_for_sources():

qtbot.waitUntil(check_for_sources, timeout=10000)
source_ids = list(gui.main_view.source_list.source_widgets.keys())
first_source_id = source_ids[0]
first_source_id = source_ids[1]
first_source_widget = gui.main_view.source_list.source_widgets[first_source_id]
qtbot.mouseClick(first_source_widget, Qt.LeftButton)

Expand Down

0 comments on commit 78d1bbe

Please sign in to comment.