summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2020-06-29 12:25:21 -0700
committerMicah Lee <micah@micahflee.com>2020-06-29 12:25:21 -0700
commit9c70edfd12eab6d0f2d6d202b31591764a02b961 (patch)
tree886b4706996ff89ec178a28b6635db57e86d3c61 /tests
parent11d44eab5046c16231f605b36d0ed1e0d12d01b3 (diff)
parentce0d21bb7a961fa72e0437b1d06740576154989d (diff)
downloadonionshare-9c70edfd12eab6d0f2d6d202b31591764a02b961.tar.gz
onionshare-9c70edfd12eab6d0f2d6d202b31591764a02b961.zip
Merge branch 'qrcode' of https://github.com/mig5/onionshare into mig5-qrcode
Diffstat (limited to 'tests')
-rw-r--r--tests/gui_base_test.py11
-rw-r--r--tests/test_gui_receive.py1
-rw-r--r--tests/test_gui_share.py1
-rw-r--r--tests/test_gui_website.py1
4 files changed, 14 insertions, 0 deletions
diff --git a/tests/gui_base_test.py b/tests/gui_base_test.py
index cf936ef1..fa503faa 100644
--- a/tests/gui_base_test.py
+++ b/tests/gui_base_test.py
@@ -297,6 +297,17 @@ class GuiBaseTest(unittest.TestCase):
f"http://onionshare:{tab.get_mode().server_status.web.password}@127.0.0.1:{tab.app.port}",
)
+ def have_show_qr_code_button(self, tab):
+ """Test that the Show QR Code URL button is shown and that it loads a QR Code Dialog"""
+ self.assertTrue(tab.get_mode().server_status.show_url_qr_code_button.isVisible())
+ def accept_dialog():
+ window = tab.common.gui.qtapp.activeWindow()
+ if window:
+ window.close()
+
+ QtCore.QTimer.singleShot(500, accept_dialog)
+ tab.get_mode().server_status.show_url_qr_code_button.click()
+
def server_status_indicator_says_started(self, tab):
"""Test that the Server Status indicator shows we are started"""
if type(tab.get_mode()) == ReceiveMode:
diff --git a/tests/test_gui_receive.py b/tests/test_gui_receive.py
index 4ee0abd8..bd9cf491 100644
--- a/tests/test_gui_receive.py
+++ b/tests/test_gui_receive.py
@@ -112,6 +112,7 @@ class TestReceive(GuiBaseTest):
self.have_a_password(tab)
self.url_description_shown(tab)
self.have_copy_url_button(tab)
+ self.have_show_qr_code_button(tab)
self.server_status_indicator_says_started(tab)
self.web_page(tab, "Select the files you want to send, then click")
diff --git a/tests/test_gui_share.py b/tests/test_gui_share.py
index daa2c04d..846a5034 100644
--- a/tests/test_gui_share.py
+++ b/tests/test_gui_share.py
@@ -239,6 +239,7 @@ class TestShare(GuiBaseTest):
self.have_a_password(tab)
self.url_description_shown(tab)
self.have_copy_url_button(tab)
+ self.have_show_qr_code_button(tab)
self.server_status_indicator_says_started(tab)
def run_all_share_mode_download_tests(self, tab):
diff --git a/tests/test_gui_website.py b/tests/test_gui_website.py
index e8f8e369..80c74dea 100644
--- a/tests/test_gui_website.py
+++ b/tests/test_gui_website.py
@@ -70,6 +70,7 @@ class TestWebsite(GuiBaseTest):
self.have_a_password(tab)
self.url_description_shown(tab)
self.have_copy_url_button(tab)
+ self.have_show_qr_code_button(tab)
self.server_status_indicator_says_started(tab)
def run_all_website_mode_download_tests(self, tab):