def verify_summary_report_project_creation(self):
     self.driver.wait_for_element(UI_TEST_TIMEOUT,
                                  by_css('#global_dashboard_link'))
     global_navigation_page = GlobalNavigationPage(self.driver)
     dashboard_page = global_navigation_page.navigate_to_dashboard_page()
     create_project_page = dashboard_page.navigate_to_create_project_page()
     create_project_page.create_project_with(VALID_SUMMARY_REPORT_DATA)
     create_project_page.continue_create_project()
     questionnaire_page = CreateQuestionnairePage(self.driver)
     overview_page = questionnaire_page.save_and_create_project_successfully(
     )
     self.summary_project_name = overview_page.get_project_title()
     self.summary_project_questionnaire_code = overview_page.get_questionnaire_code(
     )
     return overview_page
    def create_new_project(cls):
        if cls.project_name:
            all_project_page = cls.global_navigation.navigate_to_view_all_project_page()
            overview_page = all_project_page.navigate_to_project_overview_page(cls.project_name)
            return overview_page

        dashboard_page = cls.global_navigation.navigate_to_dashboard_page()
        create_project_page = dashboard_page.navigate_to_create_project_page()
        create_project_page.create_project_with(CLINIC_PROJECT_DATA)
        create_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(cls.driver)
        create_questionnaire_page.create_questionnaire_with(QUESTIONNAIRE_DATA_CLINIC_PROJECT)
        overview_page = create_questionnaire_page.save_and_create_project_successfully()
        cls.project_name = overview_page.get_project_title()
        return overview_page
Example #3
0
 def prerequisites_of_edit_questionnaire(self):
     all_project_page = self.global_navigation.navigate_to_view_all_project_page()
     project_overview_page = all_project_page.navigate_to_project_overview_page(
         fetch_(PROJECT_NAME, from_(VALID_PROJECT_DATA)))
     edit_project_page = project_overview_page.navigate_to_edit_project_page()
     edit_project_page.continue_create_project()
     return CreateQuestionnairePage(self.driver)
 def navigate_to_edit_registration_form(self,
                                        entity_type,
                                        close_warning=False):
     self.driver.go_to(url("/entity/subject/edit/%s/" %
                           entity_type.lower()))
     if close_warning:
         self.driver.find(CONTINUE_EDITING_BUTTON).click()
     return CreateQuestionnairePage(self.driver)
Example #5
0
    def create_new_project(self):
        dashboard_page = self.global_navigation.navigate_to_dashboard_page()
        create_project_page = dashboard_page.navigate_to_create_project_page()
        create_project_page.create_project_with(CREATE_NEW_PROJECT_DATA)
        project_name = create_project_page.get_project_name()
        create_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(self.driver)

        return create_questionnaire_page, project_name
Example #6
0
 def test_successful_project_editing_with_report_type_change(self):
     all_project_page = self.prerequisites_of_edit_project()
     project_overview_page = all_project_page.navigate_to_project_overview_page(
         fetch_(PROJECT_NAME, from_(VALID_DATA2)))
     edit_project_page = project_overview_page.navigate_to_edit_project_page()
     self.assertEqual(VALID_DATA2, edit_project_page.get_project_details())
     edit_project_page.type_project_name(REPORTER_ACTIVITIES_DATA)
     edit_project_page.type_project_description(REPORTER_ACTIVITIES_DATA)
     light_box = edit_project_page.select_report_type(REPORTER_ACTIVITIES_DATA)
     self.assertEquals(light_box.get_title_of_light_box(), fetch_(TITLE, from_(LIGHT_BOX_DATA)))
     self.assertEquals(light_box.get_message_from_light_box(), fetch_(MESSAGE, from_(LIGHT_BOX_DATA)))
     edit_project_page = light_box.continue_change()
     edit_project_page.continue_create_project()
     create_questionnaire_page = CreateQuestionnairePage(self.driver)
     self.assertEqual(create_questionnaire_page.get_question_link_text(1),
                      fetch_(QUESTIONS, from_(QUESTIONNAIRE_DATA_FOR_REPORTER_ACTIVITIES))[0])
     create_questionnaire_page.go_back()
     self.assertEqual(REPORTER_ACTIVITIES_DATA, edit_project_page.get_project_details())
Example #7
0
 def _create_project(cls):
     cls.dashboard_page = DashboardPage(cls.driver)
     create_project_page = cls.dashboard_page.navigate_to_create_project_page(
     )
     create_project_page.create_project_with(WATERPOINT_PROJECT_DATA)
     create_project_page.continue_create_project()
     CreateQuestionnairePage(cls.driver).create_questionnaire_with(
         WATERPOINT_QUESTIONNAIRE_DATA)
     return create_project_page.save_and_create_project_successfully()
Example #8
0
    def test_should_hide_tip_for_period_question_when_adding_new_question(self):
        self.driver.go_to(DATA_WINNER_LOGIN_PAGE)

        # going on all project page
        all_project_page = self.global_navigation.navigate_to_view_all_project_page()
        project_overview_page = all_project_page.navigate_to_project_overview_page("clinic6 test project")
        edit_project_page = project_overview_page.navigate_to_edit_project_page()
        edit_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(self.driver)
        self.assertFalse(create_questionnaire_page.period_question_tip_is_displayed())
        create_questionnaire_page.change_question_text(4, "new question label")
        time.sleep(1)
        self.assertTrue(create_questionnaire_page.period_question_tip_is_displayed())
        create_questionnaire_page.click_add_question_link()
        self.assertFalse(create_questionnaire_page.period_question_tip_is_displayed())
Example #9
0
 def prerequisites_of_create_questionnaire(self, project_data=VALID_DATA2):
     # doing successful login with valid credentials
     self.driver.go_to(DATA_WINNER_LOGIN_PAGE)
     login_page = LoginPage(self.driver)
     login_page.do_successful_login_with(VALID_CREDENTIALS)
     dashboard_page = DashboardPage(self.driver)
     # going on setup project page
     create_project_page = dashboard_page.navigate_to_create_project_page()
     #Navigating to Create Questionnaire Page by successfully creating a Project
     create_project_page.create_project_with(project_data)
     create_project_page.continue_create_project()
     return CreateQuestionnairePage(self.driver)
Example #10
0
    def successfully_create_subject_questionnaire_with(self, subject_data):
        """
        Function to enter and save the data on set up project page

        Args:
        registration_data is data to fill in the different fields like first
        name, last name, telephone number and commune

        Return self
        """
        self.driver.find(SAVE_CHANGES_BTN).click()
        return CreateQuestionnairePage(self.driver)
Example #11
0
    def save_questionnaire_successfully(self):
        """
        Function to save subject questionnaire

        Args:
        subject_data is data to fill in the different fields

        Return CreateQuestionnairePage
        """
        self.driver.find(SAVE_CHANGES_BTN).click()
        self.driver.wait_for_page_with_title(WAIT_FOR_TITLE, "Questionnaire")
        return CreateQuestionnairePage(self.driver)
Example #12
0
    def create_project(self):
        self.driver.go_to(DATA_WINNER_DASHBOARD_PAGE)
        dashboard_page = DashboardPage(self.driver)

        create_project_page = dashboard_page.navigate_to_create_project_page()
        create_project_page.create_project_with(VALID_PROJECT_DATA)
        create_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(self.driver)
        self.form_code = create_questionnaire_page.get_questionnaire_code()
        create_questionnaire_page.add_question(QUESTION)
        create_questionnaire_page.save_and_create_project_successfully()
Example #13
0
 def create_new_project(cls):
     dashboard = cls.global_navigation_page.navigate_to_dashboard_page()
     create_project_page = dashboard.navigate_to_create_project_page()
     create_project_page.create_project_with(NEW_PROJECT_DATA)
     create_project_page.continue_create_project()
     questionnaire_page = CreateQuestionnairePage(cls.driver)
     questionnaire_page.create_questionnaire_with(QUESTIONNAIRE_DATA)
     questionnaire_page.save_and_create_project_successfully()
     cls.driver.wait_for_page_with_title(5, 'Projects - Overview')
     return ProjectOverviewPage(cls.driver).get_project_title()
Example #14
0
    def create_project(cls):
        cls.driver.go_to(DATA_WINNER_DASHBOARD_PAGE)
        dashboard_page = DashboardPage(cls.driver)

        create_project_page = dashboard_page.navigate_to_create_project_page()
        VALID_PROJECT_DATA[SUBJECT] = cls.subject_type
        create_project_page.create_project_with(VALID_PROJECT_DATA)
        create_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(cls.driver)
        cls.form_code = create_questionnaire_page.get_questionnaire_code()
        create_questionnaire_page.add_question(QUESTION)
        create_questionnaire_page.save_and_create_project_successfully()
        cls.driver.wait_for_page_with_title(
            15, fetch_(PAGE_TITLE, from_(VALID_PROJECT_DATA)))
    def add_trial_organization_with_data_sender(self):
        registration_confirmation_page, email = register_and_get_email_for_trial(
            self.driver)
        self.emails.append(email)
        activate_account(self.driver, email)
        global_navigation_page = GlobalNavigationPage(self.driver)
        create_project_page = global_navigation_page.navigate_to_dashboard_page(
        ).navigate_to_create_project_page()
        create_project_page.create_project_with(
            VALID_DATA_FOR_PROJECT).continue_create_project()
        CreateQuestionnairePage(
            self.driver).save_and_create_project_successfully()

        add_data_sender_page = global_navigation_page.navigate_to_all_data_sender_page(
        ).navigate_to_add_a_data_sender_page()
        add_data_sender_page.enter_data_sender_details_from(
            VALID_DATA_FOR_DATA_SENDER1)
        return add_data_sender_page
Example #16
0
 def _create_project(self, project_data, monthly):
     self.driver.go_to(DATA_WINNER_DASHBOARD_PAGE)
     self.dashboard_page = DashboardPage(self.driver)
     create_project_page = self.dashboard_page.navigate_to_create_project_page(
     )
     create_project_page.create_project_with(project_data)
     create_project_page.continue_create_project()
     if monthly:
         create_questionnaire_page = CreateQuestionnairePage(self.driver)
         create_questionnaire_page.select_question_link(2)
         create_questionnaire_page.change_date_type_question(
             date_format=MM_YYYY)
     create_project_page.save_and_create_project_successfully()
    def test_successful_questionnaire_creation(self):
        create_project_page = self.goto_dashboard().navigate_to_create_project_page()
        create_project_page.create_project_with(CLINIC_PROJECT_DATA)
        create_project_page.continue_create_project()
        create_questionnaire_page = CreateQuestionnairePage(self.driver)
        create_questionnaire_page.create_questionnaire_with(QUESTIONNAIRE_DATA_WITH_MANY_MC_QUSTIONS)

        index = 3
        for question in fetch_(QUESTIONS, from_(QUESTIONNAIRE_DATA_WITH_MANY_MC_QUSTIONS)):
            question_link_text = fetch_(QUESTION, from_(question))
            self.assertEquals(create_questionnaire_page.get_question_link_text(index), question_link_text)
            index += 1
        overview_page = create_questionnaire_page.save_and_create_project_successfully()
        project_name = overview_page.get_project_title()
        self.assertTrue(fetch_(PROJECT_NAME, from_(CLINIC_PROJECT_DATA)) in project_name)
 def create_project(self, create_project_page):
     create_project_page.create_project_with(VALID_DATA_FOR_PROJECT)
     create_project_page.continue_create_project()
     return CreateQuestionnairePage(self.driver)
 def create_or_navigate_to_project_questionnaire_page(self):
     project_overview_page = self.create_new_project()
     edit_project_page = project_overview_page.navigate_to_edit_project_page()
     edit_project_page.continue_create_project()
     return CreateQuestionnairePage(self.driver)