def test_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that Course Dashboard tab will show following contents, Header contents, Back icon, Specific "<course name>" as Title, Share icon, Course, Verify that user should be able to go back by clicking Back icon Verify that user should be able to view these Course contents: Course Image, Course Name, Course Provider, Course Ending date, Last accessed(if any), Course Content, 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(): course_name = android_my_courses_list_page.get_first_course().text android_my_courses_list_page.get_first_course().click() else: setup_logging.info('No course enrolled by this user.') assert android_course_dashboard_page.get_navigation_icon().get_attribute('content-desc') \ == strings.COURSE_DASHBOARD_NAVIGATION_ICON android_course_dashboard_page.get_navigation_icon().click() assert android_main_dashboard_page.on_screen( ) == global_contents.MAIN_DASHBOARD_ACTIVITY_NAME android_my_courses_list_page.load_course_details_screen() if course_name: # Verifing the title of the screen assert android_course_dashboard_page.get_all_text_views( )[0].text in course_name assert android_course_dashboard_page.get_course_share_icon().get_attribute('content-desc') \ == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID assert android_course_dashboard_page.get_course_image() # verifing course name that is overlapping the course image assert android_course_dashboard_page.get_course_name( ).text in course_name assert android_course_dashboard_page.get_course_date() assert android_course_dashboard_page.get_resume_course_bar() assert android_course_dashboard_page.get_course_content_header()
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_resources_tab_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that resources tab will selected after loading Verify that Course Resources tab will show following contents, Resources as Title, Share icon, """ global_contents = Globals(setup_logging) android_course_dashboard_page = AndroidCourseDashboard(set_capabilities, setup_logging) resources_tab_element = android_course_dashboard_page.get_resources_tab() assert resources_tab_element.get_attribute('selected') == 'true' share_icon = android_course_dashboard_page.get_course_share_icon() assert share_icon.get_attribute('content-desc') == strings.COURSE_DASHBOARD_SHARE_COURSE_ANDROID resources_tab_title = global_contents.get_by_class_from_elements( set_capabilities, android_elements.all_textviews, global_contents.first_existence) assert resources_tab_title.text == strings.COURSE_DASHBOARD_RESOURCES_TAB