Example #1
0
 def test_invite_user_workflow(self):
     superuser = self.cfa_user
     organization = self.sf_pubdef
     new_user = auth_mock.fake_user_data()
     self.run_sequence(
         "Invitation and signup",
         [
             S.get('went to login', reverse(AuthCase.login_view)),
             S.fill_form(
                 'entered login info',
                 login=superuser.email,
                 password=fake_password),
             S.get(
                 'went to send invite view', reverse(
                     AuthCase.send_invite_view)),
             S.fill_form(
                 'submitted email and an org',
                 email=new_user['email'],
                 organization=str(
                     organization.id)),
             S.get('logged out', reverse(AuthCase.logout_view)),
             S.check_email('invite email'),
             S.get('clicked link in email', self.get_link_from_email),
             S.fill_form(
                 'entered name and password',
                 name='Bartholomew McHumanperson',
                 password1=fake_password),
             S.get('went to applications', reverse('intake-app_index')),
         ], base.SMALL_DESKTOP)
Example #2
0
 def test_public_views(self):
     self.run_sequence("Browse public views", [
         S.get("splash page", '/'),
         S.get("application form", '/apply/'),
         S.get("thanks page", '/thanks/'),
         S.get("privacy policy", '/privacy/'),
         S.get("stats", '/stats/'),
     ],
                       size=base.SMALL_DESKTOP)
Example #3
0
 def test_public_views(self):
     self.run_sequence(
         "Browse public views",
         [
             S.get("splash page", '/'),
             S.get("application form", '/apply/'),
             S.get("thanks page", '/thanks/'),
             S.get("privacy policy", '/privacy/'),
             S.get("stats", '/stats/'),
         ],
         size=base.SMALL_DESKTOP
         )
Example #4
0
 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)
Example #5
0
 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 )
Example #6
0
 def test_look_at_app_detail_without_pdf(self):
     user = self.ccpubdef_users[0]
     submission = random.choice(self.cc_submissions)
     self.run_sequence("Look at app detail", [
         S.get(
             'tried to go to app detail',
             reverse('intake-app_detail',
                     kwargs={'submission_id': submission.id})),
         S.fill_form(
             'entered login info', login=user.email, password=fake_password)
     ], base.SMALL_DESKTOP)
Example #7
0
 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)
Example #8
0
 def test_look_at_app_bundle_of_another_org(self):
     user = self.ccpubdef_users[0]
     submissions = self.sf_submissions
     self.run_sequence("Look at bundle of another org", [
         S.get(
             'tried to go to app bundle',
             url_with_ids('intake-app_bundle', [s.id
                                                for s in submissions])),
         S.fill_form(
             'entered login info', login=user.email, password=fake_password)
     ], base.SMALL_DESKTOP)
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
 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)
Example #12
0
 def test_look_at_alameda_app_detail(self):
     user = self.a_pubdef_user
     submission = random.choice(self.a_pubdef_submissions)
     self.run_sequence(
         "Look at alameda app detail",
         [
             S.get('tried to go to app detail',
                   reverse('intake-app_detail',
                           kwargs={'submission_id': submission.id})),
             S.fill_form('entered login info',
                         login=user.email, password=fake_password)
         ], base.SMALL_DESKTOP)
Example #13
0
 def test_look_at_app_bundle_without_pdf(self):
     user = self.cc_pubdef_user
     bundle = models.ApplicationBundle.create_with_submissions(
         submissions=self.cc_pubdef_submissions,
         organization=self.cc_pubdef)
     self.run_sequence("Look at app bundle", [
         S.get(
             'tried to go to app bundle',
             reverse('intake-app_bundle_detail',
                     kwargs=dict(bundle_id=bundle.id))),
         S.fill_form(
             'entered login info', login=user.email, password=fake_password)
     ], base.SMALL_DESKTOP)
Example #14
0
 def test_look_at_app_detail_with_pdf(self):
     user = self.sf_pubdef_user
     submission = random.choice(self.sf_pubdef_submissions)
     self.run_sequence(
         "Look at app with pdf",
         [
             S.get('tried to go to app detail',
                   reverse('intake-app_detail',
                           kwargs={'submission_id': submission.id})),
             S.fill_form('entered login info',
                         login=user.email, password=fake_password),
             S.wait('wait for pdf to load', 1)
         ], base.SMALL_DESKTOP)
Example #15
0
 def test_public_views(self):
     self.run_sequence("Browse public views", [
         S.get("splash page", '/'),
         S.get("application form", '/apply/'),
         S.get("privacy policy", '/privacy/'),
         S.get("stats", '/stats/'),
         S.get("partners", '/partners/'),
         S.get("EBCLC partner page", '/partners/ebclc/'),
         S.get("SF partner page", '/partners/sf_pubdef/'),
     ],
                       size=base.SMALL_DESKTOP)
Example #16
0
 def test_look_at_app_bundle(self):
     user = self.users[0]
     submissions = random.sample(
         self.submissions, 3)
     self.run_sequence(
         "Look at app bundle",
         [
             S.get('tried to go to app bundle',
                 url_with_ids('intake-app_bundle', [s.id for s in submissions])),
             S.fill_form('entered login info',
                 login=user.email, password=fake_password),
             S.wait('wait for pdf to load', 4)
         ], base.SMALL_DESKTOP)
Example #17
0
 def test_look_at_app_bundle_with_pdf(self):
     user = self.sfpubdef_users[0]
     submissions = self.sf_submissions
     self.run_sequence("Look at app pdf bundle", [
         S.get(
             'tried to go to app bundle',
             url_with_ids('intake-app_bundle', [s.id
                                                for s in submissions])),
         S.fill_form('entered login info',
                     login=user.email,
                     password=fake_password),
         S.wait('wait for pdf to load', 2)
     ], base.SMALL_DESKTOP)
Example #18
0
 def test_look_at_single_pdf(self):
     user = self.users[0]
     submission = random.choice(self.submissions)
     self.run_sequence(
         "Look at a single pdf",
         [
             S.get('tried to go to pdf',
                 reverse('intake-filled_pdf',
                     kwargs={'submission_id': submission.id})),
             S.fill_form('entered login info',
                 login=user.email, password=fake_password),
             S.wait('wait for pdf to load', 2)
         ], base.SMALL_DESKTOP)
Example #19
0
 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)
Example #20
0
 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)
Example #21
0
 def test_look_at_app_bundle_without_pdf(self):
     user = self.cc_pubdef_user
     bundle = models.ApplicationBundle.create_with_submissions(
         submissions=self.cc_pubdef_submissions,
         organization=self.cc_pubdef)
     self.run_sequence(
         "Look at app bundle",
         [
             S.get('tried to go to app bundle',
                   reverse('intake-app_bundle_detail',
                           kwargs=dict(bundle_id=bundle.id))),
             S.fill_form('entered login info',
                         login=user.email, password=fake_password)
         ], base.SMALL_DESKTOP)
Example #22
0
 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)
Example #23
0
 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)
Example #24
0
 def test_public_views(self):
     self.run_sequence(
         "Browse public views",
         [
             S.get("splash page", '/'),
             S.get("application form", '/apply/'),
             S.get("privacy policy", '/privacy/'),
             S.get("stats", '/stats/'),
             S.get("partners", '/partners/'),
             S.get("EBCLC partner page", '/partners/ebclc/'),
             S.get("SF partner page", '/partners/sf_pubdef/'),
         ],
         size=base.SMALL_DESKTOP
     )
Example #25
0
 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)
Example #26
0
 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)
Example #27
0
 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)