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 log out successfully, and back on Login screen """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) assert ios_main_dashboard_page.load_account_screen( ).text == strings.PROFILE_SCREEN_TITLE personal_information_email_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_personal_information_email_label) global_contents.scroll_from_element(set_capabilities, personal_information_email_label) 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)) global_contents.turn_orientation(set_capabilities, global_contents.PORTRAIT_ORIENTATION) setup_logging.info('-- Ending Test Case')
def test_update_profile_information(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can update information """ ios_profile_page = IosProfile(set_capabilities, setup_logging) ios_edit_profile_page = IosEditProfile(set_capabilities, setup_logging) global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) edit_profile_about_me = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_about_me) edit_profile_about_me.click() ios_edit_profile_page.change_user_info() ios_profile_page.get_edit_profile_back_icon().click() about_me_info = ios_edit_profile_page.get_information_on_edit_profile() assert about_me_info.get_attribute( 'value') in strings.EDIT_PROFILE_NEW_INFO_TEXT ios_profile_page.get_profile_back_icon().click() ios_profile_page.get_back_icon().click() 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 --')
def test_sign_out_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can logout from course dashboard screen """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) set_capabilities.back() 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 --')
def test_sign_out_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can logout from profile screen successfully """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_profile_page = IosProfile(set_capabilities, setup_logging) ios_profile_page.get_back_icon().click() assert ios_main_dashboard_page.account_signout( ).text == strings.ACCOUNT_SIGNOUT ios_main_dashboard_page.account_signout().click() assert ios_main_dashboard_page.load_ios_landing_page( set_capabilities, setup_logging).text == strings.NEW_LANDING_MESSAGE_IOS setup_logging.info(' Ending Test Case --')
def test_sign_out_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can logout from profile options screen successfully """ global_contents = Globals(setup_logging) ios_login_page = IosLogin(set_capabilities, setup_logging) global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_signout_button).click() assert ios_login_page.get_logo() ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) assert ios_main_dashboard_page.load_ios_landing_page( set_capabilities, setup_logging).text == strings.NEW_LANDING_MESSAGE_IOS setup_logging.info(' Ending Test Case --')
def test_logout_smoke(self, set_capabilities, setup_logging): """ Verify user is able to change device orientation back to Portrait Mode Verify user is able to logout Verify after logout landing page should visible """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) global_contents.turn_orientation(set_capabilities, global_contents.PORTRAIT_ORIENTATION) set_capabilities.back() 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')
def test_landscape_smoke(self, set_capabilities, setup_logging): """ Scenarios: Landscape support is added for Login screen with following cases, Change device orientation to Landscape mode Verify following contents are visible on screen, "Back icon", "Sign In" Title, "User name or e-mail address" label, User Name edit-field Password edit-field, "Forgot your password?" option, "Sign In" button, "Or sing in with" label, "Facebook" button, "Google" button, "By signing in to this app, you agree to the" label , "edX Terms of Service and Honor Code" option Verify all screen contents have their default values Verify tapping back icon from 'Sign In' screen navigate user back to 'New Landing' screen. Verify that user is able to load EULA screen and get back to Login Screen Verify that user is able to load Terms screen and get back to Login Screen Verify that user is able to load Privacy screen and get back to Login Screen Verify tapping 'Forgot your password?' will load 'Reset Password' alert Verify following contents are visible on 'Reset Password' alert, Alert Title, Alert Message, Email edit field, Cancel & OK buttons Verify tapping 'Cancel' will close 'Reset Password' alert Verify that app shows proper error msg/dialog when user try to login with wrong Username or password Verifies that user can login with valid Username and Password """ global_contents = Globals(setup_logging) ios_login_page = IosLogin(set_capabilities, setup_logging) global_contents.turn_orientation(set_capabilities, global_contents.LANDSCAPE_ORIENTATION) assert ios_login_page.get_logo().text == strings.LOGIN_EDX_LOGO assert ios_login_page.get_username_editfield( ).text == strings.LOGIN_USER_NAME_WATER_MARK assert ios_login_page.get_password_editfield( ).text == strings.LOGIN_PASSWORD_WATER_MARK assert ios_login_page.get_forgot_password_textview( ).text == strings.LOGIN_FORGOT_PASSWORD ios_login_page.get_forgot_password_alert() assert ios_login_page.get_forgot_password_alert_title( ).text == strings.LOGIN_RESET_PASSWORD_ALERT_TITLE assert ios_login_page.get_forgot_password_alert_msg( ).text == strings.LOGIN_RESET_PASSWORD_ALERT_MSG assert ios_login_page.get_forgot_password_alert_ok_button( ).text == strings.LOGIN_RESET_PASSWORD_ALERT_OK cancel_button_text = ios_login_page.get_forgot_password_alert_cancel_button( ).text assert cancel_button_text == strings.LOGIN_RESET_PASSWORD_ALERT_CANCEL assert ios_login_page.close_forgot_password_alert() # global_contents.scroll_from_element(set_capabilities, ios_login_page.get_forgot_password_textview()) assert ios_login_page.get_sign_in_button().text == strings.LOGIN assert ios_login_page.get_login_with_email_divider_textview( ).text == strings.LOGIN_IOS_WITH_EMAIL_DIVIDER assert ios_login_page.get_facebook_textview( ).text == strings.LOGIN_FACEBOOK_OPTION assert ios_login_page.get_google_textview( ).text == strings.LOGIN_GOOGLE_OPTION assert ios_login_page.get_agreement_textview( ).text == strings.LOGIN_IOS_AGREEMENT assert ios_login_page.get_eula_textview().text == strings.LOGIN_EULA assert ios_login_page.get_terms_textview().text == strings.LOGIN_TERMS assert ios_login_page.get_privacy_textview( ).text == strings.LOGIN_PRIVACY assert ios_login_page.back_and_forth_new_landing() # commenting these lines temporary till get the updated id's for these elements # global_contents.scroll_from_element(set_capabilities, ios_login_page.get_forgot_password_textview()) # assert ios_login_page.load_eula_screen().text == strings.LOGIN # assert ios_login_page.load_terms_screen().text == strings.LOGIN # assert ios_login_page.load_privacy_screen().text == strings.LOGIN assert ios_login_page.back_and_forth_new_landing() assert ios_login_page.login( global_contents.login_wrong_user_name, global_contents.login_wrong_password) is False 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.PORTRAIT_ORIENTATION) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_main_dashboard_page.get_drawer_icon().click() assert ios_main_dashboard_page.log_out().text == strings.LOGIN landing_page = ios_main_dashboard_page.load_ios_landing_page( set_capabilities, setup_logging) assert landing_page.text == strings.NEW_LANDING_MESSAGE_IOS setup_logging.info('-- Ending Test Case')