def test_start_whats_new_smoke(self, setup_logging, set_capabilities): """ Scenarios: Verify Whats New screen is loaded successfully """ android_whats_new_page = AndroidWhatsNew(set_capabilities, setup_logging) setup_logging.info('-- Starting Whats New Test Case') assert android_whats_new_page.on_screen( ) == Globals.WHATS_NEW_ACTIVITY_NAME
def test_login_smoke(self, set_capabilities, setup_logging): """ Verify that user cannot login with wrong username and password Verify that user cannot login with wrong username and correct password Verify that user cannot login with correct username and wrong password Verifies that user can login with valid Username and Password """ global_contents = Globals(setup_logging) android_login_page = AndroidLogin(set_capabilities, setup_logging) android_main_dashboard_page = AndroidMainDashboard( set_capabilities, setup_logging) android_whats_new_page = AndroidWhatsNew(set_capabilities, setup_logging) assert android_login_page.login( global_contents.login_wrong_user_name, global_contents.login_wrong_password) is False assert android_login_page.login( global_contents.login_wrong_user_name, global_contents.login_password) is False assert android_login_page.login( global_contents.login_user_name, global_contents.login_wrong_password) is False android_login_page.login(global_contents.login_user_name, global_contents.login_password) if android_whats_new_page.on_screen(): 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 else: android_main_dashboard_page = AndroidMainDashboard( set_capabilities, setup_logging) assert android_main_dashboard_page.on_screen( ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME setup_logging.info('{} is successfully logged in'.format( global_contents.login_user_name)) assert android_main_dashboard_page.get_logout_account_option( ).text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON assert android_main_dashboard_page.log_out( ) == global_contents.NEW_LOGISTRATION_ACTIVITY_NAME setup_logging.info('-- Ending {} Test Case'.format( TestAndroidLogin.__name__))
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
def test_check_login_smoke(self, login, set_capabilities, setup_logging): """ Scenarios: Verify Main Dashboard screen is loaded successfully after successful login """ global_contents = Globals(setup_logging) android_whats_new_page = AndroidWhatsNew(set_capabilities, setup_logging) setup_logging.info('-- Starting {} Test Case'.format( AndroidLoginSmoke.__name__)) if login and android_whats_new_page.on_screen(): 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 else: android_main_dashboard_page = AndroidMainDashboard( set_capabilities, setup_logging) assert android_main_dashboard_page.on_screen( ) == Globals.MAIN_DASHBOARD_ACTIVITY_NAME setup_logging.info('{} is successfully logged in'.format( global_contents.login_user_name))
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 re-login with new created account credentials """ android_register_page = AndroidRegister(set_capabilities, setup_logging) global_contents = Globals(setup_logging) android_whats_new_page = AndroidWhatsNew(set_capabilities, setup_logging) android_main_dashboard_page = AndroidMainDashboard( set_capabilities, 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() 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) if android_whats_new_page.on_screen(): 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 setup_logging.info('{} is successfully logged in'.format( global_contents.login_user_name)) else: assert android_main_dashboard_page.on_screen( ) == Globals.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 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))