示例#1
0
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that Course Topics screen will show following Header contents:
                Back icon
                Specific "<Topic name>" as Title
            Verify that user should be able to go back by clicking Back icon
            Verify that user should be able to view these on Every Topic in the list:
                Topic name
                Topic icon
            download icon to video (if available)
            Verify that on Clicking any topic Specific resource screen should be loaded successfully
        """

        global_contents = Globals(setup_logging)
        android_course_dashboard_page = AndroidCourseDashboard(set_capabilities, setup_logging)
        android_my_courses_list_page = AndroidMyCoursesList(set_capabilities, setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        android_course_section_page = AndroidCourseSubsection(set_capabilities, setup_logging)

        assert android_main_dashboard_page.load_courses_tab()
        if android_my_courses_list_page.get_my_courses_list_row():
            android_my_courses_list_page.load_course_details_screen()
        else:
            setup_logging.info('No course enrolled by this user.')

        topic_name = android_course_section_page.get_course_row_header().text
        android_course_section_page.get_course_row_header().click()
        assert android_course_dashboard_page.get_navigation_icon().get_attribute('content-desc') \
            == strings.COURSE_DASHBOARD_NAVIGATION_ICON
        android_course_dashboard_page.get_navigation_icon().click()
        assert android_course_section_page.on_screen() == global_contents.COURSE_DASHBOARD_ACTIVITY_NAME

        android_course_section_page.get_course_row_header().click()
        if topic_name:
            # Verifing the title of the screen
            assert android_course_dashboard_page.get_all_text_views()[0].text in topic_name

        assert android_course_dashboard_page.get_course_content_header()
        assert android_course_section_page.get_course_topic_icon()
        assert android_course_section_page.get_course_video_icon()
        assert android_course_section_page.get_course_topic_row().text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT
        assert android_course_section_page.get_course_video_row().text == strings.COURSE_SUBSECTION_VIDEO_ROW_TEXT
        assert android_course_section_page.get_topic_download_icon()

        course_topic_content = android_course_section_page.get_course_topic_row().text
        course_video_content = android_course_section_page.get_course_video_row().text

        android_course_section_page.get_course_topic_row().click()
        assert android_course_dashboard_page.get_all_text_views()[0].text in course_topic_content
        set_capabilities.back()

        android_course_section_page.get_course_video_row().click()
        assert android_course_dashboard_page.get_all_text_views()[0].text in course_video_content
        set_capabilities.back()
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
        Verify that Course Dashboard tab will show following contents,
        Header contents,
            Back icon,
            Specific "<course name>" as Title, Share icon, Course,
        Verify that user should be able to go back by clicking Back icon
        Verify that user should be able to view these Course contents:
            Course Image, Course Name, Course Provider, Course Ending date,
            Last accessed(if any), Course Content,
        Verify all screen contents have their default values
        """

        global_contents = Globals(setup_logging)
        android_course_dashboard_page = AndroidCourseDashboard(
            set_capabilities, setup_logging)
        android_my_courses_list_page = AndroidMyCoursesList(
            set_capabilities, setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_main_dashboard_page.load_courses_tab()
        if android_my_courses_list_page.get_my_courses_list_row():
            course_name = android_my_courses_list_page.get_first_course().text
            android_my_courses_list_page.get_first_course().click()
        else:
            setup_logging.info('No course enrolled by this user.')

        assert android_course_dashboard_page.get_navigation_icon().get_attribute('content-desc') \
            == strings.COURSE_DASHBOARD_NAVIGATION_ICON
        android_course_dashboard_page.get_navigation_icon().click()
        assert android_main_dashboard_page.on_screen(
        ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME
        android_my_courses_list_page.load_course_details_screen()

        if course_name:
            # Verifing the title of the screen
            assert android_course_dashboard_page.get_all_text_views(
            )[0].text in course_name

        assert android_course_dashboard_page.get_course_share_icon().get_attribute('content-desc') \
            == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID
        assert android_course_dashboard_page.get_course_image()
        # verifing course name that is overlapping the course image
        assert android_course_dashboard_page.get_course_name(
        ).text in course_name
        assert android_course_dashboard_page.get_course_date()
        assert android_course_dashboard_page.get_resume_course_bar()
        assert android_course_dashboard_page.get_course_content_header()
    def test_video_tab_contents_smoke(self, set_capabilities, setup_logging):
        """
        Verify Video tab showing following content:
        Videos as title
        course share icon
        Video TV title
        Video TV sub-title
        Video icon
        Download to device toggle
        Verify download to device permission dialouge contents:
        Allow button
        Deny Button
        Permission message
        """

        global_contents = Globals(setup_logging)
        android_course_dashboard_page = AndroidCourseDashboard(
            set_capabilities, setup_logging)
        android_course_section_page = AndroidCourseSubsection(
            set_capabilities, setup_logging)

        android_course_dashboard_page.get_videos_tab().click()
        topic_name = android_course_section_page.get_course_row_title().text
        android_course_section_page.get_course_row_title().click()

        assert topic_name in android_course_dashboard_page.get_all_text_views(
        )[0].text

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_tv_title
        ).text == strings.VIDEO_DASHBOARD_TV_TITLE

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_tv_subtitle
        ).text == strings.VIDEO_SUBSECTION_TV_SUBTITLE

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dahboard_video_icon)

        assert global_contents.get_element_by_id(
            set_capabilities,
            android_elements.video_dashboard_bulk_download_toggle)

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_download_bar)
        assert android_course_dashboard_page.get_course_content_header().text
示例#4
0
    def test_video_tab_contents_smoke(self, set_capabilities, setup_logging):
        """
        Verify Video tab showing following content:
        Videos as title
        course share icon
        Video TV title
        Video TV sub-title
        Video icon
        Download to device toggle
        Verify download to device permission dialouge contents:
        Allow button
        Deny Button
        Permission message
        """

        global_contents = Globals(setup_logging)
        android_course_dashboard_page = AndroidCourseDashboard(
            set_capabilities, setup_logging)
        android_course_dashboard_page.get_videos_tab().click()
        assert android_course_dashboard_page.get_all_text_views()[0].text \
            == strings.COURSE_DASHBOARD_VIDEOS_TAB
        assert android_course_dashboard_page.get_course_share_icon().get_attribute('content-desc') \
            == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_tv_title
        ).text == strings.VIDEO_DASHBOARD_TV_TITLE

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_tv_subtitle
        ).text == strings.VIDEO_DASHBOARD_TV_SUBTITLE

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dahboard_video_icon)

        assert global_contents.get_element_by_id(
            set_capabilities,
            android_elements.video_dashboard_bulk_download_toggle)

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dashboard_download_bar)
        assert android_course_dashboard_page.get_course_content_header().text
    def test_subsection_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user should be able to view these on Every Topic in the list:
                Topic name
                Topic icon
            download icon to video (if available)
            Verify that on Clicking any topic Specific resource screen should be loaded successfully
        """

        android_course_dashboard_page = AndroidCourseDashboard(
            set_capabilities, setup_logging)
        android_course_section_page = AndroidCourseSubsection(
            set_capabilities, setup_logging)

        assert android_course_dashboard_page.get_course_content_header()
        assert android_course_section_page.get_course_topic_row(
        ).text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT
        assert android_course_section_page.get_course_video_row(
        ).text == strings.COURSE_SUBSECTION_VIDEO_ROW_TEXT
        assert android_course_section_page.get_topic_download_icon()

        course_topic_content = android_course_section_page.get_course_row_title(
        ).text

        android_course_section_page.get_course_row_title().click()
        assert android_course_dashboard_page.get_all_text_views(
        )[0].text in course_topic_content
        set_capabilities.back()

        course_video_content = android_course_section_page.get_course_video_row(
        ).text
        android_course_section_page.get_course_video_row().click()
        navigation_icon = android_course_dashboard_page.get_navigation_icon()
        assert navigation_icon.get_attribute(
            'content-desc') == strings.COURSE_DASHBOARD_NAVIGATION_ICON
        assert android_course_dashboard_page.get_all_text_views(
        )[0].text in course_video_content