diff --git a/tests/android/pages/android_elements.py b/tests/android/pages/android_elements.py index b5240baa..8b89bb96 100644 --- a/tests/android/pages/android_elements.py +++ b/tests/android/pages/android_elements.py @@ -161,7 +161,7 @@ course_dashboard_content_header = 'org.edx.mobile:id/row_header' course_dashboard_download_icon = 'org.edx.mobile:id/bulk_download' course_dashboard_course_organization = 'org.edx.mobile:id/course_organization' -course_dashboard_toolbar_dismiss_button = 'org.edx.mobile:id/expanded_toolbar_dismiss' +course_dashboard_toolbar_dismiss_button = 'org.edx.mobile:id/collapsed_toolbar_dismiss' course_dashboard_course_title = 'org.edx.mobile:id/course_title' course_dashboard_course_expiry_date = 'org.edx.mobile:id/course_expiry_date' course_dashboard_upgrade_button = 'org.edx.mobile:id/btn_upgrade' @@ -260,6 +260,9 @@ profile_options_privacy_policy = 'org.edx.mobile:id/tv_privacy_policy' profile_options_cookie_policy = 'org.edx.mobile:id/tv_cookie_policy' profile_options_data_consent_policy = 'org.edx.mobile:id/tv_data_consent_policy' +profile_options_submit_feedback = 'org.edx.mobile:id/lbl_submit_feedback' +profile_options_get_support = 'org.edx.mobile:id/lbl_get_support' +profile_options_delete_description = 'org.edx.mobile:id/lbl_delete_account_description' # VIDEO DOWNLOAD QUALITY video_quality_popup_title = 'org.edx.mobile:id/tv_header_video_quality' diff --git a/tests/android/tests/test_android_edit_profile.py b/tests/android/tests/test_android_edit_profile.py index a289e02e..b4871c21 100644 --- a/tests/android/tests/test_android_edit_profile.py +++ b/tests/android/tests/test_android_edit_profile.py @@ -7,6 +7,7 @@ from tests.android.pages.android_login_smoke import AndroidLoginSmoke from tests.android.pages.android_main_dashboard import AndroidMainDashboard from tests.android.pages.android_profile import AndroidProfile +from tests.android.pages.android_profile_options import AndroidProfileOptions from tests.common import strings from tests.common.globals import Globals @@ -37,14 +38,22 @@ def test_ui_elements_smoke(self, set_capabilities, setup_logging): global_contents = Globals(setup_logging) android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging) - android_profile_screen = AndroidProfile(set_capabilities, setup_logging) edit_profile_screen = AndroidEditProfile(set_capabilities, setup_logging) + profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) + + profile_tab = android_main_dashboard_page.get_all_tabs()[2] + assert profile_tab.text == 'Profile' + profile_tab.click() + profile_tab = android_main_dashboard_page.get_all_tabs()[2].click() + screen_title = profile_options_page.get_all_textviews()[0] + assert screen_title.text == strings.PROFILE_OPTIONS_SCREEN_TITLE + user_image = global_contents.get_element_by_id(set_capabilities, android_elements.profile_screen_user_image) + assert user_image.get_attribute('displayed') == 'true' + user_image.click() - assert android_main_dashboard_page.load_account_screen() == global_contents.ACCOUNT_ACTIVITY_NAME - android_profile_screen.get_edit_profile_screen().click() assert edit_profile_screen.get_by_class_from_elements( android_elements.all_textviews, - global_contents.first_existence).text == strings.EDIT_PROFILE_SCREEN_TITLE + global_contents.first_existence).text == strings.PROFILE_OPTIONS_PERSONAL_INFORMATION_LABEL_LOWER assert edit_profile_screen.get_element_by_id(android_elements.edit_profile_screen_image)\ .get_attribute('displayed') == 'true' assert strings.EDIT_PROFILE_USER_NAME in edit_profile_screen.get_element_by_id( @@ -136,6 +145,5 @@ def test_sign_out_smoke(self, set_capabilities, setup_logging): android_profile_screen = AndroidProfile(set_capabilities, setup_logging) android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging) android_profile_screen.get_navigation_icon().click() - android_profile_screen.get_navigation_icon().click() assert android_main_dashboard_page.log_out() == global_contents.DISCOVERY_LAUNCH_ACTIVITY_NAME diff --git a/tests/android/tests/test_android_profile.py b/tests/android/tests/test_android_profile.py index 32b56402..55ab1b51 100644 --- a/tests/android/tests/test_android_profile.py +++ b/tests/android/tests/test_android_profile.py @@ -2,9 +2,12 @@ User Profile Test Module """ +from tests.android.pages import android_elements from tests.android.pages.android_login_smoke import AndroidLoginSmoke from tests.android.pages.android_main_dashboard import AndroidMainDashboard from tests.android.pages.android_profile import AndroidProfile +from tests.android.pages.android_profile_options import AndroidProfileOptions +from tests.common import strings from tests.common.globals import Globals @@ -35,16 +38,18 @@ def test_ui_elements_smoke(self, set_capabilities, setup_logging): global_contents = Globals(setup_logging) android_main_dashboard_page = AndroidMainDashboard(set_capabilities, setup_logging) android_profile_screen = AndroidProfile(set_capabilities, setup_logging) - - assert android_main_dashboard_page.load_account_screen() == global_contents.ACCOUNT_ACTIVITY_NAME - android_profile_screen.get_edit_profile_screen().click() - - android_profile_screen.get_navigation_icon().click() - android_profile_screen.get_edit_profile_screen().click() - android_profile_screen.get_navigation_icon().click() + profile_options_page = AndroidProfileOptions(set_capabilities, setup_logging) + + profile_tab = android_main_dashboard_page.get_all_tabs()[2] + assert profile_tab.text == 'Profile' + profile_tab.click() + profile_tab = android_main_dashboard_page.get_all_tabs()[2].click() + screen_title = profile_options_page.get_all_textviews()[0] + assert screen_title.text == strings.PROFILE_OPTIONS_SCREEN_TITLE + user_image = global_contents.get_element_by_id(set_capabilities, android_elements.profile_screen_user_image) + assert user_image.get_attribute('displayed') == 'true' + user_image.click() assert android_profile_screen.get_user_profile_image().get_attribute('displayed') == 'true' - assert android_profile_screen.get_user_profile_name().get_attribute('displayed') == 'true' - if android_profile_screen.get_user_profile_language(): assert android_profile_screen.get_user_profile_language().get_attribute('displayed') == 'true' diff --git a/tests/android/tests/test_android_profile_options.py b/tests/android/tests/test_android_profile_options.py index e979c26a..18cc8f13 100644 --- a/tests/android/tests/test_android_profile_options.py +++ b/tests/android/tests/test_android_profile_options.py @@ -30,14 +30,10 @@ def test_validate_video_settings_cell_elements(self, set_capabilities, setup_log 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() + profile_tab = android_main_dashboard_page.get_all_tabs()[2] + assert profile_tab.text == 'Profile' + profile_tab.click() + profile_tab = android_main_dashboard_page.get_all_tabs()[2].click() screen_title = profile_options_page.get_all_textviews()[0] assert screen_title.text == strings.PROFILE_OPTIONS_SCREEN_TITLE @@ -235,12 +231,12 @@ def test_validate_help_cell_elements(self, set_capabilities, setup_logging): """ 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()[17] + submit_feedback_label = global_contents.get_element_by_id( + set_capabilities, android_elements.profile_options_submit_feedback) assert submit_feedback_label.text == strings.PROFILE_OPTIONS_FEEDBACK_LABEL support_subtitle = global_contents.get_element_by_id( @@ -255,7 +251,8 @@ def test_validate_help_cell_elements(self, set_capabilities, setup_logging): set_capabilities, android_elements.profile_options_privacy_policy) global_contents.scroll_from_element(set_capabilities, privacy_policy) - get_support_label = profile_options_page.get_all_textviews()[8] + get_support_label = global_contents.get_element_by_id( + set_capabilities, android_elements.profile_options_get_support) assert get_support_label.text == strings.PROFILE_OPTIONS_SUPPORT_LABEL get_support_description = global_contents.get_element_by_id( @@ -294,7 +291,8 @@ def test_validate_signout_and_delete_cell_elements(self, set_capabilities, setup 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()[11] + delete_account_instructions = global_contents.get_element_by_id( + set_capabilities, android_elements.profile_options_delete_description) assert delete_account_instructions.text == strings.PROFILE_OPTIONS_DELETE_INFO_LABEL delete_account_button.click() diff --git a/tests/common/strings.py b/tests/common/strings.py index b61ff986..ab477ab8 100644 --- a/tests/common/strings.py +++ b/tests/common/strings.py @@ -318,7 +318,7 @@ PROFILE_OPTIONS_FAQ_BUTTON_ANDROID = 'View FAQ' PROFILE_OPTIONS_SIGNOUT_BUTTON = 'Sign out' PROFILE_OPTIONS_SIGNOUT_VERSION = 'Version 3.2.3 ' -PROFILE_OPTIONS_SIGNOUT_VERSION_ANDROID = 'App Version 4.0.0 PROD TEST' +PROFILE_OPTIONS_SIGNOUT_VERSION_ANDROID = 'Version 5.0.2 ' PROFILE_OPTIONS_DELETE_ACCOUNT_BUTTON = 'Delete account' PROFILE_OPTIONS_DELETE_INFO_LABEL = ('Follow the instructions on the next screen to delete your account and ' 'all related data.')