def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
        Verify that Course Resources tab will show Back icon,
        Verify that user should be able to go back by clicking Back icon
        """

        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():
            android_my_courses_list_page.get_first_course().click()
        else:
            setup_logging.info('No course enrolled by this user.')

        resources_tab_element = android_course_dashboard_page.get_resources_tab()
        resources_tab_element.click()
        assert resources_tab_element.get_attribute('selected') == 'true'

        navigation_icon = android_course_dashboard_page.get_navigation_icon()
        assert 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()
        android_course_dashboard_page.get_resources_tab().click()
示例#2
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify on tapping "Videos" tab will load Videos screen
            Verify on tapping "Discussion" tab will load Discussions screen
            Verify on tapping "Dates" tab will load Dates screen
            Verify on tapping "Resources" tab will load Resources list
            Verify on tapping "Handouts" tab will load Handouts screen
            Verify on tapping "Announcements" tab will load Announcements screen
        """

        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)

        discussion_tab_element = android_course_dashboard_page.get_discussion_tab(
        )
        if discussion_tab_element:
            discussion_tab_element.click()
            assert discussion_tab_element.get_attribute('selected') == 'true'

        dates_tab_element = android_course_dashboard_page.get_dates_tab()
        if dates_tab_element:
            dates_tab_element.click()
            assert dates_tab_element.get_attribute('selected') == 'true'

        resources_tab_element = android_course_dashboard_page.get_resources_tab(
        )
        if resources_tab_element:
            resources_tab_element.click()
            assert resources_tab_element.get_attribute('selected') == 'true'

        course_tab_element = android_course_dashboard_page.get_course_tab()
        if course_tab_element:
            course_tab_element.click()
            assert course_tab_element.get_attribute('selected') == 'true'

        video_tab_element = android_course_dashboard_page.get_videos_tab()
        if video_tab_element:
            video_tab_element.click()
            assert video_tab_element.get_attribute('selected') == 'true'

        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.get_second_course().click()
示例#3
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify on tapping "Videos" tab will load Videos screen
            Verify on tapping "Discussion" tab will load Discussions screen
            Verify on tapping "Dates" tab will load Dates screen
            Verify on tapping "Resources" tab will load Resources list
            Verify on tapping "Handouts" tab will load Handouts screen
            Verify on tapping "Announcements" tab will load Announcements screen
        """

        android_course_dashboard_page = AndroidCourseDashboard(
            set_capabilities, setup_logging)

        video_tab_element = android_course_dashboard_page.get_videos_tab()
        if video_tab_element:
            video_tab_element.click()
            assert video_tab_element.get_attribute('selected') == 'true'

        discussion_tab_element = android_course_dashboard_page.get_discussion_tab(
        )
        if discussion_tab_element:
            discussion_tab_element.click()
            assert discussion_tab_element.get_attribute('selected') == 'true'

        dates_tab_element = android_course_dashboard_page.get_dates_tab()
        if dates_tab_element:
            dates_tab_element.click()
            assert dates_tab_element.get_attribute('selected') == 'true'

        resources_tab_element = android_course_dashboard_page.get_resources_tab(
        )
        if resources_tab_element:
            resources_tab_element.click()
            assert resources_tab_element.get_attribute('selected') == 'true'

        course_tab_element = android_course_dashboard_page.get_course_tab()
        if course_tab_element:
            course_tab_element.click()
            assert course_tab_element.get_attribute('selected') == 'true'

        setup_logging.info('-- Ending Test Case --')
    def test_resources_tab_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
        Verify that resources tab will selected after loading
        Verify that Course Resources tab will show following contents,
            Resources as Title, Share icon,
        """

        global_contents = Globals(setup_logging)
        android_course_dashboard_page = AndroidCourseDashboard(set_capabilities, setup_logging)
        resources_tab_element = android_course_dashboard_page.get_resources_tab()

        assert resources_tab_element.get_attribute('selected') == 'true'
        share_icon = android_course_dashboard_page.get_course_share_icon()
        assert share_icon.get_attribute('content-desc') == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID

        resources_tab_title = global_contents.get_by_class_from_elements(
            set_capabilities,
            android_elements.all_textviews,
            global_contents.first_existence)
        assert resources_tab_title.text == strings.COURSE_DASHBOARD_RESOURCES_TAB