def test_register_ngo_without_entering_data(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(WITHOUT_ENTERING_REQUIRED_FIELDS) self.assertRegexpMatches( registration_page.get_error_message(), WITHOUT_ENTERING_REQUIRED_FIELDS_ERROR_MESSAGE)
def test_register_ngo_with_existing_email_address(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(EXISTING_EMAIL_ADDRESS) self.assertEquals(registration_page.get_error_message(), EXISTING_EMAIL_ADDRESS_ERROR_MESSAGE) a = self.driver.switch_to_active_element() self.assertEqual(a.get_attribute("value"), EXISTING_EMAIL_ADDRESS.get(ORGANIZATION_OFFICE_PHONE))
def test_register_ngo_with_invalid_web_url(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(INVALID_WEBSITE_URL) time.sleep(5) self.assertEquals(registration_page.get_error_message(), fetch_(ERROR_MESSAGE, from_(INVALID_WEBSITE_URL)))
def prerequisites_of_activate_account(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_confirmation_page, self.email = registration_page.successful_registration_with(REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION) self.assertEquals(registration_confirmation_page.registration_success_message(), fetch_(SUCCESS_MESSAGE, from_(REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION))) return self.email
def test_register_ngo_without_entering_data(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(WITHOUT_ENTERING_REQUIRED_FIELDS) time.sleep(5) self.assertEquals(registration_page.get_error_message(), fetch_(ERROR_MESSAGE, from_(WITHOUT_ENTERING_REQUIRED_FIELDS)))
def test_register_ngo_with_unmatched_passwords(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(UNMATCHED_PASSWORD) time.sleep(5) self.assertEquals(registration_page.get_error_message(), fetch_(ERROR_MESSAGE, from_(UNMATCHED_PASSWORD)))
def test_register_ngo_with_invalid_email_address(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(INVALID_EMAIL_FORMAT) time.sleep(5) self.assertEquals(registration_page.get_error_message(), fetch_(ERROR_MESSAGE, from_(INVALID_EMAIL_FORMAT)))
def test_register_ngo_with_existing_email_address(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(EXISTING_EMAIL_ADDRESS) time.sleep(5) self.assertEquals(registration_page.get_error_message(), fetch_(ERROR_MESSAGE, from_(EXISTING_EMAIL_ADDRESS)))
def register_trial_account(self): self.driver.go_to(url("/register/trial")) registration_page = RegistrationPage(self.driver) registration_confirmation_page, email = registration_page.successful_registration_with( REGISTRATION_DATA_FOR_SUCCESSFUL_TRIAL_REGISTRATION) self.assertEquals(registration_confirmation_page.registration_success_message(), SUCCESS_MESSAGE)
def test_successful_registration(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_confirmation_page, email = registration_page.successful_registration_with(REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION) self.assertEquals(registration_confirmation_page.registration_success_message(), fetch_(SUCCESS_MESSAGE, from_(REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION)))
def test_register_without_preferred_payment(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_confirmation_page, email = registration_page.successful_registration_with( WITHOUT_PREFERRED_PAYMENT) self.assertEquals( registration_confirmation_page.registration_success_message(), REGISTRATION_SUCCESS_MESSAGE)
def register_trial_account(self): self.driver.go_to("localhost:%s/register/trial" % get_test_port()) registration_page = RegistrationPage(self.driver) registration_confirmation_page, email = registration_page.successful_registration_with( REGISTRATION_DATA_FOR_SUCCESSFUL_TRIAL_REGISTRATION) time.sleep(2) self.assertEquals( registration_confirmation_page.registration_success_message(), SUCCESS_MESSAGE)
def test_user_focus_must_be_on_email_field(self): self.driver.go_to(DATA_WINNER_REGISTER_TRIAL_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with( REGISTRATION_DATA_FOR_UNSUCCESSFUL_TRIAL_REGISTRATION) self.assertEqual(registration_page.get_error_message(), INVALID_EMAIL_ERROR_MESSAGE) a = self.driver.switch_to_active_element() self.assertEqual(a.get_attribute("id"), u"id_email")
def prerequisites_of_activate_account(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_confirmation_page, self.email = registration_page.successful_registration_with( REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION) self.assertEquals( registration_confirmation_page.registration_success_message(), fetch_(SUCCESS_MESSAGE, from_(REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION))) return self.email
def navigate_to_registration_page(self): """ Function to click on register page link which is available on the login page Return RegistrationPage """ self.driver.find(CREATE_AN_ACCOUNT_LINK).click() return RegistrationPage(self.driver)
def test_register_ngo_with_begin_end_spaced_password(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(BEGIN_END_SPACED_PASSWORD) self.assertEquals(BEGIN_END_SPACED_PASSWORD_ERROR_MESSAGE, registration_page.get_error_message())
def register_and_get_email_for_trial(driver): driver.go_to(DATA_WINNER_REGISTER_TRIAL_PAGE) registration_page = RegistrationPage(driver) registration_confirmation_page, email = registration_page.successful_registration_with( REGISTRATION_DATA_FOR_SUCCESSFUL_TRIAL_REGISTRATION) return registration_confirmation_page, email
def register_and_get_email(driver): driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(driver) return registration_page.successful_registration_with( REGISTRATION_DATA_FOR_SUCCESSFUL_REGISTRATION)
def test_register_ngo_with_white_space_passwords(self): self.driver.go_to(DATA_WINNER_REGISTER_PAGE) registration_page = RegistrationPage(self.driver) registration_page.register_with(WHITE_SPACE_IN_SOME_FIELDS) self.assertEquals(registration_page.get_error_message(), WHITE_SPACES_ERROR_MESSAGE)