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()
Exemple #2
0
    def test_re_login_smoke(self, setup_logging, set_capabilities):
        """
        Scenarios:
            Verify after re-login with same user "Whats New" screen will not be visible
        """

        global_contents = Globals(setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.ACCOUNT_LOGOUT
        assert android_main_dashboard_page.log_out(
        ) == global_contents.NEW_LOGISTRATION_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged out'.format(
            global_contents.login_user_name))

        android_login_page = AndroidLogin(set_capabilities, setup_logging)
        android_new_landing_page = AndroidNewLanding(set_capabilities,
                                                     setup_logging)

        assert android_new_landing_page.load_login_screen(
        ) == Globals.LOGIN_ACTIVITY_NAME
        login_output = android_login_page.login(
            global_contents.login_user_name, global_contents.login_password,
            False)

        assert login_output == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged in'.format(
            global_contents.target_environment))

        setup_logging.info('-- Ending Test Case')
Exemple #3
0
    def test_register_smoke(self, set_capabilities, setup_logging):
        """
        Verify that tapping "Create your account" button after filling all required input(valid) types,
            will validate all inputs and load "Whats new feature screen" with specific user logged in
        Verify that user should be able to log out and re-login with new created account credentials
        """

        android_register_page = AndroidRegister(set_capabilities,
                                                setup_logging)
        global_contents = Globals(setup_logging)

        user_name = global_contents.generate_random_credentials(5)
        email = user_name + '@example.com'
        first_name = global_contents.generate_random_credentials(4)
        last_name = global_contents.generate_random_credentials(4)
        name = first_name + ' ' + last_name
        full_name = name
        password = global_contents.generate_random_credentials(8)
        setup_logging.info(
            'Email - {},  Username - {}, Full Name - {}, Password -{}'.format(
                email, user_name, full_name, password))

        android_register_page.back_and_forth_register()
        register_output = android_register_page.register(
            email, full_name, user_name, password, global_contents.country)

        global_contents.wait_for_android_activity_to_load(
            set_capabilities, global_contents.REGISTER_ACTIVITY_NAME)

        # assert register_output == Globals.WHATS_NEW_ACTIVITY_NAME

        android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                 setup_logging)
        android_whats_new_page.navigate_features()
        assert android_whats_new_page.navigate_features(
        ).text == strings.WHATS_NEW_DONE
        assert android_whats_new_page.exit_features(
        ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.ACCOUNT_LOGOUT
        assert android_main_dashboard_page.log_out(
        ) == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME

        android_new_landing_page = AndroidNewLanding(set_capabilities,
                                                     setup_logging)
        assert android_new_landing_page.load_login_screen(
        ) == Globals.LOGIN_ACTIVITY_NAME

        android_login_page = AndroidLogin(set_capabilities, setup_logging)

        login_output = android_login_page.login(user_name, password, False)

        assert login_output == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged in'.format(user_name))

        setup_logging.info('-- Ending {} Test Case'.format(
            TestAndroidRegister.__name__))
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            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 logout from main dashboard screen
        """

        global_contents = Globals(setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        assert android_main_dashboard_page.load_account_screen(
        ) == global_contents.ACCOUNT_ACTIVITY_NAME
        set_capabilities.back()

        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out(
        ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
        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'.format(
            TestAndroidMainDashboard.__name__))
Exemple #5
0
    def test_load_contents_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify on tapping "Back icon" will load Main dashboard screen
            Verify on tapping "Profile" will load Profile
            Verify on tapping "Settings" will load Settings screen
            Verify on tapping "Logout" will logout user
        """

        global_contents = Globals(setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        android_accounts_screen = AndroidAccunts(set_capabilities,
                                                 setup_logging)

        android_accounts_screen.get_navigation_icon().click()
        assert android_accounts_screen.on_screen(
        ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME

        assert android_main_dashboard_page.load_account_screen(
        ) == global_contents.ACCOUNT_ACTIVITY_NAME
        assert android_accounts_screen.load_profile_activity(
        ) == global_contents.PROFILE_ACTIVITY_NAME
        set_capabilities.back()
        assert android_accounts_screen.load_settings_activity(
        ) == global_contents.SETTINGS_ACTIVITY_NAME
        set_capabilities.back()
        assert android_main_dashboard_page.log_out(
        ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
Exemple #6
0
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that Account screen will show following contents:
                Back icon
                Specific "Account" as Title
                Profile
                Settings
                Submit_feedback
                Logout
        """

        global_contents = Globals(setup_logging)
        android_accounts_screen = AndroidAccunts(set_capabilities,
                                                 setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        assert android_main_dashboard_page.load_account_screen(
        ) == global_contents.ACCOUNT_ACTIVITY_NAME

        assert android_accounts_screen.get_navigation_icon().get_attribute('content-desc') \
            == strings.ACCOUNT_SCREEN_NAVIGATION_ICON

        assert android_accounts_screen.get_profile_row(
        ).text == strings.PROFILE_SCREEN_TITLE

        assert android_accounts_screen.get_settings_row(
        ).text == strings.ACCOUNT_SETTINGS

        assert android_accounts_screen.get_submit_feedback_row(
        ).text == strings.ACCOUNT_SUBMIT_FEEDBACK

        assert android_accounts_screen.get_logout_row(
        ).text == strings.ACCOUNT_LOGOUT
    def test_load_course_details_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            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

        """

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

        if android_my_courses_list_page.get_my_courses_list_row():
            course_dashboard_screen = android_my_courses_list_page.load_course_details_screen(
            )
            assert course_dashboard_screen == global_contents.COURSE_DASHBOARD_ACTIVITY_NAME
            set_capabilities.back()
            assert android_main_dashboard_page.on_screen(
            ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME
            global_contents.swipe_screen(set_capabilities)

        course_discovery_screen = android_my_courses_list_page.load_discovery_screen(
        )
        assert course_discovery_screen == global_contents.WEB_VIEW_FIND_COURSES_ACTIVITY_NAME
        set_capabilities.back()
        assert android_main_dashboard_page.on_screen(
        ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME
Exemple #8
0
    def test_main_dashboard_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
        """

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        global_contents = Globals(setup_logging)

        assert android_main_dashboard_page.get_programs_tab(
        ).text == strings.MAIN_DASHBOARD_PROGRAMS_TAB
        assert android_main_dashboard_page.load_programs_tab()
        assert android_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
        assert android_main_dashboard_page.load_discovery_tab()
        assert android_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert android_main_dashboard_page.load_courses_tab()
        assert android_main_dashboard_page.load_profile_screen(
        ) == global_contents.PROFILE_ACTIVITY_NAME
        set_capabilities.back()

        assert android_main_dashboard_page.load_account_screen(
        ) == global_contents.ACCOUNT_ACTIVITY_NAME
        set_capabilities.back()
    def test_start_my_courses_list_smoke(self, set_capabilities,
                                         setup_logging):
        """
        Scenarios:
            Verify that from Main Dashboard tapping Courses tab will load My Courses
                list(of specific logged in user) in its tab
        """

        setup_logging.info('-- Starting {} Test Case'.format(
            TestAndroidMyCoursesList.__name__))

        global_contents = Globals(setup_logging)
        android_new_landing_page = AndroidNewLanding(set_capabilities,
                                                     setup_logging)
        android_login_page = AndroidLogin(set_capabilities, setup_logging)
        android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                 setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_new_landing_page.on_screen(
        ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
        assert android_new_landing_page.load_login_screen(
        ) == Globals.LOGIN_ACTIVITY_NAME
        assert android_login_page.login(
            global_contents.login_user_name, global_contents.login_password,
            global_contents.is_first_time) == Globals.WHATS_NEW_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged in'.format(
            global_contents.login_user_name))

        assert android_whats_new_page.navigate_features()
        assert android_whats_new_page.exit_features(
        ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
        assert android_main_dashboard_page.load_courses_tab()
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
        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)
        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_second_course().click()
        else:
            setup_logging.info('No course enrolled by this user.')

        navigation_icon = android_course_dashboard_page.get_navigation_icon()
        assert navigation_icon.get_attribute(
            'content-desc') == strings.COURSE_DASHBOARD_NAVIGATION_ICON

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

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.discussion_search_post
        ).text == strings.DISCUSSION_SEARCH_POST

        all_posts_element = global_contents.get_by_id_from_elements(
            set_capabilities, android_elements.discussion_all_posts_button,
            global_contents.first_existence)
        assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS

        my_following_posts_element = global_contents.get_by_id_from_elements(
            set_capabilities, android_elements.discussion_all_posts_button,
            global_contents.second_existence)
        assert my_following_posts_element.text == strings.DISCUSSION_MY_FOLLOWING_POSTS

        general_posts_element = global_contents.get_by_id_from_elements(
            set_capabilities, android_elements.discussion_all_posts_button,
            global_contents.third_existence)
        assert general_posts_element.text == strings.DISCUSSION_COURSE_FEEDBACK
Exemple #11
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_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from my courses list screen
        """

        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        global_contents = Globals(setup_logging)
        assert android_main_dashboard_page.on_screen() == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME
        assert android_main_dashboard_page.get_logout_account_option().text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out() == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from course html screen
        """

        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        android_course_section_page = AndroidCourseSubsection(set_capabilities, setup_logging)
        android_course_section_page.navigate_to_main_dashboard(set_capabilities)
        assert android_main_dashboard_page.get_logout_account_option().text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out() == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
        setup_logging.info('-- Ending Test Case --')
Exemple #14
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()
Exemple #15
0
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from course subsection screen
        """

        global_contents = Globals(setup_logging)
        android_profile_screen = AndroidProfile(set_capabilities, setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        android_profile_screen.get_navigation_icon().click()
        android_profile_screen.get_navigation_icon().click()

        assert android_main_dashboard_page.log_out() == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
Exemple #16
0
    def test_start_main_dashboard_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify Main Dashboard screen is loaded successfully
        """

        setup_logging.info('-- Starting Main Dashboard Test Case --')
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        global_contents = Globals(setup_logging)

        assert android_main_dashboard_page.on_screen(
        ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME
Exemple #17
0
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            User should be able to see the following contents by tapping on edit button from profile screen
            Edit profile screen title
            Edit Profile image
            User Name
            Change photo button
            Profile label
            Full profile button
            Limited profile button
            Limited profile instructions
            Birth Year
            Location
            Primary Language
            About Me
        """

        global_contents = Globals(setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        android_profile_screen = AndroidProfile(set_capabilities, setup_logging)
        edit_profile_screen = AndroidEditProfile(set_capabilities, setup_logging)

        assert android_main_dashboard_page.load_account_screen() == global_contents.ACCOUNT_ACTIVITY_NAME
        android_profile_screen.get_edit_profile_screen().click()
        assert edit_profile_screen.get_by_class_from_elements(
            android_elements.all_textviews,
            global_contents.first_existence).text == strings.EDIT_PROFILE_SCREEN_TITLE
        assert edit_profile_screen.get_element_by_id(android_elements.edit_profile_screen_image)\
            .get_attribute('displayed') == 'true'
        assert strings.EDIT_PROFILE_USER_NAME in edit_profile_screen.get_element_by_id(
            android_elements.edit_profile_user_name).get_attribute('content-desc')
        assert edit_profile_screen.get_element_by_id(android_elements.edit_profile_change_photo)\
            .get_attribute('content-desc') == strings.EDIT_PROFILE_CHANGE_PHOTO_TEXT
        assert edit_profile_screen.get_element_by_id(
            android_elements.edit_profile_label).text == strings.EDIT_PROFILE_LABEL_TEXT
        assert edit_profile_screen.get_element_by_id(
            android_elements.edit_profile_full_view).text == strings.EDIT_PROFILE_FULL_VIEW_TEXT
        assert edit_profile_screen.get_element_by_id(
            android_elements.edit_profile_limited_view).text == strings.EDIT_PROFILE_LIMITED_VIEW_TEXT
        assert edit_profile_screen.get_element_by_id(
            android_elements.edit_profile_instructions).text == strings.EDIT_PROFILE_INSTRUCTIONS_TEXT
        assert strings.EDIT_PROFILE_LOCATION_TEXT in edit_profile_screen.get_by_class_from_elements(
            android_elements.all_textviews,
            global_contents.sixth_existence).text
        assert strings.EDIT_PROFILE_LANGUAGE_TEXT in edit_profile_screen.get_by_class_from_elements(
            android_elements.all_textviews,
            global_contents.seventh_existence).text
        assert strings.EDIT_PROFILE_ABOUT_ME_TEXT in edit_profile_screen.get_by_class_from_elements(
            android_elements.all_textviews,
            global_contents.eight_existence).text
Exemple #18
0
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from my register screen
        """

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out(
        ) == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
        setup_logging.info('-- Ending {} Test Case'.format(
            TestAndroidRegister.__name__))
Exemple #19
0
    def test_course_discovery_screen(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from Main Dashboard tapping on Discovery tab will load Discovery
            contents in its tab
        """

        setup_logging.info('-- Starting Course Disovery Test Case --')
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_main_dashboard_page.get_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
        assert android_main_dashboard_page.load_discovery_tab()
    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()
Exemple #21
0
    def test_start_my_courses_list_smoke(self, set_capabilities,
                                         setup_logging):
        """
        Scenarios:
            Verify that from Main Dashboard tapping Courses tab will load My Courses
                list(of specific logged in user) in its tab
        """

        setup_logging.info('-- Starting My Courses List Test Case --')
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert android_main_dashboard_page.load_courses_tab()
Exemple #22
0
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from course discovery screen
        """

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        assert android_main_dashboard_page.get_courses_tab(
        ).text == strings.MAIN_DASHBOARD_COURSES_TAB
        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out(
        ) == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
        setup_logging.info('-- Ending Test Case --')
Exemple #23
0
    def test_ui_elements_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that Profile screen will show following contents:
                Back icon
                "Profile" as Title
                Edit
                Profile Image
                User Name
            Verify that Profile screen will show following contents for limited profile:
                Age limit text
                Account settings Button
            Verify that Profile screen will show following contents for Full profile:
                location
                Language (if selected)
                User Bio
        """

        global_contents = Globals(setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging)
        android_profile_screen = AndroidProfile(set_capabilities, setup_logging)

        assert android_main_dashboard_page.load_account_screen() == global_contents.ACCOUNT_ACTIVITY_NAME
        android_profile_screen.get_edit_profile_screen().click()

        android_profile_screen.get_navigation_icon().click()
        android_profile_screen.get_edit_profile_screen().click()
        android_profile_screen.get_navigation_icon().click()
        assert android_profile_screen.get_user_profile_image().get_attribute('displayed') == 'true'
        assert android_profile_screen.get_user_profile_name().get_attribute('displayed') == 'true'

        if android_profile_screen.get_limited_profile_view():
            if android_profile_screen.get_profile_account_settings_button():
                assert android_profile_screen.get_profile_age_text_note().text == strings.PROFILE_AGE_LIMIT_TEXT
                assert android_profile_screen.get_profile_account_settings_button().text \
                    == strings.PROFILE_ACCOUNT_SETTINGS_BUTTON
        else:
            assert android_profile_screen.get_user_profile_location().get_attribute('displayed') == 'true'

            if android_profile_screen.get_user_profile_language():
                assert android_profile_screen.get_user_profile_language().get_attribute('displayed') == 'true'

            assert android_profile_screen.get_user_profile_bio().get_attribute('displayed') == 'true'

        set_capabilities.back()
        assert android_main_dashboard_page.log_out() == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
Exemple #24
0
    def test_main_dashboard_logout_smoke(self, set_capabilities,
                                         setup_logging):
        """
        Scenario:
                Verify that user can log out successfully, and back on Login screen
        """

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        global_contents = Globals(setup_logging)

        assert android_main_dashboard_page.load_account_screen(
        ) == global_contents.ACCOUNT_ACTIVITY_NAME
        assert android_main_dashboard_page.log_out(
        ) == global_contents.NEW_LOGISTRATION_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged out'.format(
            global_contents.login_user_name))
    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)
        course_html_component = AndroidCourseHTMLComponent(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_title().text
        android_course_section_page.get_course_row_title().click()

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

        course_topic_content = android_course_section_page.get_course_topic_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

        assert course_html_component.get_next_button().text == strings.COURSE_HTML_COMPONENT_NEXT_BUTTON
        assert course_html_component.get_prev_button().text == strings.COURSE_HTML_COMPONENT_PREV_BUTTON
        assert course_html_component.get_next_unit_title()
        course_html_component.get_next_button().click()
        assert course_html_component.get_screen_activity_name() == global_contents.COURSE_UNIT_NAVIGATION_ACTIVITY_NAME
        assert course_html_component.get_prev_unit_title()
        course_html_component.get_prev_button().click()
        assert android_course_dashboard_page.get_all_text_views()[0].text in course_topic_content
    def test_sign_out_smoke(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that user can logout from course discussions screen
        """

        discussions_dashboard_page = AndroidDiscussionsDashboard(
            set_capabilities, setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        discussions_dashboard_page.get_navigation_icon().click()
        discussions_dashboard_page.get_navigation_icon().click()
        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON
        assert android_main_dashboard_page.log_out(
        ) == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME
        setup_logging.info('Ending Test Case --')
Exemple #27
0
    def test_logout_smoke(self, set_capabilities, setup_logging):
        """
        Scenario:
                Verify that user can log out successfully, and back on Login screen
        """

        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)
        global_contents = Globals(setup_logging)

        assert android_main_dashboard_page.get_logout_account_option(
        ).text == strings.ACCOUNT_LOGOUT
        assert android_main_dashboard_page.log_out(
        ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
        setup_logging.info('{} is successfully logged out'.format(
            global_contents.login_user_name))

        setup_logging.info('-- Ending {} Test Case'.format(
            TestAndroidMainDashboard.__name__))
Exemple #28
0
    def test_start_whats_new_smoke(self, setup_logging, set_capabilities,
                                   login):
        """
        Scenarios:
            Verify Whats New screen is loaded successfully
        """

        setup_logging.info('-- Starting Test Case')

        if login:
            android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                     setup_logging)
            assert android_whats_new_page.on_screen(
            ) == Globals.WHATS_NEW_ACTIVITY_NAME
        else:
            android_main_dashboard_page = AndroidMainDashboard(
                set_capabilities, setup_logging)
            assert android_main_dashboard_page.on_screen(
            ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
Exemple #29
0
    def test_discovery_screen(self, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify that from Main Dashboard tapping on Discovery tab will load Discovery
            contents in its tab
        """

        setup_logging.info('-- Starting {} Test Case'.format(
            TestAndroidCourseDiscovery.__name__))

        global_contents = Globals(setup_logging)
        android_new_landing_page = AndroidNewLanding(set_capabilities,
                                                     setup_logging)
        android_login_page = AndroidLogin(set_capabilities, setup_logging)
        android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                 setup_logging)
        android_main_dashboard_page = AndroidMainDashboard(
            set_capabilities, setup_logging)

        assert android_new_landing_page.on_screen(
        ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME
        assert android_new_landing_page.load_login_screen(
        ) == Globals.LOGIN_ACTIVITY_NAME
        assert android_login_page.login(
            global_contents.login_user_name, global_contents.login_password,
            global_contents.is_first_time) == Globals.WHATS_NEW_ACTIVITY_NAME

        android_whats_new_page.navigate_features()
        assert android_whats_new_page.navigate_features(
        ).text == strings.WHATS_NEW_DONE
        assert android_whats_new_page.exit_features(
        ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME

        # android_whats_new_page.navigate_features()
        # assert android_whats_new_page.exit_features() == Globals.MAIN_DASHBOARD_ACTIVITY_NAME

        setup_logging.info('{} is successfully logged in'.format(
            global_contents.login_user_name))

        assert android_main_dashboard_page.load_discovery_tab(
        ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB
        assert android_main_dashboard_page.load_discovery_tab().is_selected()
    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
        """

        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.')

        assert android_course_section_page.get_course_row_title()

        topic_name = android_course_section_page.get_course_row_title().text
        android_course_section_page.get_course_row_title().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_title().click()
        if topic_name:
            # Verifing the title of the screen
            assert android_course_dashboard_page.get_all_text_views(
            )[0].text in topic_name