def test_profile_photo_options_smoke(self, set_capabilities, setup_logging): """ Scenarios: By clicking change photo button user can see these following options: Take photo Choose photo Remove photo """ global_contents = Globals(setup_logging) edit_profile_change_photo = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_photo) edit_profile_change_photo.click() edit_profile_choose_photo_option = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_choose_photo_option) assert edit_profile_choose_photo_option.text == strings.EDIT_PROFILE_CHOOSE_PHOTO_TEXT edit_profile_remove_photo_option = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_remove_photo_option) assert edit_profile_remove_photo_option.text == strings.EDIT_PROFILE_REMOVE_PHOTO_TEXT_IOS edit_profile_cancel_photo_option = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_cancel_photo_option) assert edit_profile_cancel_photo_option.text == strings.EDIT_PROFILE_CANCEL_PHOTO_POPUP edit_profile_cancel_photo_option.click()
def test_profile_views_ui_smoke(self, set_capabilities, setup_logging): """ Scenarios: User should be able to see the following contents on edit profile screen Profile label Full profile button Limited profile button Limited profile instructions """ global_contents = Globals(setup_logging) ios_profile_page = IosProfile(set_capabilities, setup_logging) title_element = ios_profile_page.get_subsection_title() assert title_element.get_attribute( 'value') == strings.EDIT_PROFILE_SCREEN_TITLE edit_profile_subtitle_label = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_subtitle_label) assert edit_profile_subtitle_label.text == strings.EDIT_PROFILE_LABEL_TEXT edit_profile_full_view = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_full_view) assert edit_profile_full_view.get_attribute( 'label') == strings.EDIT_PROFILE_FULL_VIEW_TEXT edit_profile_limited_view = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_limited_view) assert edit_profile_limited_view.get_attribute( 'label') == strings.EDIT_PROFILE_LIMITED_VIEW_TEXT edit_profile_instructions = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_instructions) assert edit_profile_instructions.text == strings.EDIT_PROFILE_INSTRUCTIONS_TEXT
def test_update_profile_language(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can update language """ ios_profile_page = IosProfile(set_capabilities, setup_logging) ios_edit_profile_page = IosEditProfile(set_capabilities, setup_logging) global_contents = Globals(setup_logging) edit_profile_change_language = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_language) edit_profile_change_language.click() esperanto_language = ios_edit_profile_page.update_profile_elements( strings.EDIT_PROFILE_USER_ESPERANTO_LANGUAGE) ios_profile_page.get_edit_profile_back_icon().click() assert ios_edit_profile_page.get_language_on_edit_profile( ).get_attribute('value') == esperanto_language edit_profile_change_language = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_language) edit_profile_change_language.click() english_language = ios_edit_profile_page.update_profile_elements( strings.EDIT_PROFILE_USER_ENGLISH_LANGUAGE) ios_profile_page.get_edit_profile_back_icon().click() assert ios_edit_profile_page.get_language_on_edit_profile( ).get_attribute('value') == english_language
def test_update_profile_location(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can update location Verify that user can update language 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) edit_profile_full_view = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_full_view) edit_profile_full_view.click() edit_profile_change_location = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_location) edit_profile_change_location.click() new_location = ios_edit_profile_page.update_profile_elements( strings.EDIT_PROFILE_ALGERIA_LOCATION) ios_profile_page.get_edit_profile_back_icon().click() assert ios_edit_profile_page.get_location_on_edit_profile( ).get_attribute('value') == new_location edit_profile_change_location = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_location) edit_profile_change_location.click() old_location = ios_edit_profile_page.update_profile_elements( strings.EDIT_PROFILE_ALBANIA_LOCATION) ios_profile_page.get_edit_profile_back_icon().click() assert ios_edit_profile_page.get_location_on_edit_profile( ).get_attribute('value') == old_location
def test_validate_personal_information_cell_elements( self, set_capabilities, setup_logging): """ Verify that personal information cell will show following contents: Personal information label Email Username Profile image """ global_contents = Globals(setup_logging) personal_information_option_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_personal_information_option_label) assert personal_information_option_label.text == strings.PROFILE_OPTIONS_PERSONAL_INFORMATION_LABEL personal_information_email_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_personal_information_email_label) assert personal_information_email_label.get_attribute( 'visible') == 'true' personal_information_username_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_personal_information_username_label) assert personal_information_username_label.get_attribute( 'visible') == 'true' personal_information_profile_view = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_personal_information_profile_view) assert personal_information_profile_view.get_attribute( 'visible') == 'true'
def test_vide_download_quality_smoke(self, set_capabilities, setup_logging): """ Verify that clicking video quality cell will open Video quality popup Verify that video quality popup show following elements "Video download quality" as title Back icon, Close icon Auto Recommended, 360p (smallest file size), 540p, 720p (Best quality) Verify that clicking all the qualities will select that quality and show it in Profile options screen """ global_contents = Globals(setup_logging) profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) video_quality_subtitle_label = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_video_quality_subtitle_label) assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_AUTO_QUALITY video_quality_subtitle_label.click() video_quality_popup_title = global_contents.get_element_by_id( set_capabilities, android_elements.video_quality_popup_title) assert video_quality_popup_title.text == strings.VIDEO_DOWNLOAD_QUALITY_POPUP_TITLE video_quality_popup_description = global_contents.get_element_by_id( set_capabilities, android_elements.video_quality_popup_message) assert video_quality_popup_description.text == strings.VIDEO_DOWNLOAD_QUALITY_POPUP_DESCRIPTION video_auto_quality = profile_options_page.get_all_video_qualitie_titles( )[0] assert video_auto_quality.text == strings.VIDEO_DOWNLOAD_AUTO_QUALITY video_360p_quality = profile_options_page.get_all_video_qualitie_titles( )[1] assert video_360p_quality.text == strings.VIDEO_DOWNLOAD_360p_QUALITY video_360p_quality.click() assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_360p_QUALITY video_quality_subtitle_label.click() video_540p_quality = profile_options_page.get_all_video_qualitie_titles( )[2] assert video_540p_quality.text == strings.VIDEO_DOWNLOAD_540p_QUALITY video_540p_quality.click() assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_540p_QUALITY video_quality_subtitle_label.click() video_720p_quality = profile_options_page.get_all_video_qualitie_titles( )[3] assert video_720p_quality.text == strings.VIDEO_DOWNLOAD_720p_QUALITY video_720p_quality.click() assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_720p_QUALITY video_quality_subtitle_label.click() cancel_button = global_contents.get_element_by_id( set_capabilities, android_elements.video_quality_cancel_button) cancel_button.click() assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_720p_QUALITY
def test_download_to_device_smoke(self, set_capabilities, setup_logging): """ Verify the following senarios: check if download to device toggel off click on toggle if allow/deny permission popup appears check allow, deny and permission elements click on allow button check and click on progress wheel """ global_contents = Globals(setup_logging) android_video_dashboard = AndroidVideoDasboard(set_capabilities, setup_logging) assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_ONLINE_STATUS) if global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).text \ == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_OFF: global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).click() if global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.first_existence): assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.first_existence).text \ == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_message, global_contents.first_existence) assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.second_existence ).text == strings.VIDEO_DOWNLOAD_PERMISSION_DENY_BUTTON global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.first_existence).click() global_contents.wait_and_get_element( set_capabilities, android_elements.video_dahboard_video_icon) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dahboard_video_icon)
def test_validate_video_settings_cell_elements(self, set_capabilities, setup_logging): """ Verify that video settings cell will show following contents: Close icon "Profile" as Title Video Settings label Wifi only download Wifi switch Video download quality label Video quality description """ android_main_dashboard_page = AndroidMainDashboard( set_capabilities, setup_logging) profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) global_contents = Globals(setup_logging) menu_icon = android_main_dashboard_page.get_menu_icon() assert menu_icon.get_attribute( 'content-desc') == strings.PROFILE_SCREEN_TITLE android_main_dashboard_page.get_menu_icon().click() navigation_icon = profile_options_page.get_all_image_buttons()[0] assert navigation_icon.get_attribute( 'content-desc') == strings.PROFILE_OPTIONS_SCREEN_NAVIGATION_ICON navigation_icon.click() android_main_dashboard_page.get_menu_icon().click() screen_title = profile_options_page.get_all_textviews()[0] assert screen_title.text == strings.PROFILE_OPTIONS_SCREEN_TITLE video_settings_option_label = profile_options_page.get_all_textviews( )[1] assert video_settings_option_label.text == strings.PROFILE_OPTIONS_VIDEO_SETTINGS_OPTION_LABEL wifi_only_download_label = profile_options_page.get_all_textviews()[2] assert wifi_only_download_label.text == strings.PROFILE_OPTIONS_VIDEO_SETTINGS_DESCRIPTION_LABEL wifi_switch = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_wifi_switch) assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON_ANDROID download_content_subtitle = profile_options_page.get_all_textviews()[3] assert download_content_subtitle.text == strings.SETTINS_SCREEN_DOWNLOAD_CONTENT_TEXT_ANDROID video_download_quality_description = profile_options_page.get_all_textviews( )[4] assert video_download_quality_description.text == strings.PROFILE_OPTIONS_VIDEO_QUALITY_DESCRIPTION_LABEL video_quality_subtitle_label = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_video_quality_subtitle_label) assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_AUTO_QUALITY
def test_video_download_smoke(self, set_capabilities, setup_logging): """ Verify the following scenario: check all videos are downloading wait for all videos to download check all videos are downloaded turn off toggel and check all video are deleted Check single subsection video is downloaded """ global_contents = Globals(setup_logging) android_video_dashboard = AndroidVideoDasboard(set_capabilities, setup_logging) # commenting this case until get the updated ID's from Dev team # assert android_video_dashboard.check_videos_status(set_capabilities, # strings.VIDEO_ICON_DOWNLOADING_STATUS) assert android_video_dashboard.wait_for_all_videos_to_download(set_capabilities) \ == strings.VIDEO_DASHBOARD_ALL_VIDEOS_DOWNLOADED assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_DOWNLOADED_STATUS) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).text \ == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_ON global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).click() assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).text \ == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_OFF assert android_video_dashboard.wait_for_all_videos_to_delete(set_capabilities) \ == strings.VIDEO_DASHBOARD_TV_TITLE assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_ONLINE_STATUS) global_contents.wait_and_get_element( set_capabilities, android_elements.video_dashboard_download_section).click() # commenting this case until get the updated ID's from Dev team # assert android_video_dashboard.check_videos_status(set_capabilities, # strings.VIDEO_ICON_DOWNLOADING_STATUS) assert android_video_dashboard.wait_for_all_videos_to_download(set_capabilities) \ == strings.VIDEO_DASHBOARD_ALL_VIDEOS_DOWNLOADED assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_DOWNLOADED_STATUS)
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 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_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_video_tab_contents_smoke(self, set_capabilities, setup_logging): """ Verify Video tab showing following content: Videos as title course share icon Video TV title Video TV sub-title Video icon Download to device toggle Verify download to device permission dialouge contents: Allow button Deny Button Permission message """ global_contents = Globals(setup_logging) android_course_dashboard_page = AndroidCourseDashboard( set_capabilities, setup_logging) android_course_section_page = AndroidCourseSubsection( set_capabilities, setup_logging) android_course_dashboard_page.get_videos_tab().click() topic_name = android_course_section_page.get_course_row_title().text android_course_section_page.get_course_row_title().click() assert topic_name in android_course_dashboard_page.get_all_text_views( )[0].text assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_tv_title ).text == strings.VIDEO_DASHBOARD_TV_TITLE assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_tv_subtitle ).text == strings.VIDEO_SUBSECTION_TV_SUBTITLE assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dahboard_video_icon) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_download_bar) assert android_course_dashboard_page.get_course_content_header().text
def test_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: User should be able to see the following contents by tapping on edit button from profile screen Edit profile screen title Edit Profile image User Name Change photo button """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_profile_page = IosProfile(set_capabilities, setup_logging) global_contents = Globals(setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME ios_main_dashboard_page.get_drawer_icon().click() ios_profile_page.get_personal_information_profile_cell().click() assert ios_profile_page.get_subsection_title( ).text == strings.PROFILE_SCREEN_TITLE assert ios_profile_page.get_navigation_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_profile_page.get_profile_screen_edit_profile_button().get_attribute('label') == \ strings.IOS_PROFILE_SCREEN_EDIT_PROFILE_BUTTON_TEXT assert ios_profile_page.get_profile_screen_username_label( ).get_attribute('visible') == 'true' ios_profile_page.get_profile_screen_edit_profile_button().click() title_element = ios_profile_page.get_subsection_title() assert title_element.get_attribute( 'value') == strings.EDIT_PROFILE_SCREEN_TITLE edit_profile_screen_image = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_screen_image) assert edit_profile_screen_image.get_attribute('enabled') == 'true' edit_profile_user_name = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_user_name) assert edit_profile_user_name.get_attribute('visible') == 'true' edit_profile_change_photo = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_photo) assert edit_profile_change_photo.get_attribute('visible') == 'true'
def test_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that Course Discussions Dashboard tab will show following contents, Header contents, Back icon, Discussions as Title, Verify that user should be able to view these Course contents: Search posts, All posts, Posts I'm following, General Verify all screen contents have their default values """ global_contents = Globals(setup_logging) android_course_dashboard_page = AndroidCourseDashboard( set_capabilities, setup_logging) android_my_courses_list_page = AndroidMyCoursesList( set_capabilities, setup_logging) android_main_dashboard_page = AndroidMainDashboard( set_capabilities, setup_logging) assert android_main_dashboard_page.load_courses_tab() if android_my_courses_list_page.get_my_courses_list_row(): android_my_courses_list_page.get_second_course().click() else: setup_logging.info('No course enrolled by this user.') navigation_icon = android_course_dashboard_page.get_navigation_icon() assert navigation_icon.get_attribute( 'content-desc') == strings.COURSE_DASHBOARD_NAVIGATION_ICON discussion_tab_element = android_course_dashboard_page.get_discussion_tab( ) discussion_tab_element.click() assert discussion_tab_element.get_attribute('selected') == 'true' assert global_contents.get_element_by_id( set_capabilities, android_elements.discussion_search_post ).text == strings.DISCUSSION_SEARCH_POST all_posts_element = global_contents.get_by_id_from_elements( set_capabilities, android_elements.discussion_all_posts_button, global_contents.first_existence) assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS my_following_posts_element = global_contents.get_by_id_from_elements( set_capabilities, android_elements.discussion_all_posts_button, global_contents.second_existence) assert my_following_posts_element.text == strings.DISCUSSION_MY_FOLLOWING_POSTS general_posts_element = global_contents.get_by_id_from_elements( set_capabilities, android_elements.discussion_all_posts_button, global_contents.third_existence) assert general_posts_element.text == strings.DISCUSSION_COURSE_FEEDBACK
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) profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) sign_out_button = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_signout_button) assert sign_out_button.text == strings.PROFILE_OPTIONS_SIGNOUT_BUTTON app_version = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_app_version) assert app_version.text == strings.PROFILE_OPTIONS_SIGNOUT_VERSION delete_account_button = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_delete_account_button) assert delete_account_button.text == strings.PROFILE_OPTIONS_DELETE_ACCOUNT_BUTTON delete_account_instructions = profile_options_page.get_all_textviews( )[10] assert delete_account_instructions.text == strings.PROFILE_OPTIONS_DELETE_INFO_LABEL delete_account_button.click() assert profile_options_page.get_all_textviews( )[0].text == strings.DELETE_ACCOUNT_PAGE_TITLE set_capabilities.back() personal_information_email_label = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_personal_information_email_label) global_contents.scroll_screen(set_capabilities, personal_information_email_label, delete_account_button)
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_allow_cellular_download_smoke(self, set_capabilities, setup_logging): """ Verify that wifi switch is turned ON by default Verify that turning the switch ON again will open Allow cellular download popup Verify that cellular download popup show these elements "Allow Cellular Download" as Title Allow cellular download Description Don't allow button Allow button Verify that clicking allow button will turn the wifi switch ON Verify that clicking Don't allow button will turn the wifi switch OFF """ global_contents = Globals(setup_logging) wifi_switch = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_wifi_switch) assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON_ANDROID wifi_switch.click() assert global_contents.wait_for_element_visibility( set_capabilities, android_elements.settings_screen_allow_cellular_download_dialog ).get_attribute('displayed') == 'true' title = global_contents.get_element_by_id( set_capabilities, android_elements.settings_screen_dialog_title) assert title.text == strings.SETTINGS_SCREEN_DIALOG_TITLE message = global_contents.get_element_by_id( set_capabilities, android_elements.settings_screen_dialog_message) assert message.text == strings.SETTINGS_SCREEN_DIALOG_MESSAGE dont_allow_button = global_contents.get_element_by_id( set_capabilities, android_elements.settings_screen_dialog_dont_allow_button) assert dont_allow_button.text == strings.SETTINGS_SCREEN_DIALOG_DONT_ALLOW_BUTTON allow_button = global_contents.get_element_by_id( set_capabilities, android_elements.settings_screen_dialog_allow_button) assert allow_button.text == strings.SETTINGS_SCREEN_DIALOG_ALLOW_BUTTON dont_allow_button.click() wifi_switch = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_wifi_switch) assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON_ANDROID wifi_switch.click() allow_button = global_contents.get_element_by_id( set_capabilities, android_elements.settings_screen_dialog_allow_button) allow_button.click() wifi_switch = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_wifi_switch) assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_OFF_ANDROID
def test_video_tab_contents_smoke(self, set_capabilities, setup_logging): """ Verify Video tab showing following content: Videos as title course share icon Video TV title Video TV sub-title Video icon Download to device toggle Verify download to device permission dialouge contents: Allow button Deny Button Permission message """ global_contents = Globals(setup_logging) android_course_dashboard_page = AndroidCourseDashboard( set_capabilities, setup_logging) android_course_dashboard_page.get_videos_tab().click() assert android_course_dashboard_page.get_all_text_views()[0].text \ == strings.COURSE_DASHBOARD_VIDEOS_TAB assert android_course_dashboard_page.get_course_share_icon().get_attribute('content-desc') \ == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_tv_title ).text == strings.VIDEO_DASHBOARD_TV_TITLE assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_tv_subtitle ).text == strings.VIDEO_DASHBOARD_TV_SUBTITLE assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dahboard_video_icon) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_download_bar) assert android_course_dashboard_page.get_course_content_header().text
def test_validate_video_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) help_cell = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell) assert help_cell.get_attribute('visible') == 'true' help_cell_feedback_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell_feedback_label) assert help_cell_feedback_label.text == strings.PROFILE_OPTIONS_FEEDBACK_LABEL help_cell_subtitle_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell_subtitle_label) assert help_cell_subtitle_label.text == strings.PROFILE_OPTIONS_FEEDBACK_SUBTITLE_LABEL help_cell_support_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell_support_label) assert help_cell_support_label.text == strings.PROFILE_OPTIONS_SUPPORT_LABEL help_cell_support_subtitle_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell_support_subtitle_label) assert help_cell_support_subtitle_label.text == strings.PROFILE_OPTIONS_SUPPORT_SUBTITLE_LABEL help_cell_option_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_help_cell_option_label) assert help_cell_option_label.get_attribute('visible') == 'true' email_feedback_button = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_email_feedback_button) assert email_feedback_button.text == strings.PROFILE_OPTIONS_EMAIL_FEEDBACK_BUTTON view_faq_button = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_view_faq_button) assert view_faq_button.text == strings.PROFILE_OPTIONS_FAQ_BUTTON
def test_profile_views_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that all content should be enabled for full profile view Verify that these contents will be disabled for limited profile view location language about me """ ios_profile_page = IosProfile(set_capabilities, setup_logging) global_contents = Globals(setup_logging) edit_profile_full_view = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_full_view) edit_profile_full_view.click() edit_profile_change_location = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_location) assert edit_profile_change_location.text == strings.EDIT_PROFILE_LOCATION_TEXT edit_profile_change_location.click() assert ios_profile_page.get_subsection_title( ).text == strings.EDIT_PROFILE_LOCATION_TITLE ios_profile_page.get_edit_profile_back_icon().click() edit_profile_change_language = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_language) assert edit_profile_change_language.text == strings.EDIT_PROFILE_LANGUAGE_TEXT edit_profile_change_language.click() assert ios_profile_page.get_subsection_title( ).text == strings.EDIT_PROFILE_LANGUAGE_TITLE ios_profile_page.get_edit_profile_back_icon().click() edit_profile_about_me = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_about_me) assert edit_profile_about_me.text == strings.EDIT_PROFILE_ABOUT_ME_TEXT edit_profile_about_me.click() assert ios_profile_page.get_subsection_title( ).text == strings.EDIT_PROFILE_ABOUT_ME_TITLE ios_profile_page.get_edit_profile_back_icon().click() edit_profile_limited_view = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_limited_view) edit_profile_limited_view.click() edit_profile_change_location = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_location) edit_profile_change_location.click() assert ios_profile_page.get_subsection_title().get_attribute( 'value') == strings.EDIT_PROFILE_SCREEN_TITLE edit_profile_change_language = global_contents.get_element_by_id( set_capabilities, ios_elements.edit_profile_change_language) edit_profile_change_language.click() assert ios_profile_page.get_subsection_title().get_attribute( 'value') == strings.EDIT_PROFILE_SCREEN_TITLE
def test_video_download_smoke(self, set_capabilities, setup_logging): """ Verify the following senarios: check all videos are downloading wait for all videos to download check all videos are downloaded turn off toggel and check all video are deleted check videos numbers with icons """ global_contents = Globals(setup_logging) android_video_dashboard = AndroidVideoDasboard(set_capabilities, setup_logging) assert android_video_dashboard.wait_for_all_videos_to_download(set_capabilities) \ == strings.VIDEO_DASHBOARD_ALL_VIDEOS_DOWNLOADED assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_DOWNLOADED_STATUS) assert android_video_dashboard.check_all_videos_numbers( set_capabilities) assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).text \ == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_ON global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).click() assert global_contents.get_element_by_id( set_capabilities, android_elements.video_dashboard_bulk_download_toggle).text \ == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_OFF assert android_video_dashboard.wait_for_all_videos_to_delete(set_capabilities) \ == strings.VIDEO_DASHBOARD_TV_TITLE assert android_video_dashboard.check_videos_status( set_capabilities, strings.VIDEO_ICON_ONLINE_STATUS) assert android_video_dashboard.check_all_videos_numbers( set_capabilities)
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_sign_out_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that user can logout from my profile options screen """ global_contents = Globals(setup_logging) sign_out_button = global_contents.get_element_by_id( set_capabilities, android_elements.profile_options_signout_button) sign_out_button.click() assert global_contents.wait_for_android_activity_to_load( set_capabilities, global_contents.NEW_LOGISTRATION_ACTIVITY_NAME ) == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME setup_logging.info(' Ending Test Case --')
def test_allow_cellular_download_smoke(self, set_capabilities, setup_logging): """ Verify that wifi switch is turned ON by default Verify that turning the switch ON again will open Allow cellular download popup Verify that cellular download popup show these elements "Allow Cellular Download" as Title Allow cellular download Description Don't allow button Allow button Verify that clicking allow button will turn the wifi switch ON Verify that clicking Don't allow button will turn the wifi switch OFF """ global_contents = Globals(setup_logging) ios_profile_options_page = IosProfileOptions(set_capabilities, setup_logging) wifi_switch = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_wifi_switch) assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON wifi_switch.click() assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_OFF wifi_switch.click() cellular_download_popup_title = ios_profile_options_page.get_all_textviews( )[2] assert cellular_download_popup_title.text == strings.CELLULAR_DOWNLOAD_POPUP_TITLE_IOS cellular_download_popup_message = ios_profile_options_page.get_all_textviews( )[3] assert cellular_download_popup_message.text == strings.CELLULAR_DOWNLOAD_POPUP_MESSAGE_IOS cellular_popup_allow_button = ios_profile_options_page.get_all_buttons( )[6] cellular_popup_dont_allow_button = ios_profile_options_page.get_all_buttons( )[5] assert cellular_popup_allow_button.text == strings.CELLULAR_DOWNLOAD_POPUP_ALLOW_BUTTON assert cellular_popup_dont_allow_button.text == strings.CELLULAR_DOWNLOAD_POPUP_DONT_ALLOW_BUTTON cellular_popup_dont_allow_button.click() assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON wifi_switch.click() allow_button = ios_profile_options_page.get_all_buttons()[5] allow_button.click() assert wifi_switch.text == strings.PROFILE_OPTIONS_WIFI_TOGGLE_ON
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_validate_video_settings_cell_elements(self, set_capabilities, setup_logging): """ Verify that video settings cell will show following contents: Close icon "Profile" as Title Video Settings label Wifi only download Wifi switch Video download quality label Video quality description """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_profile_options_page = IosProfileOptions(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME ios_main_dashboard_page.get_drawer_icon().click() assert ios_profile_options_page.get_all_textviews( )[1].text == strings.PROFILE_SCREEN_TITLE profile_options_close_button = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_close_button) assert profile_options_close_button.text == strings.CLOSE_BUTTON_TEXT profile_options_close_button.click() ios_main_dashboard_page.get_drawer_icon().click() wifi_switch = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_wifi_switch) assert wifi_switch.text video_settings_option_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_video_settings_option_label) assert video_settings_option_label.text == strings.PROFILE_OPTIONS_VIDEO_SETTINGS_OPTION_LABEL videos_setting_cell = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_videos_setting_cell) assert videos_setting_cell.get_attribute('visible') == 'true' video_settings_description_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_video_settings_description_label) assert video_settings_description_label.text == strings.PROFILE_OPTIONS_VIDEO_SETTINGS_DESCRIPTION_LABEL video_quality_description_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_video_quality_description_label) assert video_quality_description_label.text == strings.PROFILE_OPTIONS_VIDEO_QUALITY_DESCRIPTION_LABEL video_quality_subtitle_label = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_video_quality_subtitle_label) assert video_quality_subtitle_label.text == strings.VIDEO_DOWNLOAD_AUTO_QUALITY wifi_cell = global_contents.get_element_by_id( set_capabilities, ios_elements.profile_options_wifi_cell) assert wifi_cell.get_attribute('visible') == 'true'
def test_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that from Main Dashboard tapping on Discovery tab will load Discovery contents in its tab Verify that Discovery tab will show following contents, Header contents, "Discovery" as screen Title, Account Icon Three tabs Courses, Programs, Degrees Search Courses option "Browse By Subject" Section below, Subject Background Image, Subject Name Verify that from discovery screen, courses and programs tab are loaded """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) global_contents = Globals(setup_logging) assert ios_main_dashboard_page.get_discovery_tab( ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB assert ios_main_dashboard_page.load_discovery_tab( ).text == strings.SELECTED_BY_DEFAULT title_element = global_contents.get_all_views_on_ios_screen( set_capabilities, ios_elements.all_textviews)[0] assert title_element.text == strings.MAIN_DASHBOARD_DISCOVERY_TAB assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME course_discovery_tab = global_contents.get_all_views_on_ios_screen( set_capabilities, ios_elements.all_buttons)[4] assert course_discovery_tab.get_attribute( 'label') == strings.COURSES_DISCOVERY_COURSES_TAB course_discovery_tab.click() programs_discovery_tab = global_contents.get_all_views_on_ios_screen( set_capabilities, ios_elements.all_buttons)[5] assert programs_discovery_tab.get_attribute( 'label') == strings.COURSES_DISCOVERY_PROGRAMS_TAB programs_discovery_tab.click() degrees_discovery_tab = global_contents.get_all_views_on_ios_screen( set_capabilities, ios_elements.all_buttons)[6] assert degrees_discovery_tab.get_attribute( 'label') == strings.COURSES_DISCOVERY_DEGREES_TAB degrees_discovery_tab.click() course_discovery_tab.click() course_discovery_search_courses = global_contents.get_element_by_id( set_capabilities, ios_elements.course_discovery_search_courses) assert course_discovery_search_courses.get_attribute( 'label') == strings.COURSES_DISCOVERY_SEARCH_COURSE_IOS course_discovery_browse_by_subject = global_contents.get_element_by_id( set_capabilities, ios_elements.course_discovery_browse_by_subject) assert course_discovery_browse_by_subject.get_attribute('label') \ == strings.COURSES_DISCOVERY_BROWSE_BY_SUBJECT_IOS assert ios_main_dashboard_page.load_discovery_tab( ).text == strings.SELECTED_BY_DEFAULT assert ios_main_dashboard_page.get_courses_tab( ).text == strings.MAIN_DASHBOARD_COURSES_TAB assert ios_main_dashboard_page.load_courses_tab( ).text == strings.SELECTED_BY_DEFAULT assert ios_main_dashboard_page.load_programs_tab( ).text == strings.SELECTED_BY_DEFAULT assert ios_main_dashboard_page.load_discovery_tab( ).text == strings.SELECTED_BY_DEFAULT