From 9e06c683bb85538dcbe22b8b436c5f3bd3103fd4 Mon Sep 17 00:00:00 2001 From: Kevin O'Gorman Date: Mon, 20 Jun 2022 10:34:44 -0400 Subject: [PATCH] updated 'codename' to 'passphrase' in tests --- securedrop/tests/functional/app_navigators.py | 4 ++-- .../tests/functional/source_navigation_steps.py | 14 +++++++------- securedrop/tests/functional/test_source.py | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/securedrop/tests/functional/app_navigators.py b/securedrop/tests/functional/app_navigators.py index 070df902c61..3aa52091594 100644 --- a/securedrop/tests/functional/app_navigators.py +++ b/securedrop/tests/functional/app_navigators.py @@ -197,14 +197,14 @@ def source_logs_out(self) -> None: def source_retrieves_codename_from_hint(self) -> str: # We use inputs to change CSS states for subsequent elements in the DOM, if it is unchecked - content = self.driver.find_element_by_id("codename-show-checkbox") + content = self.driver.find_element_by_id("passphrase-show-checkbox") # TODO: should the codename be hidden by default under inverted flow? # assert content.get_attribute("checked") is None # self.nav_helper.safe_click_by_id("codename-show") assert content.get_attribute("checked") is not None - content_content = self.driver.find_element_by_css_selector("#codename span") + content_content = self.driver.find_element_by_css_selector("#passphrase span") return content_content.text def source_chooses_to_login(self) -> None: diff --git a/securedrop/tests/functional/source_navigation_steps.py b/securedrop/tests/functional/source_navigation_steps.py index f371f8b8bd5..a72ba6146c0 100644 --- a/securedrop/tests/functional/source_navigation_steps.py +++ b/securedrop/tests/functional/source_navigation_steps.py @@ -50,27 +50,27 @@ def _source_chooses_to_submit_documents(self): def _source_shows_codename(self, verify_source_name=True): # We use inputs to change CSS states for subsequent elements in the DOM, if it is unchecked # the codename is hidden - content = self.driver.find_element_by_id("codename-show-checkbox") + content = self.driver.find_element_by_id("passphrase-show-checkbox") assert content.get_attribute("checked") is not None - content_content = self.driver.find_element_by_css_selector("#codename span") + content_content = self.driver.find_element_by_css_selector("#passphrase span") if verify_source_name: assert content_content.text == self.source_name def _source_hides_codename(self): # We use inputs to change CSS states for subsequent elements in the DOM, if it is checked # the codename is visible - content = self.driver.find_element_by_id("codename-show-checkbox") + content = self.driver.find_element_by_id("passphrase-show-checkbox") assert content.get_attribute("checked") is not None # In the UI, the label is actually the element that is being clicked, altering the state # of the input - self.safe_click_by_id("codename-show") + self.safe_click_by_id("passphrase-show") assert content.get_attribute("checked") is None def _source_sees_no_codename(self): - codename = self.driver.find_elements_by_css_selector("#codename span") + codename = self.driver.find_elements_by_css_selector("#passphrase span") assert len(codename) == 0 def _source_chooses_to_login(self): @@ -146,7 +146,7 @@ def file_submitted(first_submission=False): self.wait_for(lambda: file_submitted(first_submission), timeout=(self.timeout * 3)) if first_submission: - codename = self.driver.find_element_by_css_selector("#codename span") + codename = self.driver.find_element_by_css_selector("#passphrase span") self.source_name = codename.text def _source_submits_a_message( @@ -178,7 +178,7 @@ def message_submitted(first_submission=False, verify_notification=False): # passphrase is only available on submission in first session if first_submission: - codename = self.driver.find_element_by_css_selector("#codename span") + codename = self.driver.find_element_by_css_selector("#passphrase span") self.source_name = codename.text # allow time for reply key to be generated time.sleep(self.timeout) diff --git a/securedrop/tests/functional/test_source.py b/securedrop/tests/functional/test_source.py index 422d9656c07..984804795ec 100644 --- a/securedrop/tests/functional/test_source.py +++ b/securedrop/tests/functional/test_source.py @@ -26,9 +26,9 @@ def test_no_codename_hint_on_second_login(self, sd_servers_v2, tor_browser_web_d assert source_codename # And they are able to close the codename hint UI - content = navigator.driver.find_element_by_id("codename-show-checkbox") + content = navigator.driver.find_element_by_id("passphrase-show-checkbox") assert content.get_attribute("checked") is not None - navigator.nav_helper.safe_click_by_id("codename-show") + navigator.nav_helper.safe_click_by_id("passphrase-show") assert content.get_attribute("checked") is None # And on their second login @@ -38,7 +38,7 @@ def test_no_codename_hint_on_second_login(self, sd_servers_v2, tor_browser_web_d navigator.source_proceeds_to_login(codename=source_codename) # The codename hint UI is no longer present - codename = navigator.driver.find_elements_by_css_selector("#codename-reminder") + codename = navigator.driver.find_elements_by_css_selector("#passphrase-reminder") assert len(codename) == 0 def test_submission_notifications_on_first_login(self, sd_servers_v2, tor_browser_web_driver):