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_validate_signout_and_delete_cell_elements(self, set_capabilities, setup_logging): """ Verify that Profile Options screen will show following contents: Sign out button App version Delete account button Delete account description """ global_contents = Globals(setup_logging) ios_profile_options_page = IosProfileOptions(set_capabilities, setup_logging) delete_account_button = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_delete_button) global_contents.scroll_from_element(set_capabilities, delete_account_button) signout_version_cell = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_signout_version_cell) assert signout_version_cell.get_attribute('visible') == 'true' signout_button = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_signout_button) assert signout_button.text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON signout_version_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_signout_version_label) assert signout_version_label.text == strings.PROFILE_OPTIONS_SIGNOUT_VERSION delete_account_cell = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_delete_account_cell) assert delete_account_cell.get_attribute('visible') == 'true' assert delete_account_button.text == strings.PROFILE_OPTIONS_DELETE_ACCOUNT_BUTTON account_info_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_delete_account_info_label) assert account_info_label.text == strings.PROFILE_OPTIONS_DELETE_INFO_LABEL delete_account_button.click() assert ios_profile_options_page.get_all_textviews( )[0].text == strings.DELETE_ACCOUNT_PAGE_TITLE set_capabilities.back() video_settings_description_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_video_settings_description_label) global_contents.scroll_from_element(set_capabilities, video_settings_description_label)
def test_validate_help_cell_elements(self, set_capabilities, setup_logging): """ Verify that help cell will show following contents: Help cell Submit feedback title Submit feedback description Email support team button Get support cell title Get support description View FAQ button """ global_contents = Globals(setup_logging) profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) help_cell = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_help_cell) assert help_cell.text == strings.PROFILE_OPTIONS_HELP_CELL_TITLE submit_feedback_label = profile_options_page.get_all_textviews()[10] assert submit_feedback_label.text == strings.PROFILE_OPTIONS_FEEDBACK_LABEL support_subtitle = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_support_subtitle_label) assert support_subtitle.text == strings.PROFILE_OPTIONS_SUPPORT_SUBTITLE_LABEL email_feedback_button = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_email_feedback_button) assert email_feedback_button.text == strings.PROFILE_OPTIONS_EMAIL_FEEDBACK_BUTTON get_support_label = profile_options_page.get_all_textviews()[12] assert get_support_label.text == strings.PROFILE_OPTIONS_SUPPORT_LABEL get_support_description = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_support_description_label) assert get_support_description.text == strings.PROFILE_OPTIONS_FEEDBACK_SUBTITLE_LABEL view_faq_button = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_view_faq_button) assert view_faq_button.text == strings.PROFILE_OPTIONS_FAQ_BUTTON_ANDROID global_contents.scroll_from_element(set_capabilities, view_faq_button)
def test_landscape_smoke(self, set_capabilities, setup_logging): """ Scenarios: Landscape support is added for Whats New screen with following cases, Change device orientation to Landscape mode Verify Whats New screen is loaded successfully after login 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 Verifies that user can navigate between features Verifies that user can close New Feature screen and move to Main Dashboard screen Verify after re-login with same user "Whats New" screen will not be visible Change device orientation to Portrait mode """ 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) global_contents.turn_orientation(set_capabilities, global_contents.LANDSCAPE_ORIENTATION) ios_login_page = IosLogin(set_capabilities, setup_logging) ios_login_page.login(global_contents.login_user_name, global_contents.login_password) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME 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 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: 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 assert (ios_login_page.get_forgot_password_alert_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() 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 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.PORTRAIT_ORIENTATION) setup_logging.info('-- Ending Test Case')