コード例 #1
0
 def test_successful_project_editing_with_subject_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_DATA)))
     edit_project_page = project_overview_page.navigate_to_edit_project_page()
     self.assertEqual(VALID_DATA, edit_project_page.get_project_details())
     edit_project_page.type_project_name(WATER_POINT_DATA)
     light_box = edit_project_page.edit_subject(WATER_POINT_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_WATER_POINT))[0])
     self.assertEqual(create_questionnaire_page.get_question_link_text(2),
                      fetch_(QUESTIONS, from_(QUESTIONNAIRE_DATA_FOR_WATER_POINT))[1])
     create_questionnaire_page.go_back()
     self.assertEqual(WATER_POINT_DATA, edit_project_page.get_project_details())
コード例 #2
0
    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)