def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that from My Courses list tapping any Course will load Course Dashboard screen/contents(of this specific course) in its tab Verify on tapping "Videos" tab will load Videos screen """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME if ios_my_courses_list.get_my_courses_list_row(): course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen().text assert ios_course_dashboard_page.get_course_title().text in course_name assert ios_course_dashboard_page.get_videos_tab( ).text == strings.COURSE_DASHBOARD_VIDEOS_TAB ios_course_dashboard_page.load_videos_tab() assert ios_course_dashboard_page.get_videos_tab( ).text == global_contents.is_selected
def test_load_course_details_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that tapping any course should load specific Course Dashboard screen Verity that from Course Dashboard tapping back should load My Courses List screen Verify that user should be able to scroll courses Verify on tapping "Find a Course" button will load Discovery screen Verity that from Course Dashboard tapping back should load My Courses List screen """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) if ios_my_courses_list.get_my_courses_list_row(): course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen( ).text in course_name set_capabilities.back() # assert ios_my_courses_list.load_discovery_screen().text == strings.COURSES_DISCOVERY_BROWSE_BY_SUBJECT_LABEL setup_logging.info(set_capabilities.context) assert ios_main_dashboard_page.load_courses_tab( ).text == strings.SELECTED_BY_DEFAULT
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that from My Courses list tapping any Course will load Course Dashboard screen/contents(of this specific course) in its tab Verify that Course Dashboard screen will show following contents, Header contents, Back icon, Specific "<course name>" as Title, Share icon, Footer Content, Course, Videos, Discussion, Dates, Resources 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 """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME if ios_my_courses_list.get_my_courses_list_row(): course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen().text in course_name assert ios_course_dashboard_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE assert ios_course_dashboard_page.get_course_image() assert ios_course_dashboard_page.get_course_title().text in course_name assert ios_course_dashboard_page.get_course_date() resume_element = ios_course_dashboard_page.get_course_resume_row() assert resume_element.get_attribute('label') == strings.COURSE_DASHBOARD_RESUME_ROW assert ios_course_dashboard_page.get_course_section_header() assert ios_course_dashboard_page.get_course_item_title() assert ios_course_dashboard_page.get_course_item_download_icon()
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Verify that Course Subsection screen will show following Header contents: Back icon Specific "<Topic name>" as Title Verify that user should be able to go back by clicking Back icon """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) ios_subsection = IosCourseSubsection(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert strings.COURSE_NAME_IOS in ios_my_courses_list.load_course_details_screen( ).text assert ios_subsection.get_subsection_component_title() section_name = ios_subsection.get_subsection_component_title().text ios_subsection.get_subsection_component_title().click() assert ios_subsection.get_subsection_title()[0].text == section_name back_icon = ios_subsection.get_navigation_back_icon()[0] assert back_icon.get_attribute('visible') == 'true' back_icon.click()
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that Course Html Component screen will show following Header contents, Back icon Specific "<Topic name>" as Title Verify that user should be able to go back by clicking Back icon Verify that user should be able to view these: Topic name Verify that footer should have Previous and Next button in it Verify that user should be able to navigate between Previous and Next Button from footer """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) ios_subsection = IosCourseSubsection(set_capabilities, setup_logging) ios_html_component = IosCourseHtmlComponent(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert strings.COURSE_NAME_IOS in ios_my_courses_list.load_course_details_screen( ).text assert ios_subsection.get_subsection_component_title() section_name = ios_subsection.get_subsection_component_title().text ios_subsection.get_subsection_component_title().click() assert ios_subsection.get_subsection_title()[0].text == section_name back_icon = ios_subsection.get_navigation_back_icon()[0] assert back_icon.get_attribute('visible') == 'true' back_icon.click() assert ios_course_dashboard_page.get_course_title( ).text in strings.COURSE_NAME_IOS subsection_component = ios_subsection.get_subsection_component()[0] subsection_component.click() assert ios_subsection.get_course_subsection_header_label() assert ios_subsection.get_subsection_html_topic_title() html_component = ios_subsection.get_subsection_component()[0] html_component.click() assert ios_subsection.get_subsection_title( )[0].text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT_IOS previous_navigation_button = ios_html_component.get_all_buttons()[1] next_navigation_button = ios_html_component.get_all_buttons()[2] assert previous_navigation_button.text == strings.COURSE_HTML_COMPONENT_PREV_BUTTON assert strings.COURSE_HTML_COMPONENT_NEXT_BUTTON in next_navigation_button.text next_navigation_button.click() assert strings.COURSE_HTML_COMPONENT_PREV_BUTTON in previous_navigation_button.text ios_html_component.get_all_buttons()[1].click() assert ios_subsection.get_subsection_title( )[0].text == strings.COURSE_SUBSECTION_CONTENT_ROW_TEXT_IOS
def test_landscape_smoke(self, set_capabilities, setup_logging): """ Scenarios: Change device orientation to Landscape mode Verify that from Main Dashboard tapping Courses tab will load My Courses list(of specific logged in user) in its tab Verify following contents on Header, Profile icon, "Courses" title, Account Icon Verify that My Courses(enrolled) List has following contents in each course, Course Name, Course Start/End date Verify that "Looking for a new challenge?" label and "Find a Course" button are available Verify that tapping any course should load specific Course Dashboard screen Verity that from Course Dashboard tapping back should load My Courses List screen Verify that user should be able to scroll courses Verify on tapping "Find a Course" button will load Discovery screen Verity that from Course Dashboard tapping back should load My Courses List screen Verify user is able to change device orientation back to Portrait Mode """ global_contents = Globals(setup_logging) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) global_contents.turn_orientation(set_capabilities, global_contents.LANDSCAPE_ORIENTATION) assert ios_main_dashboard_page.get_profile_icon( ).text == strings.MAIN_DASHBOARD_PROFILE assert ios_main_dashboard_page.get_title_textview_landscape_mode( ).text == strings.BLANK_FIELD assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_main_dashboard_page.get_courses_tab( ).text == strings.SELECTED_BY_DEFAULT assert ios_main_dashboard_page.get_discovery_tab( ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB if ios_my_courses_list.get_my_courses_list_row(): assert ios_my_courses_list.get_my_course_name() assert ios_my_courses_list.get_my_course_details() course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen( ).text in course_name set_capabilities.back() else: setup_logging.info('No course enrolled by this user.') # assert ios_my_courses_list.get_find_courses_message().text == strings.MY_COURSES_LIST_FIND_COURSES_MESSAGE # assert ios_my_courses_list.get_find_course_button().text == strings.MY_COURSES_LIST_FIND_COURSES_BUTTON_IOS ios_my_courses_list.load_discovery_screen() setup_logging.info(set_capabilities.context) assert ios_main_dashboard_page.load_courses_tab( ).text == strings.SELECTED_BY_DEFAULT global_contents.turn_orientation(set_capabilities, global_contents.PORTRAIT_ORIENTATION) setup_logging.info('-- Ending Test Case')
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify following contents on Header, Profile icon, "Courses" title, Account Icon Verify that My Courses(enrolled) List has following contents in each course, Course Name, Course Start/End date Verify that "Looking for a new challenge?" label and "Find a Course" button are available """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_profile_icon( ).text == strings.MAIN_DASHBOARD_PROFILE assert ios_main_dashboard_page.get_title_textview_portrait_mode( ).text == strings.BLANK_FIELD assert ios_main_dashboard_page.get_drawer_icon( ).text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME assert ios_main_dashboard_page.get_courses_tab( ).text == strings.SELECTED_BY_DEFAULT assert ios_main_dashboard_page.get_discovery_tab( ).text == strings.MAIN_DASHBOARD_DISCOVERY_TAB assert ios_my_courses_list.get_my_courses_list_row() if ios_my_courses_list.get_my_courses_list_row(): assert ios_my_courses_list.get_my_course_name() assert ios_my_courses_list.get_my_course_details() else: setup_logging.info('No course enrolled by this user.')
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that from My Courses list tapping any Course will load Course Dashboard screen/contents(of this specific course) in its tab Verify that user should be able to go back by clicking Back icon """ ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) ios_course_resources_page = IosCourseResources(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME if ios_my_courses_list.get_my_courses_list_row(): course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen().text in course_name assert ios_course_dashboard_page.get_resources_tab().text == strings.COURSE_DASHBOARD_RESOURCES_TAB ios_course_dashboard_page.load_resources_tab() assert ios_course_dashboard_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE assert ios_course_resources_page.get_subsection_title()[0].text == strings.COURSE_DASHBOARD_RESOURCES_TAB assert ios_course_resources_page.get_navigation_back_icon()[0].text == 'Courses'
def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): """ Scenarios: Verify that from My Courses list tapping any Course will load Course Dashboard screen/contents(of this specific course) in its tab Verify on tapping "Videos" tab will load Videos screen Verify on tapping "Discussion" tab will load Discussions screen 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) ios_main_dashboard_page = IosMainDashboard(set_capabilities, setup_logging) ios_my_courses_list = IosMyCoursesList(set_capabilities, setup_logging) ios_course_dashboard_page = IosCourseDashboard(set_capabilities, setup_logging) ios_discussions_page = IosDiscussionsDashboard(set_capabilities, setup_logging) assert ios_main_dashboard_page.get_drawer_icon().text == strings.MAIN_DASHBOARD_NAVIGATION_MENU_NAME if ios_my_courses_list.get_my_courses_list_row(): course_name = ios_my_courses_list.get_my_courses_list_row().text assert ios_my_courses_list.load_course_details_screen().text in course_name assert ios_course_dashboard_page.get_courses_tab().text == global_contents.is_selected assert ios_course_dashboard_page.get_videos_tab().text == strings.COURSE_DASHBOARD_VIDEOS_TAB ios_course_dashboard_page.load_videos_tab() assert ios_course_dashboard_page.get_videos_tab().text == global_contents.is_selected assert ios_course_dashboard_page.get_discussion_tab().text == strings.COURSE_DASHBOARD_DISCUSSION_TAB ios_course_dashboard_page.load_discussion_tab() assert ios_course_dashboard_page.get_discussion_tab().text == global_contents.is_selected assert ios_discussions_page.get_share_icon().text == strings.COURSE_DASHBOARD_SHARE_COURSE assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_DASHBOARD_TITLE assert ios_discussions_page.get_navigation_icon().text == 'Courses' assert ios_discussions_page.get_posts_search_element().text == strings.DISCUSSION_SEARCH_POST all_posts_element = global_contents.get_by_class_from_elements( set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence ) assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS following_posts_element = global_contents.get_by_class_from_elements( set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.second_existence ) assert following_posts_element.text == " Posts I'm Following" course_feedback_element = global_contents.get_by_class_from_elements( set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.third_existence ) assert course_feedback_element.text == strings.DISCUSSION_COURSE_QnA