def test_navigation_from_main_navigation_bar(self): navigator_menu = MainNavigationMenu() base_page = BasePage() success_stories_item = navigator_menu.tab_success_stories_tob_bar arts_item = navigator_menu.item_arts_locator business_item = navigator_menu.item_business_locator '''Enable drop-down menu''' base_page.enable_drop_down(success_stories_item) '''Click in item in drop-down menu''' item_arts = navigator_menu.enable_drop_down(arts_item) item_arts.click() text = 'success' current_url = base_page.get_current_url() assert (text in current_url), \ '''Check some text in url''' '''If element not fount beck in privies pages''' base_page.back_to_privies_page(business_item) '''Enable drop-down menu''' base_page.enable_drop_down(success_stories_item) '''Click in item in drop-down menu''' item_business = navigator_menu.enable_drop_down(business_item) item_business.click() text = 'business' current_url = base_page.get_current_url() assert (text in current_url), \ '''Check some text in url'''
def test_button_in_top_bar(self): base_page = BasePage() button_python_locator = base_page.button_Python_header button_psf_locator = base_page.button_psf_header button_docs_locator = base_page.button_Docs_header button_pypi_locator = base_page.button_PypI_header button_jobs_locator = base_page.button_Jobs_header button_community_locator = base_page.button_Community_header """Checking top-bar menu is worked""" assert base_page.is_element_present(button_python_locator) is False, \ "Check present button Python in top-menu in main page" base_page.push(button_python_locator) assert base_page.is_element_present(button_psf_locator) is False, \ "Check present button PSF in top-menu in main page" base_page.push(button_psf_locator) assert base_page.is_element_present(button_docs_locator) is False, \ "Check present button Docs in top-menu in main page" base_page.push(button_docs_locator) base_page.back_to_privies_page(button_docs_locator) assert base_page.is_element_present(button_pypi_locator) is False, \ "Check present button PyPI in top-menu in main page" base_page.push(button_pypi_locator) base_page.back_to_privies_page(button_pypi_locator) assert base_page.is_element_present(button_jobs_locator) is False, \ "Check present button Jobs in top-menu in main page" base_page.push(button_jobs_locator) assert base_page.is_element_present(button_community_locator) is False, \ "Check present button Community in top-menu in main page" base_page.push(button_community_locator)
def test_navigation_menu_in_footer(self): base_page = BasePage() getting_started_in_footer_locator = base_page.getting_started_in_footer mac_os_x_in_footer_locator = base_page.mac_os_x_in_footer audio_visual_talks_part_footer_locator = base_page.audio_visual_talks_part_footer diversity_footer_locator = base_page.diversity_footer arts_footer_locator = base_page.arts_footer psf_news_footer_locator = base_page.psf_news_footer core_mentorship_footer_locator = base_page.core_mentorship_footer python_events_footer_locator = base_page.python_events_footer footer_locator = base_page.top_part_footer base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(getting_started_in_footer_locator) current_url = base_page.get_current_url() text = 'gettingstarted' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(mac_os_x_in_footer_locator) current_url = base_page.get_current_url() text = 'mac-osx' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(audio_visual_talks_part_footer_locator) current_url = base_page.get_current_url() text = 'av' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(diversity_footer_locator) current_url = base_page.get_current_url() text = 'diversity' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(arts_footer_locator) current_url = base_page.get_current_url() text = 'arts' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(psf_news_footer_locator) current_url = base_page.get_current_url() text = 'blogspot' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.back_to_privies_page( core_mentorship_footer_locator ) # if element with 'core_mentorship_footer_locator' not fount back to privies page base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(core_mentorship_footer_locator) current_url = base_page.get_current_url() text = 'mentorship' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------''' base_page.scroll_into_view(footer_locator) time.sleep(0.5) base_page.push(python_events_footer_locator) current_url = base_page.get_current_url() text = 'events' assert (text in current_url), \ '''Check is there a text in the variable url on the page''' '''---------------------------------------------------------------------------------------'''