Exemple #1
0
    def add_edit_datasender(self):
        global_navigation = GlobalNavigationPage(self.driver)
        all_data_sender_page = global_navigation.navigate_to_all_data_sender_page(
        )
        add_data_sender_page = all_data_sender_page.navigate_to_add_a_data_sender_page(
        )
        email = generate_random_email_id()
        add_data_sender_page.enter_data_sender_details_from(
            VALID_DATA_WITH_EMAIL, email=email)
        success_msg = add_data_sender_page.get_success_message()
        self.assertIn(fetch_(SUCCESS_MESSAGE, from_(VALID_DATA_WITH_EMAIL)),
                      success_msg)
        add_data_sender_page.navigate_to_datasender_page()
        all_data_sender_page = AllDataSendersPage(self.driver)

        rep_id = success_msg.replace(VALID_DATA_WITH_EMAIL[SUCCESS_MESSAGE],
                                     '')
        all_data_sender_page.select_a_data_sender_by_id(rep_id)

        all_data_sender_page.select_edit_action()
        time.sleep(2)
        edit_datasender_page = AddDataSenderPage(self.driver)
        edit_datasender_page.enter_data_sender_details_from(
            VALID_DATA_WITH_EMAIL_FOR_EDIT)
        self.assertRegexpMatches(
            edit_datasender_page.get_success_message(),
            fetch_(SUCCESS_MSG, from_(VALID_DATA_WITH_EMAIL_FOR_EDIT)))

        edit_datasender_page.navigate_to_datasender_page()
        all_data_sender_page = AllDataSendersPage(self.driver)
        all_data_sender_page.associate_datasender_to_projects(
            rep_id, [self.project_name])
        return email
    def test_create_and_activate_datasender(self):
        self.driver.go_to(DATA_WINNER_LOGIN_PAGE)
        login_page = LoginPage(self.driver)
        global_navigation_page = login_page.do_successful_login_with(
            VALID_CREDENTIALS)
        add_datasender_page = global_navigation_page.navigate_to_all_data_sender_page(
        ).navigate_to_add_a_data_sender_page()
        email = generate_random_email_id()
        add_datasender_page.enter_data_sender_details_from(VALID_DATASENDER,
                                                           email=email)
        success_message = add_datasender_page.get_success_message()
        self.assertIn(VALID_DATASENDER[SUCCESS_MSG], success_message)
        rep_id = add_datasender_page.get_rep_id_from_success_message(
            success_message)
        add_datasender_page.close_add_datasender_dialog()
        all_datasender_page = global_navigation_page.navigate_to_all_data_sender_page(
        )
        all_datasender_page.associate_datasender_to_projects(
            rep_id, ["clinic test project1"])
        self.driver.go_to(LOGOUT)

        user = User.objects.get(username=email)
        token = default_token_generator.make_token(user)
        self.driver.go_to(
            url(DS_ACTIVATION_URL % (int_to_base36(user.id), token)))
        activation_page = ResetPasswordPage(self.driver)
        activation_page.type_same_password(NEW_PASSWORD)
        activation_page.click_submit()
        self.driver.wait_for_page_with_title(UI_TEST_TIMEOUT,
                                             "Data Submission")
        self.assertEqual(self.driver.get_title(), "Data Submission")
Exemple #3
0
 def _register_datasender(self):
     data_sender_page = self.submission_log_page.navigate_to_datasenders_page()
     add_data_sender_page = data_sender_page.navigate_to_add_a_data_sender_page()
     email = generate_random_email_id()
     add_data_sender_page.enter_data_sender_details_from(VALID_DATA_WITH_EMAIL, email=email)
     success_msg = add_data_sender_page.get_success_message()
     self.assertIn("Registration successful. ID is: ", success_msg)
     self._activate_datasender(email)
     return success_msg.split(": ")[1], email
Exemple #4
0
 def test_registration_of_datasender(self):
     project_data_sender_page = self.all_data_page.navigate_to_my_data_senders_page(
         'clinic2 test project')
     email = generate_random_email_id()
     add_data_sender_page = project_data_sender_page.navigate_to_add_a_data_sender_page()\
         .enter_data_sender_details_from(VALID_DATASENDER, email=email)
     self.assertIn(VALID_DATASENDER[SUCCESS_MSG],
                   add_data_sender_page.get_success_message())
     add_data_sender_page.close_add_datasender_dialog()
     self.driver.go_to(LOGOUT)
     DataSenderActivationPage(self.driver).activate_datasender(
         email, NEW_PASSWORD)
     self.driver.wait_for_page_with_title(UI_TEST_TIMEOUT,
                                          "Data Submission")
     self.assertEqual(self.driver.get_title(), "Data Submission")
DELETE_DS_WITHOUT_SELECTING_DS = {PROJECT_NAME: "clinic test project1", ERROR_MSG: ERROR_MSG_WITHOUT_SELECTING_DS}

VALID_SMS = {SENDER: "919049008976",
             RECEIVER: '919880734937',
             SMS: "cli001 .EID cid003 .NA Mr. Pitt .FA 77 .RD 12.03.2007 .BG b .SY ade .GPS 27.178057 -78.007789 .RM ac",
             SUCCESS_MESSAGE: THANKS}#+ u" EID: cid003 NA: Mr. Pitt FA: 77 RD: 12.03.2007 BG: O- SY: Rapid weight loss,Memory loss,Neurological disorders GPS: 27.178057, -78.007789 RM: Hivid,Vidéx EC"}

VALID_DATA = {NAME: "ReRegistered",
              MOBILE_NUMBER: "919049008976",
              COMMUNE: "MAHAVELO,AMBOTAKA,MANAKARA ATSIMO,VATOVAVY FITOVINANY",
              GPS: "-21.7622088847 48.0690991394",
              SUCCESS_MSG: "Registration successful. ID is: rep"}

VALID_DATASENDER_WITHOUT_WEB_ACCESS = {NAME: "aaa Kimi",
                                       MOBILE_NUMBER: random_number(9),
                                       EMAIL_ADDRESS: generate_random_email_id(),
                                       COMMUNE: "MAHAVELO,AMBOTAKA,MANAKARA ATSIMO,VATOVAVY FITOVINANY",
                                       GPS: "-21.7622088847 48.0690991394",
                                       SUCCESS_MSG: "Registration successful. ID is: rep"}

DATA_SENDER_TO_DELETE = {NAME: "ALLDSDelete",
                         MOBILE_NUMBER: random_number(9),
                         COMMUNE: "MAHAVELO,AMBOTAKA,MANAKARA ATSIMO,VATOVAVY FITOVINANY",
                         GPS: "-21.7622088847 48.0690991394",
                         SUCCESS_MSG: "Registration successful. ID is: rep"}

DATA_SENDER_FOR_MULTIPLE_DELETE = {NAME: "ALLDSDelete",
                                   MOBILE_NUMBER: random_number(9),
                                   COMMUNE: "MAHAVELO,AMBOTAKA,MANAKARA ATSIMO,VATOVAVY FITOVINANY",
                                   GPS: "-21.7622088847 48.0690991394",
                                   SUCCESS_MSG: "Registration successful. ID is: rep"}