def set_update_personal_button(): click_element( wait_for_element(ps='clicking "Update Personal" button', css_select='input.btn.btn-primary'))
def set_update_personal_button(): click_element(wait_for_element(ps='clicking "Update Personal" button', css_select='input.btn.btn-primary'))
def test_ep_fields_workaround(self): # This test is a workaround for test_ep_fields_fails # This test can also fail based on issues detailed in bug #2 report funcs = [ set_random_first_name, set_random_last_name, set_random_city, set_random_state_dropdown, set_random_zip2, set_random_birthdate ] selected = [None] # write fields in random order random_last_name = None random_city = None random_state_dropdown = None random_zip = None random_birthdate = None set_update_personal_button() for _ in funcs: random_index = None while random_index in selected: random_index = random.randrange(len(funcs)) val = funcs[random_index]() selected.append(random_index) # check profile values if random_index == 0: random_first_name = val elif random_index == 1: random_last_name = val elif random_index == 2: random_city = val elif random_index == 3: random_state_dropdown = val elif random_index == 4: random_zip = val else: random_birthdate = val set_update_personal_button() # confirm dashboard messages, links expected = 'This app is designed and created for the sole use of screening QA candidates for AvantCredit, any other use is prohibitted' actual = self.get_landing_dash_text() self.assertEqual( expected, actual, msg='FAILED: expected text on dashboard page = "{0}", got = "{1}"'. format(expected, actual)) test_print( 'Successfully verified dashboard page text = "{0}"'.format(actual), flash='!') expected = 'Succesfully updated profile' actual = get_dash_ep_text() self.assertEqual( expected, actual, msg='FAILED: expected text on dashboard page = "{0}", got = "{1}"'. format(expected, actual)) test_print( 'Successfully verified dashboard page text = "{0}"'.format(actual), flash='!') expected = 'Sign out | Edit Profile' self.assertEqual( expected, self.h1, msg='FAILED: expected h1 text on dashboard page = "{0}", got = "{1}"' .format(expected, self.h1)) test_print('Successfully verified h1 text = "{0}"'.format(self.h1), flash='!') # click edit profile and confirm values set_edit_profile_link() # fn self.assertTrue( assert_displayed(wait_for_element(value=random_first_name))) test_print( 'Successfully verified "{0}" in the first name field'.format( random_first_name), flash='!') # ln self.assertTrue( assert_displayed(wait_for_element(value=random_last_name))) test_print('Successfully verified "{0}" in the last name field'.format( random_last_name), flash='!') # city self.assertTrue(assert_displayed(wait_for_element(value=random_city))) test_print('Successfully verified "{0}" in the city field'.format( random_city), flash='!') # state self.assertTrue( assert_displayed( wait_for_element(value=str(random_state_dropdown)))) test_print('Successfully verified "{0}" in the state field'.format( random_state_dropdown), flash='!') # zip self.assertTrue(assert_displayed(wait_for_element(value=random_zip))) test_print( 'Successfully verified "{0}" in the zip field'.format(random_zip), flash='!') # birthdate self.assertTrue( assert_displayed(wait_for_element(value=random_birthdate))) test_print('Successfully verified "{0}" in the birthdate field'.format( random_birthdate), flash='!')
def test_ep_fields_workaround(self): # This test is a workaround for test_ep_fields_fails # This test can also fail based on issues detailed in bug #2 report funcs = [set_random_first_name, set_random_last_name, set_random_city, set_random_state_dropdown, set_random_zip2, set_random_birthdate] selected = [None] # write fields in random order random_last_name = None random_city = None random_state_dropdown = None random_zip = None random_birthdate = None set_update_personal_button() for _ in funcs: random_index = None while random_index in selected: random_index = random.randrange(len(funcs)) val = funcs[random_index]() selected.append(random_index) # check profile values if random_index == 0: random_first_name = val elif random_index == 1: random_last_name = val elif random_index == 2: random_city = val elif random_index == 3: random_state_dropdown = val elif random_index == 4: random_zip = val else: random_birthdate = val set_update_personal_button() # confirm dashboard messages, links expected = 'This app is designed and created for the sole use of screening QA candidates for AvantCredit, any other use is prohibitted' actual = self.get_landing_dash_text() self.assertEqual(expected, actual, msg='FAILED: expected text on dashboard page = "{0}", got = "{1}"'.format(expected, actual)) test_print('Successfully verified dashboard page text = "{0}"'.format(actual), flash='!') expected = 'Succesfully updated profile' actual = get_dash_ep_text() self.assertEqual(expected, actual, msg='FAILED: expected text on dashboard page = "{0}", got = "{1}"'.format(expected, actual)) test_print('Successfully verified dashboard page text = "{0}"'.format(actual), flash='!') expected = 'Sign out | Edit Profile' self.assertEqual(expected, self.h1, msg='FAILED: expected h1 text on dashboard page = "{0}", got = "{1}"'.format(expected, self.h1)) test_print('Successfully verified h1 text = "{0}"'.format(self.h1), flash='!') # click edit profile and confirm values set_edit_profile_link() # fn self.assertTrue(assert_displayed(wait_for_element(value=random_first_name))) test_print('Successfully verified "{0}" in the first name field'.format(random_first_name), flash='!') # ln self.assertTrue(assert_displayed(wait_for_element(value=random_last_name))) test_print('Successfully verified "{0}" in the last name field'.format(random_last_name), flash='!') # city self.assertTrue(assert_displayed(wait_for_element(value=random_city))) test_print('Successfully verified "{0}" in the city field'.format(random_city), flash='!') # state self.assertTrue(assert_displayed(wait_for_element(value=str(random_state_dropdown)))) test_print('Successfully verified "{0}" in the state field'.format(random_state_dropdown), flash='!') # zip self.assertTrue(assert_displayed(wait_for_element(value=random_zip))) test_print('Successfully verified "{0}" in the zip field'.format(random_zip), flash='!') # birthdate self.assertTrue(assert_displayed(wait_for_element(value=random_birthdate))) test_print('Successfully verified "{0}" in the birthdate field'.format(random_birthdate), flash='!')