def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from My Courses list tapping any Course will load Course
            Dashboard screen/contents(of this specific course) in its tab
            Verify that Course Dashboard screen will show following contents,
                Header contents, Back icon, Specific "<course name>" as Title, Share icon,
                Footer Content,
                        Course, Videos, Discussion, Dates, Resources
            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
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        if ios_my_courses_list.get_my_courses_list_row():
            course_name = ios_my_courses_list.get_my_courses_list_row().text
            assert ios_my_courses_list.load_course_details_screen().text in course_name

        assert ios_course_dashboard_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_course_dashboard_page.get_course_image()
        assert ios_course_dashboard_page.get_course_title().text in course_name
        assert ios_course_dashboard_page.get_course_date()
        resume_element = ios_course_dashboard_page.get_course_resume_row()
        assert resume_element.get_attribute('label') == strings.COURSE_DASHBOARD_RESUME_ROW
        assert ios_course_dashboard_page.get_course_section_header()
        assert ios_course_dashboard_page.get_course_item_title()
        assert ios_course_dashboard_page.get_course_item_download_icon()
Esempio n. 2
0
    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
        """

        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)
        ios_subsection = IosCourseSubsection(set_capabilities, setup_logging)

        assert ios_course_dashboard_page.get_course_title(
        ).text in strings.COURSE_NAME_IOS
        subsection_component = ios_subsection.get_subsection_component()[0]
        subsection_component.click()
        assert ios_subsection.get_course_subsection_header_label()
        assert ios_subsection.get_subsection_html_topic_title()

        html_component = ios_subsection.get_subsection_component()[0]
        html_component.click()
        assert ios_subsection.get_subsection_title(
        )[0].text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT_IOS
        back_icon = ios_subsection.get_navigation_back_icon()[0]
        assert back_icon.get_attribute('visible') == 'true'
        back_icon.click()

        video_component = ios_subsection.get_subsection_component()[1]
        assert strings.COURSE_SUBSECTION_VIDEO_ROW_TEXT_IOS in video_component.text
        assert ios_subsection.get_course_item_download_icon()
Esempio n. 3
0
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that Course Html Component 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:
            Topic name
            Verify that footer should have Previous and Next button in it
            Verify that user should be able to navigate between Previous and Next Button from footer
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)
        ios_subsection = IosCourseSubsection(set_capabilities, setup_logging)
        ios_html_component = IosCourseHtmlComponent(set_capabilities,
                                                    setup_logging)

        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert strings.COURSE_NAME_IOS in ios_my_courses_list.load_course_details_screen(
        ).text

        assert ios_subsection.get_subsection_component_title()
        section_name = ios_subsection.get_subsection_component_title().text
        ios_subsection.get_subsection_component_title().click()
        assert ios_subsection.get_subsection_title()[0].text == section_name

        back_icon = ios_subsection.get_navigation_back_icon()[0]
        assert back_icon.get_attribute('visible') == 'true'
        back_icon.click()

        assert ios_course_dashboard_page.get_course_title(
        ).text in strings.COURSE_NAME_IOS
        subsection_component = ios_subsection.get_subsection_component()[0]
        subsection_component.click()
        assert ios_subsection.get_course_subsection_header_label()
        assert ios_subsection.get_subsection_html_topic_title()

        html_component = ios_subsection.get_subsection_component()[0]
        html_component.click()
        assert ios_subsection.get_subsection_title(
        )[0].text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT_IOS

        previous_navigation_button = ios_html_component.get_all_buttons()[1]
        next_navigation_button = ios_html_component.get_all_buttons()[2]
        assert previous_navigation_button.text == strings.COURSE_HTML_COMPONENT_PREV_BUTTON
        assert strings.COURSE_HTML_COMPONENT_NEXT_BUTTON in next_navigation_button.text

        next_navigation_button.click()
        assert strings.COURSE_HTML_COMPONENT_PREV_BUTTON in previous_navigation_button.text

        ios_html_component.get_all_buttons()[1].click()
        assert ios_subsection.get_subsection_title(
        )[0].text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT_IOS
    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,
        """

        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_course_resources_page = IosCourseResources(set_capabilities, setup_logging)
        assert ios_course_dashboard_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_course_resources_page.get_subsection_title()[0].text == strings.COURSE_DASHBOARD_RESOURCES_TAB
        assert ios_course_resources_page.get_navigation_back_icon()[0].text == 'Courses'
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from course discussions screen
        """

        global_contents = Globals(setup_logging)
        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_course_dashboard_page.navigate_to_main_dashboard(set_capabilities)
        assert ios_main_dashboard_page.load_account_screen().text == strings.PROFILE_SCREEN_TITLE
        assert ios_main_dashboard_page.log_out().text == strings.LOGIN
        assert ios_main_dashboard_page.load_ios_landing_page(
            set_capabilities, setup_logging).text == strings.NEW_LANDING_MESSAGE_IOS
        setup_logging.info('{} is successfully logged out'.format(global_contents.login_user_name))
        setup_logging.info(' Ending Test Case --')
Esempio n. 6
0
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from My Courses list tapping any Course will load Course
            Dashboard screen/contents(of this specific course) in its tab
            Verify on tapping "Videos" tab will load Videos screen
        """

        global_contents = Globals(setup_logging)
        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        if ios_my_courses_list.get_my_courses_list_row():
            course_name = ios_my_courses_list.get_my_courses_list_row().text
            assert ios_my_courses_list.load_course_details_screen().text
        assert ios_course_dashboard_page.get_course_title().text in course_name

        assert ios_course_dashboard_page.get_videos_tab(
        ).text == strings.COURSE_DASHBOARD_VIDEOS_TAB
        ios_course_dashboard_page.load_videos_tab()
        assert ios_course_dashboard_page.get_videos_tab(
        ).text == global_contents.is_selected
Esempio n. 7
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Verify that Course Videos Dashboard screen will show following contents,
            Header contents, Back icon, Specific "<course name>" as Title, Share icon,
            Footer Content,
                    Course, Videos, Discussion, Dates, Resources
        Verify that user should be able to view these contents:
            videos download header,
            Videos download switch
        """

        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)
        ios_videos_dashboard_page = IosVideosDashboard(set_capabilities,
                                                       setup_logging)

        assert ios_course_dashboard_page.get_share_icon(
        ).text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_course_dashboard_page.get_course_section_header()
        assert ios_course_dashboard_page.get_course_item_title()
        assert ios_course_dashboard_page.get_course_item_download_icon()

        assert ios_videos_dashboard_page.get_video_download_switch()
        ios_videos_dashboard_page.get_video_download_switch()

        assert ios_videos_dashboard_page.get_video_download_header()
Esempio n. 8
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Verify that Videos subsection screen will show following contents,
            Header contents, Back icon, Videos as Title,
        Verify that user should be able to view these contents:
            videos download header,
            Videos download switch
        Verify that clicking any video Download icon will start downloading it,
            and change its Download icon to Downloaded
        """

        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)
        ios_videos_dashboard_page = IosVideosDashboard(set_capabilities,
                                                       setup_logging)
        ios_course_subsection_page = IosCourseSubsection(
            set_capabilities, setup_logging)

        assert ios_course_dashboard_page.get_share_icon(
        ).text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_course_dashboard_page.get_course_section_header()
        course_subsection_component = ios_course_dashboard_page.get_course_item_title(
        ).text
        assert ios_course_dashboard_page.get_course_item_title()
        assert ios_course_dashboard_page.get_course_item_download_icon()
        ios_course_dashboard_page.get_course_item_title().click()

        navigation_icon = ios_videos_dashboard_page.get_navigation_icon()
        assert navigation_icon.text == strings.COURSE_DASHBOARD_VIDEOS_TAB
        assert ios_videos_dashboard_page.get_subsection_title(
        ).text == course_subsection_component
        assert ios_course_dashboard_page.get_course_item_title()
        assert ios_course_subsection_page.get_course_item_download_icon()

        ios_course_subsection_page.get_course_item_download_icon().click()
        assert ios_course_subsection_page.wait_for_all_videos_to_download(
        ) == strings.VIDEO_ICON_DOWNLOADED_STATUS_IOS
    def test_announcement_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user should be able to view:
            Announcements as Row title
            Subtitle of the row,
            Announcements icon in row,
            Announcements can be clickable and it will navigate to Announcements page
            Announcements as Title of page
        """

        global_contents = Globals(setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_course_resources_page = IosCourseResources(set_capabilities, setup_logging)

        announcement_title = ios_course_dashboard_page.get_announcements_row_title()
        assert announcement_title.text == strings.COURSE_DASHBOARD_ANNOUNCEMENT_TITLE
        assert ios_course_dashboard_page.get_announcements_row_name().text == strings.COURSE_DASHBOARD_ANNOUNCEMENT_ROW

        ios_course_dashboard_page.load_announcement_row()
        assert ios_course_resources_page.get_subsection_title()[0].text == strings.COURSE_DASHBOARD_ANNOUNCEMENT_TITLE
        assert ios_course_resources_page.get_navigation_back_icon()[0].text
        set_capabilities.back()
        assert ios_course_dashboard_page.get_resources_tab().text == global_contents.is_selected
    def test_handouts_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user should be able to view:
            Handouts as Row title
            Subtitle of the row,
            Handouts icon in row,
            Handouts can be clickable and it will navigate to handouts page
            Handouts as Title of the page
        """

        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_course_resources_page = IosCourseResources(set_capabilities, setup_logging)

        assert ios_course_dashboard_page.get_handouts_row_title().text == strings.COURSE_DASHBOARD_HANDOUTS_TITLE
        assert ios_course_dashboard_page.get_handouts_row_name().text == strings.COURSE_DASHBOARD_HANDOUTS_ROW

        ios_course_dashboard_page.load_handouts_row()
        assert ios_course_resources_page.get_subsection_title()[0].text == strings.COURSE_DASHBOARD_HANDOUTS_TITLE

        assert ios_course_resources_page.get_navigation_back_icon()[0].text
        set_capabilities.back()
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from My Courses list tapping any Course will load Course
            Dashboard screen/contents(of this specific course) in its tab
            Verify that user should be able to go back by clicking Back icon
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)
        ios_course_resources_page = IosCourseResources(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        if ios_my_courses_list.get_my_courses_list_row():
            course_name = ios_my_courses_list.get_my_courses_list_row().text
            assert ios_my_courses_list.load_course_details_screen().text in course_name

        assert ios_course_dashboard_page.get_resources_tab().text == strings.COURSE_DASHBOARD_RESOURCES_TAB
        ios_course_dashboard_page.load_resources_tab()

        assert ios_course_dashboard_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_course_resources_page.get_subsection_title()[0].text == strings.COURSE_DASHBOARD_RESOURCES_TAB
        assert ios_course_resources_page.get_navigation_back_icon()[0].text == 'Courses'
Esempio n. 12
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)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)

        assert ios_course_dashboard_page.get_courses_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_videos_tab(
        ).text == strings.COURSE_DASHBOARD_VIDEOS_TAB
        ios_course_dashboard_page.load_videos_tab()
        assert ios_course_dashboard_page.get_videos_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_discussion_tab(
        ).text == strings.COURSE_DASHBOARD_DISCUSSION_TAB
        ios_course_dashboard_page.load_discussion_tab()
        assert ios_course_dashboard_page.get_discussion_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_dates_tab(
        ).text == strings.COURSE_DASHBOARD_DATES_TAB
        ios_course_dashboard_page.load_dates_tab()
        assert ios_course_dashboard_page.get_dates_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_resources_tab(
        ).text == strings.COURSE_DASHBOARD_RESOURCES_TAB
        ios_course_dashboard_page.load_resources_tab()
        assert ios_course_dashboard_page.get_handouts_row_title(
        ).text == strings.COURSE_DASHBOARD_HANDOUTS_TITLE
        assert ios_course_dashboard_page.get_handouts_row_name(
        ).text == strings.COURSE_DASHBOARD_HANDOUTS_ROW
        announcement_title = ios_course_dashboard_page.get_announcements_row_title(
        )
        assert announcement_title.text == strings.COURSE_DASHBOARD_ANNOUNCEMENT_TITLE
        assert ios_course_dashboard_page.get_announcements_row_name(
        ).text == strings.COURSE_DASHBOARD_ANNOUNCEMENT_ROW
        ios_course_dashboard_page.load_handouts_row()
        set_capabilities.back()
        set_capabilities.back()
        ios_course_dashboard_page.load_announcement_row()
        set_capabilities.back()
        set_capabilities.back()
        assert ios_course_dashboard_page.get_resources_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_courses_tab(
        ).text == strings.COURSE_DASHBOARD_COURSES_TAB
        ios_course_dashboard_page.load_courses_tab()
        assert ios_course_dashboard_page.get_courses_tab(
        ).text == global_contents.is_selected
        setup_logging.info('-- Ending Test Case --')
Esempio n. 13
0
    def test_videos_dashboard_navigations(self, set_capabilities,
                                          setup_logging):
        """
        Scenarios:
            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 "Videos" tab will load Videos screen
            Verify that Course Videos Dashboard screen will show following contents,
        """

        global_contents = Globals(setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities,
                                                       setup_logging)

        assert ios_course_dashboard_page.get_courses_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_discussion_tab(
        ).text == strings.COURSE_DASHBOARD_DISCUSSION_TAB
        ios_course_dashboard_page.load_discussion_tab()
        assert ios_course_dashboard_page.get_discussion_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_dates_tab(
        ).text == strings.COURSE_DASHBOARD_DATES_TAB
        ios_course_dashboard_page.load_dates_tab()
        assert ios_course_dashboard_page.get_dates_tab(
        ).text == global_contents.is_selected
        assert ios_course_dashboard_page.get_resources_tab(
        ).text == strings.COURSE_DASHBOARD_RESOURCES_TAB
        ios_course_dashboard_page.load_resources_tab()
        assert ios_course_dashboard_page.get_handouts_row_title(
        ).text == strings.COURSE_DASHBOARD_HANDOUTS_TITLE
        assert ios_course_dashboard_page.get_handouts_row_name(
        ).text == strings.COURSE_DASHBOARD_HANDOUTS_ROW

        assert ios_course_dashboard_page.get_videos_tab(
        ).text == strings.COURSE_DASHBOARD_VIDEOS_TAB
        ios_course_dashboard_page.load_videos_tab()
        assert ios_course_dashboard_page.get_videos_tab(
        ).text == global_contents.is_selected
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from My Courses list tapping any Course will load Course
                Dashboard screen/contents(of this specific course) in its tab
            Verify on tapping "Videos" tab will load Videos screen
            Verify on tapping "Discussion" tab will load Discussions screen
            Verify that Course Discussions Dashboard tab will show following contents,
            Header contents,
                Back icon,
                Discussions as Title,
            Verify that user should be able to view these Course contents:
                Search posts,
                All posts,
                Posts I'm following,
                General
            Verify all screen contents have their default values
        """

        global_contents = Globals(setup_logging)
        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)
        ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging)
        ios_discussions_page = IosDiscussionsDashboard(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        if ios_my_courses_list.get_my_courses_list_row():
            course_name = ios_my_courses_list.get_my_courses_list_row().text
            assert ios_my_courses_list.load_course_details_screen().text in course_name

        assert ios_course_dashboard_page.get_courses_tab().text == global_contents.is_selected
        assert ios_course_dashboard_page.get_videos_tab().text == strings.COURSE_DASHBOARD_VIDEOS_TAB
        ios_course_dashboard_page.load_videos_tab()
        assert ios_course_dashboard_page.get_videos_tab().text == global_contents.is_selected
        assert ios_course_dashboard_page.get_discussion_tab().text == strings.COURSE_DASHBOARD_DISCUSSION_TAB
        ios_course_dashboard_page.load_discussion_tab()
        assert ios_course_dashboard_page.get_discussion_tab().text == global_contents.is_selected

        assert ios_discussions_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE
        assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_DASHBOARD_TITLE
        assert ios_discussions_page.get_navigation_icon().text == 'Courses'
        assert ios_discussions_page.get_posts_search_element().text == strings.DISCUSSION_SEARCH_POST

        all_posts_element = global_contents.get_by_class_from_elements(
            set_capabilities,
            ios_elements.discussions_topic_title_cell,
            global_contents.first_existence
            )
        assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS

        following_posts_element = global_contents.get_by_class_from_elements(
            set_capabilities,
            ios_elements.discussions_topic_title_cell,
            global_contents.second_existence
            )
        assert following_posts_element.text == " Posts I'm Following"

        course_feedback_element = global_contents.get_by_class_from_elements(
            set_capabilities,
            ios_elements.discussions_topic_title_cell,
            global_contents.third_existence
            )
        assert course_feedback_element.text == strings.DISCUSSION_COURSE_QnA