def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ 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 """ global_contents = Globals(setup_logging) if global_contents.is_first_time: ios_whats_new_page = IosWhatsNew(set_capabilities, setup_logging) assert ios_whats_new_page.get_title_textview() assert ios_whats_new_page.get_close_button( ).text == strings.WHATS_NEW_Close_button assert ios_whats_new_page.get_main_image() assert ios_whats_new_page.get_feature_title_textview() assert ios_whats_new_page.get_feature_details() assert ios_whats_new_page.get_close_button( ).text == strings.CLOSE_BUTTON_TEXT else: setup_logging.info('validate_ui_elements is not needed') assert True
def test_login_smoke(self, set_capabilities, setup_logging): """ Scenario: Verify that app shows proper error msg/dialog when user try to login with wrong Username or password Verify that user can login with valid Username and Password Verify that user can log out and back to login screen """ global_contents = Globals(setup_logging) ios_login_page = IosLogin(set_capabilities, setup_logging) 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) if global_contents.is_first_time: ios_whats_new_page = IosWhatsNew(set_capabilities, setup_logging) ios_whats_new_page.get_close_button().click() else: setup_logging.info('navigate_features is not needed') setup_logging.info('{} is successfully logged in'.format( global_contents.login_user_name)) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_main_dashboard_page.get_account_options( )[3].text == strings.ACCOUNT_LOGOUT assert ios_main_dashboard_page.log_out().text == strings.LOGIN setup_logging.info('{} is successfully logged out'.format( global_contents.login_user_name))
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_whats_new_page = IosWhatsNew(set_capabilities, setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_main_dashboard_page.get_account_options()[3].text == strings.ACCOUNT_LOGOUT assert ios_main_dashboard_page.log_out().text == strings.LOGIN assert ios_login_page.login(global_contents.login_user_name, global_contents.login_password) assert IosWhatsNew(set_capabilities, setup_logging).get_title_textview() setup_logging.info('{} is successfully logged in'.format(global_contents.login_user_name)) global_contents.turn_orientation(set_capabilities, global_contents.LANDSCAPE_ORIENTATION) assert ios_whats_new_page.get_title_textview() assert ios_whats_new_page.get_close_button().text == strings.BLANK_FIELD assert ios_whats_new_page.get_main_image() assert ios_whats_new_page.get_feature_title_textview() assert ios_whats_new_page.get_feature_details() assert ios_whats_new_page.get_done_button().text == strings.WHATS_NEW_DONE assert ios_whats_new_page.navigate_features().text == strings.WHATS_NEW_DONE assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_main_dashboard_page.get_account_options()[3].text == strings.ACCOUNT_LOGOUT assert ios_main_dashboard_page.log_out().text == strings.LOGIN setup_logging.info('{} is successfully logged out'.format(global_contents.login_user_name)) ios_login_page = IosLogin(set_capabilities, setup_logging) login_output = ios_login_page.login( global_contents.login_user_name, global_contents.login_password, False ) assert login_output.text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME setup_logging.info('{} is successfully logged in'.format(global_contents.target_environment)) global_contents.turn_orientation(set_capabilities, global_contents.PORTRAIT_ORIENTATION) setup_logging.info('-- Ending Test Case')