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_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.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_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(4)
        email = user_name + '@example.com'
        first_name = global_contents.generate_random_credentials(4)
        last_name = global_contents.generate_random_credentials(4)
        full_name = (first_name + ' ' + last_name)
        password = global_contents.generate_random_credentials(8)
        setup_logging.info(
            'Email - {},  Username - {}, Full Name - {}, Password -{}'.format(
                email, user_name, full_name, password))

        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.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__))
Exemple #4
0
    def test_start_main_dashboard_smoke(self, login, set_capabilities, setup_logging):
        """
        Scenarios:
            Verify Main Dashboard screen is loaded successfully
        """

        global_contents = Globals(setup_logging)
        setup_logging.info('-- Starting {} Test Case'.format(TestAndroidMainDashboard.__name__))
        if login:
            setup_logging.info('{} is successfully logged in'.format(global_contents.login_user_name))

        android_whats_new_page = AndroidWhatsNew(set_capabilities, setup_logging)
        android_whats_new_page.navigate_features()
        assert android_whats_new_page.exit_features() == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
Exemple #5
0
    def test_close_features_screen_smoke(self, set_capabilities, setup_logging,
                                         login):
        """
        Verifies that user can close New Feature screen and move to Main Dashboard screen
        """

        if login:
            android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                     setup_logging)
            assert android_whats_new_page.exit_features(
            ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME

        else:
            setup_logging.info('close_features is not needed')
Exemple #6
0
    def test_navigate_features_smoke(self, set_capabilities, setup_logging,
                                     login):
        """
        Verifies that user can navigate between features
        """

        if login:
            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

        else:
            setup_logging.info('navigate_features is not needed')
Exemple #7
0
    def test_start_course_dashboard_smoke(self, login, set_capabilities,
                                          setup_logging):

        setup_logging.info('-- Starting {} Test Case'.format(
            TestAndroidCourseDashboardScreen.__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_whats_new_page.navigate_features()
        assert android_whats_new_page.exit_features(
        ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME
Exemple #8
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'.format(
            TestAndroidWhatsNew.__name__))

        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 #9
0
    def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging,
                                        login):
        """
        Scenarios:
                Verify following contents are visible on screen 
                    "Screen Title", "Cross Icon", "Main Feature Image",
                     "Feature Title", "Feature Details", "Done"
                Verify all screen contents have their default values
        """

        if login:
            android_whats_new_page = AndroidWhatsNew(set_capabilities,
                                                     setup_logging)

            assert android_whats_new_page.get_title_textview()
            assert android_whats_new_page.get_cross_icon()
            assert android_whats_new_page.get_main_image(
            ).text == strings.BLANK_FIELD
            assert android_whats_new_page.get_feature_title_textview()
            assert android_whats_new_page.get_feature_details()

        else:
            setup_logging.info('validate_ui_elements is not needed')