@@ -51,13 +51,8 @@ def _source_shows_codename(self, verify_source_name=True):
5151 # We use inputs to change CSS states for subsequent elements in the DOM, if it is unchecked
5252 # the codename is hidden
5353 content = self .driver .find_element_by_id ("codename-show-checkbox" )
54- assert content .get_attribute ("checked" ) is None
55-
56- # In the UI, the label is actually the element that is being clicked, altering the state
57- # of the input
58- self .safe_click_by_id ("codename-show" )
59-
6054 assert content .get_attribute ("checked" ) is not None
55+
6156 content_content = self .driver .find_element_by_css_selector ("#codename span" )
6257 if verify_source_name :
6358 assert content_content .text == self .source_name
@@ -102,7 +97,7 @@ def _source_proceeds_to_login(self):
10297
10398 def _source_enters_codename_in_login_form (self ):
10499 self .safe_send_keys_by_id (
105- "codename " , "ascension hypertext concert synopses"
100+ "passphrase " , "ascension hypertext concert synopses"
106101 )
107102
108103 def _source_hits_cancel_at_submit_page (self ):
@@ -160,15 +155,12 @@ def _source_submits_a_message(
160155 self ._source_enters_text_in_message_field ()
161156 self .safe_click_by_css_selector (".form-controls button" )
162157
163- def message_submitted ():
158+ def message_submitted (first_submission = False , verify_notification = False ):
159+
164160 if not self .accept_languages :
165161 notification = self .driver .find_element_by_class_name ("success" )
166162 assert "Thank" in notification .text
167163
168- if first_submission :
169- codename = self .driver .find_element_by_css_selector ("#codename span" )
170- self .source_name = codename .text
171-
172164 if verify_notification :
173165 first_submission_text = (
174166 "Please check back later for replies." in notification .text
@@ -179,8 +171,15 @@ def message_submitted():
179171 else :
180172 assert not first_submission_text
181173
182- self .wait_for (message_submitted )
174+ self .wait_for (lambda : message_submitted (
175+ verify_notification = verify_notification ,
176+ first_submission = first_submission
177+ ))
183178
179+ # passphrase is only available on submission in first session
180+ if first_submission :
181+ codename = self .driver .find_element_by_css_selector ("#codename span" )
182+ self .source_name = codename .text
184183 # allow time for reply key to be generated
185184 time .sleep (self .timeout )
186185
0 commit comments