Пример #1
0
    def test_landscape_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
                Landscape support is added for Main Dashboard screen with following cases,
                Change device orientation to Landscape mode
                Verify following contents are visible on screen, 
                    Logged in user's avatar, Screen Title, Account Icon
                    Courses Tab, Discovery Tab
                Verify that Courses tab will be selected by default
                Verify on tapping Courses will load Courses contents in its tab
                Verify on tapping Discovery will load Discovery contents in its tab
                Verify tapping user's avatar will load User Profile screen
                Verify tapping back/cancel icon from User Profile screen should get back to Main Dashboard screen
        """

        global_contents = Globals(setup_logging)
        ios_login_page = IosLogin(set_capabilities, setup_logging)
        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)

        assert ios_login_page.login(global_contents.login_user_name,
                                    global_contents.login_password)
        setup_logging.info('{} is successfully logged in'.format(
            global_contents.login_user_name))

        global_contents.turn_orientation(set_capabilities,
                                         global_contents.LANDSCAPE_ORIENTATION)

        assert ios_main_dashboard_page.get_title_textview_landscape_mode(
        ).text == strings.BLANK_FIELD
        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_programs_tab(
        ).text == strings.MAIN_DASHBOARD_PROGRAMS_TAB
        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        assert ios_main_dashboard_page.load_discovery_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert ios_main_dashboard_page.load_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.load_programs_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
    def test_landscape_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
                Landscape support is added for Main Dashboard screen with following cases,
                Change device orientation to Landscape mode
                Verify following contents are visible on screen, 
                    Logged in user's avatar, Screen Title, Account Icon
                    Courses Tab, Discovery Tab
                Verify that Courses tab will be selected by default
                Verify on tapping Courses will load Courses contents in its tab
                Verify on tapping Discovery will load Discovery contents in its tab
                Verify tapping user's avatar will load User Profile screen
                Verify tapping back/cancel icon from User Profile screen should get back to Main Dashboard screen
                Verify tapping Account Icon will load Account Screen
                Verify tapping back/cancel icon from Account Screen should get back to Main Dashboard screen
                Verify that user can log out successfully, and back on Login screen
        """

        global_contents = Globals(setup_logging)
        ios_login_page = IosLogin(set_capabilities, setup_logging)
        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)

        assert ios_login_page.login(global_contents.login_user_name, global_contents.login_password, False)
        setup_logging.info('{} is successfully logged in'.format(global_contents.login_user_name))

        global_contents.turn_orientation(set_capabilities, global_contents.LANDSCAPE_ORIENTATION)

        assert ios_main_dashboard_page.get_profile_icon().text == strings.MAIN_DASHBOARD_PROFILE
        assert ios_main_dashboard_page.get_title_textview_landscape_mode().text == strings.MAIN_DASHBOARD_SCREEN_TITLE
        assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert ios_main_dashboard_page.get_courses_tab().text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab().text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        assert ios_main_dashboard_page.load_discovery_tab().text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_courses_tab().text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert ios_main_dashboard_page.load_courses_tab().text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab().text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
        assert ios_main_dashboard_page.load_profile_screen().text == strings.PROFILE_SCREEN_TITLE
        set_capabilities.back()
        assert ios_main_dashboard_page.load_account_screen().text == strings.ACCOUNT_SCREEN_TITLE
        set_capabilities.back()

        assert ios_main_dashboard_page.get_account_options()[3].text == strings.ACCOUNT_LOGOUT
        assert ios_main_dashboard_page.log_out().text == strings.LOGIN
        setup_logging.info('{} is successfully logged out'.format(global_contents.login_user_name))
        global_contents.turn_orientation(set_capabilities, global_contents.PORTRAIT_ORIENTATION)

        setup_logging.info('-- Ending Test Case')
    def test_landscape_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
                Change device orientation to Landscape mode
                Verify that from Main Dashboard tapping Courses tab will load My Courses
                list(of specific logged in user) in its tab
                Verify following contents on Header, Profile icon, "Courses" title, Account Icon
                Verify that My Courses(enrolled) List has following contents in each course,
                    Course Name, Course Start/End date
                Verify that "Looking for a new challenge?" label and "Find a Course" button are available
                Verify that tapping any course should load specific Course Dashboard screen
                Verity that from Course Dashboard tapping back should load My Courses List screen
                Verify that user should be able to scroll courses
                Verify on tapping "Find a Course" button will load Discovery screen
                Verity that from Course Dashboard tapping back should load My Courses List screen
                Verify user is able to change device orientation back to Portrait Mode
        """

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

        global_contents.turn_orientation(set_capabilities,
                                         global_contents.LANDSCAPE_ORIENTATION)

        assert ios_main_dashboard_page.get_profile_icon(
        ).text == strings.MAIN_DASHBOARD_PROFILE
        assert ios_main_dashboard_page.get_title_textview_landscape_mode(
        ).text == strings.MAIN_DASHBOARD_SCREEN_TITLE
        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        if ios_my_courses_list.get_my_courses_list_row():
            assert ios_my_courses_list.get_my_course_name()
            assert ios_my_courses_list.get_my_course_details()
            course_name = ios_my_courses_list.get_my_courses_list_row().text
            assert ios_my_courses_list.load_course_details_screen(
            ).text == course_name
            set_capabilities.back()
        else:
            setup_logging.info('No course enrolled by this user.')

        assert ios_my_courses_list.get_find_courses_message(
        ).text == strings.MY_COURSES_LIST_FIND_COURSES_MESSAGE
        assert ios_my_courses_list.get_find_course_button(
        ).text == strings.MY_COURSES_LIST_FIND_COURSES_BUTTON_IOS

        ios_my_courses_list.load_discovery_screen()
        setup_logging.info(set_capabilities.context)
        assert ios_main_dashboard_page.load_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        global_contents.turn_orientation(set_capabilities,
                                         global_contents.PORTRAIT_ORIENTATION)

        setup_logging.info('-- Ending Test Case')
Пример #4
0
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify following contents on Header, Profile icon, "Courses" title, Account Icon
                Verify that My Courses(enrolled) List has following contents in each course,
                    Course Name, Course Start/End date
            Verify that "Looking for a new challenge?" label and "Find a Course" button are available
        """
        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)
        ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_profile_icon(
        ).text == strings.MAIN_DASHBOARD_PROFILE
        assert ios_main_dashboard_page.get_title_textview_portrait_mode(
        ).text == strings.BLANK_FIELD
        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        assert ios_my_courses_list.get_my_courses_list_row()

        if ios_my_courses_list.get_my_courses_list_row():
            assert ios_my_courses_list.get_my_course_name()
            assert ios_my_courses_list.get_my_course_details()
        else:
            setup_logging.info('No course enrolled by this user.')
Пример #5
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
                Verify on tapping Courses will load Courses contents in its tab
                Verify on tapping Discovery will load Discovery contents in its tab
                Verify tapping user's avatar will load User Profile screen
                Verify tapping back/cancel icon from User Profile screen should get back to Main Dashboard screen
                Verify tapping Account Icon will load Account Screen
                Verify tapping back/cancel icon from Account Screen should get back to Main Dashboard screen
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)

        assert ios_main_dashboard_page.load_discovery_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert ios_main_dashboard_page.get_programs_tab(
        ).text == strings.MAIN_DASHBOARD_PROGRAMS_TAB

        assert ios_main_dashboard_page.load_programs_tab(
        ).text == strings.SELECTED_BY_DEFAULT

        assert ios_main_dashboard_page.load_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        assert ios_main_dashboard_page.load_account_screen(
        ).text == strings.PROFILE_SCREEN_TITLE
        ios_main_dashboard_page.get_acccount_close_button().click()
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
                Verify following contents are visible on screen, 
                    Logged in user's avatar, Screen Title, Account Icon
                    Courses Tab, Discovery Tab
                Verify that Courses tab will be selected by default
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging)

        assert ios_main_dashboard_page.get_profile_icon().text == strings.MAIN_DASHBOARD_PROFILE
        assert ios_main_dashboard_page.get_title_textview_portrait_mode().text == strings.MAIN_DASHBOARD_SCREEN_TITLE
        assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME
        assert ios_main_dashboard_page.get_courses_tab().text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_discovery_tab().text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
Пример #7
0
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
        Verify that from Main Dashboard tapping on Discovery tab will load Discovery
            contents in its tab
        Verify that Discovery tab will show following contents,
        Header contents,
            "Discovery" as screen Title,
            Account Icon
        Three tabs
            Courses, Programs, Degrees
        Search Courses option
        "Browse By Subject" Section below, Subject Background Image, Subject Name
        Verify that from discovery screen, courses and programs tab are loaded
        """

        ios_main_dashboard_page = IosMainDashboard(set_capabilities,
                                                   setup_logging)
        global_contents = Globals(setup_logging)

        assert ios_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
        assert ios_main_dashboard_page.load_discovery_tab(
        ).text == strings.SELECTED_BY_DEFAULT

        title_element = global_contents.get_all_views_on_ios_screen(
            set_capabilities, ios_elements.all_textviews)[0]
        assert title_element.text == strings.MAIN_DASHBOARD_DISCOVERY_TAB

        assert ios_main_dashboard_page.get_drawer_icon(
        ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME

        course_discovery_tab = global_contents.get_all_views_on_ios_screen(
            set_capabilities, ios_elements.all_buttons)[4]
        assert course_discovery_tab.get_attribute(
            'label') == strings.COURSES_DISCOVERY_COURSES_TAB
        course_discovery_tab.click()

        programs_discovery_tab = global_contents.get_all_views_on_ios_screen(
            set_capabilities, ios_elements.all_buttons)[5]
        assert programs_discovery_tab.get_attribute(
            'label') == strings.COURSES_DISCOVERY_PROGRAMS_TAB
        programs_discovery_tab.click()

        degrees_discovery_tab = global_contents.get_all_views_on_ios_screen(
            set_capabilities, ios_elements.all_buttons)[6]
        assert degrees_discovery_tab.get_attribute(
            'label') == strings.COURSES_DISCOVERY_DEGREES_TAB
        degrees_discovery_tab.click()
        course_discovery_tab.click()

        course_discovery_search_courses = global_contents.get_element_by_id(
            set_capabilities, ios_elements.course_discovery_search_courses)
        assert course_discovery_search_courses.get_attribute(
            'label') == strings.COURSES_DISCOVERY_SEARCH_COURSE_IOS

        course_discovery_browse_by_subject = global_contents.get_element_by_id(
            set_capabilities, ios_elements.course_discovery_browse_by_subject)
        assert course_discovery_browse_by_subject.get_attribute('label') \
            == strings.COURSES_DISCOVERY_BROWSE_BY_SUBJECT_IOS

        assert ios_main_dashboard_page.load_discovery_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert ios_main_dashboard_page.load_courses_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.load_programs_tab(
        ).text == strings.SELECTED_BY_DEFAULT
        assert ios_main_dashboard_page.load_discovery_tab(
        ).text == strings.SELECTED_BY_DEFAULT