def test_application_submission_workflow(self): # self.host = 'https://cmr-dev.herokuapp.com' answers = intake_mock.fake.sf_county_form_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('submitted form', **answers), S.click_on('clicked privacy policy', 'Privacy Policy'), ] sizes = { 'Apply on a common mobile phone': base.COMMON_MOBILE, # 'Apply on a small mobile phone': base.SMALL_MOBILE, 'Apply on a small desktop computer': base.SMALL_DESKTOP } for prefix, size in sizes.items(): self.run_sequence(prefix, sequence, size=size)
def test_apply_to_ebclc(self): answers = intake_mock.fake.ebclc_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked alameda', counties=['alameda']), S.fill_form('submitted form', **answers), ] self.run_sequence('Apply to EBCLC in Alameda', sequence, size=base.COMMON_MOBILE)
def test_apply_to_contra_costa(self): answers = intake_mock.fake.contra_costa_county_form_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked contra costa', counties=['contracosta']), S.fill_form('submitted form', **answers), ] self.run_sequence('Apply to Contra Costa', sequence, size=base.COMMON_MOBILE)
def test_login_and_password_reset_workflow(self): user = self.ccpubdef_users[0] self.run_sequence("Fail login and reset password", [ S.get('went to login', reverse(AuthCase.login_view)), S.fill_form( 'entered login info', login=user.email, password="******"), S.click_on('clicked forgot password', "Forgot Password?"), S.fill_form('entered email', email=user.email), S.check_email('reset email'), S.get('clicked on link in email', self.get_link_from_email), S.fill_form('entered new password', password=fake_password), ], base.SMALL_DESKTOP)
def test_apply_to_ebclc(self): answers = intake_mock.fake.ebclc_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked alameda', counties=['alameda']), S.fill_form('submitted form', **answers), ] self.run_sequence( 'Apply to EBCLC in Alameda', sequence, size=base.COMMON_MOBILE)
def test_apply_to_contra_costa(self): answers = intake_mock.fake.contra_costa_county_form_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked contra costa', counties=['contracosta']), S.fill_form('submitted form', **answers), ] self.run_sequence( 'Apply to Contra Costa', sequence, size=base.COMMON_MOBILE)
def test_login_and_password_reset_workflow(self): user = self.users[0] found_user = auth_models.User.objects.filter(email=user.email).first() self.run_sequence( "Fail login and reset password", [ S.get('went to login', reverse(AuthCase.login_view)), S.fill_form('entered login info', login=user.email, password="******"), S.click_on('clicked forgot password', "Forgot Password?"), S.fill_form('entered email', email=user.email), S.check_email('reset email'), S.get('clicked on link in email', self.get_link_from_email), S.fill_form('entered new password', password=fake_password), ], base.SMALL_DESKTOP )
def test_application_submission_failure(self): address_fields = { key: value for key, value in intake_mock.fake.sf_county_form_answers().items() if 'address' in key } sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('submitted incomplete form', first_name='Cornelius'), S.fill_form('added last name', last_name='Cherimoya'), S.fill_form('added address', contact_preferences=['prefers_snailmail'], **address_fields) ] self.run_sequence( "Applying without enough information", sequence, size=base.COMMON_MOBILE)
def test_apply_to_san_francisco(self): answers = intake_mock.fake.sf_county_form_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('selected San Francisco', counties=['sanfrancisco']), S.fill_form('submitted form', **answers) ] sizes = { 'Apply on a common mobile phone': base.COMMON_MOBILE, 'Apply on a small desktop computer': base.SMALL_DESKTOP } for prefix, size in sizes.items(): self.run_sequence(prefix, sequence, size=size)
def test_apply_to_alameda_pubdef(self): answers = intake_mock.fake.alameda_pubdef_answers() declaration_letter_answers = \ intake_mock.fake.declaration_letter_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked alameda', counties=['alameda']), S.fill_form('submitted form', **answers), S.fill_form('submitted declaration letter', **declaration_letter_answers), S.fill_form('approved declaration letter', submit_action='approve_letter'), ] self.run_sequence('Apply to Alameda Public Defender', sequence, size=base.COMMON_MOBILE)
def test_apply_to_alameda_pubdef(self): answers = intake_mock.fake.alameda_pubdef_answers() declaration_letter_answers = \ intake_mock.fake.declaration_letter_answers() sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('picked alameda', counties=['alameda']), S.fill_form('submitted form', **answers), S.fill_form( 'submitted declaration letter', **declaration_letter_answers), S.fill_form( 'approved declaration letter', submit_action='approve_letter'), ] self.run_sequence( 'Apply to Alameda Public Defender', sequence, size=base.COMMON_MOBILE)
def test_application_submission_failure(self): address_fields = { key: value for key, value in intake_mock.fake.sf_county_form_answers().items() if 'address' in key } sequence = [ S.get('went to splash page', '/'), S.click_on('clicked apply now', 'Apply now'), S.fill_form('selected San Francisco', counties=['sanfrancisco']), S.fill_form('submitted incomplete form', first_name='Cornelius'), S.fill_form('added last name', last_name='Cherimoya'), S.fill_form('added address', contact_preferences=[ 'prefers_snailmail'], **address_fields) ] self.run_sequence( "Applying without enough information", sequence, size=base.COMMON_MOBILE)