Skip to content

Commit

Permalink
updated 'codename' to 'passphrase' in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Jun 20, 2022
1 parent f60fe90 commit 8440b53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions securedrop/tests/functional/app_navigators.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,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:
Expand Down
14 changes: 7 additions & 7 deletions securedrop/tests/functional/source_navigation_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions securedrop/tests/functional/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 8440b53

Please sign in to comment.