Skip to content

Commit

Permalink
Removes xfail on the test_journalist_interface_ui_modal functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Nov 11, 2019
1 parent c84884d commit c6d78ed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 24 additions & 0 deletions securedrop/tests/functional/functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
from selenium.webdriver.remote.remote_connection import LOGGER
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from sqlalchemy.exc import IntegrityError
from tbselenium.tbdriver import TorBrowserDriver
from tbselenium.utils import disable_js
Expand Down Expand Up @@ -77,6 +79,28 @@ def _unused_port(self):
s.close()
return port

def set_tbb_securitylevel(self, toLevel):
if self.torbrowser_driver is None:
self.create_torbrowser_driver()
driver = self.torbrowser_driver

driver.get("about:config")
accept_risk_button = driver.find_element_by_id("warningButton")
if accept_risk_button:
accept_risk_button.click()
ActionChains(driver).send_keys(Keys.RETURN).\
send_keys("extensions.torbutton.security_slider").perform()
time.sleep(2)
ActionChains(driver).send_keys(Keys.TAB).\
send_keys(Keys.RETURN).perform()
time.sleep(2)
alert = driver.switch_to.alert
time.sleep(2)
alert.send_keys(str(toLevel))
time.sleep(2)
alert.accept()
time.sleep(2)

def create_torbrowser_driver(self):
logging.info("Creating TorBrowserDriver")
log_file = open(LOGFILE_PATH, "a")
Expand Down
6 changes: 4 additions & 2 deletions securedrop/tests/functional/test_journalist.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from . import functional_test
from . import journalist_navigation_steps
from . import source_navigation_steps
import pytest


class TestJournalist(
Expand Down Expand Up @@ -59,14 +58,17 @@ def test_journalist_uses_index_delete_collections_button_modal(self):
self._journalist_logs_in()
self._journalist_uses_delete_collections_button_confirmation()

@pytest.mark.xfail(reason="Filter widget not displayed in TBB 9.0.1")
def test_journalist_interface_ui_with_modal(self):
self._source_visits_source_homepage()
self._source_chooses_to_submit_documents()
self._source_continues_to_submit_page()
self._source_submits_a_file()
self._source_logs_out()

# Toggle security slider to force prefs change
self.set_tbb_securitylevel(1)
self.set_tbb_securitylevel(4)

self._journalist_logs_in()
self._journalist_uses_js_filter_by_sources()
self._journalist_source_selection_honors_filter()
Expand Down

0 comments on commit c6d78ed

Please sign in to comment.