def test_present_all_elements(self): route_url = '/about/gettingstarted/' self.add_rout_in_url_and_go_to_url(route_url) getting_started_page = GettingStarted() base_page = BasePage() elements_on_getting_started_page_locators = getting_started_page.getting_started_element_list HomePage().check_element_on_page( elements_on_getting_started_page_locators) '''Go to the iframe''' iframe_widget = IframeWidget() '''Locators in tweets widget''' psd_link = iframe_widget.the_psf_link_locator button_load_more_tweets = iframe_widget.button_load_more_tweets_locator tweets_locator = iframe_widget.tweet_locator '''Get list with the tweets''' tweets = base_page.get_list_elements(tweets_locator) len_tweets = len(tweets) print('\n---------len list--------\n' + str(len_tweets)) base_page.scroll_into_view(button_load_more_tweets) base_page.push(button_load_more_tweets) '''Get list with the tweets after click in load more tweet button''' tweets_after = base_page.get_list_elements(tweets_locator) # len_tweets_after_click = len(tweets_after) print('\n-----len after click list------\n' + str(len_tweets_after_click)) assert len_tweets < len_tweets_after_click, \ '''Check the len two list''' base_page.push(psd_link) current_url = base_page.get_current_url() expect_url = 'https://twitter.com' assert (expect_url in current_url) is False, \ '''Check on conformity expected url and current url'''
def test_logo(self): base_page = BasePage() logo_locator = base_page.logo_image_link main_dropdown = MainNavigationMenu() about_in_main_menu_locator = main_dropdown.tab_about_tob_bar download_in_main_menu_locator = main_dropdown.tab_downloads_tob_bar documentation_in_main_menu_locator = main_dropdown.tab_documentation_tob_bar community_in_main_menu_locator = main_dropdown.tab_community_tob_bar success_stories_in_main_menu_locator = main_dropdown.tab_success_stories_tob_bar news_in_main_menu_locator = main_dropdown.tab_news_tob_bar events_in_main_menu_locator = main_dropdown.tab_events_tob_bar '''-----------------------------------------------------------------------------------''' base_page.push(about_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''Check present logo on the page after click in the item About''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''After click on the logo, check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(download_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''Check present logo on the page after click in the item Downloads''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''After click on the logo, check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(documentation_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''After click on the logo, check present logo on the page after click in the item Documentation''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''Check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(community_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''After click on the logo, check present logo on the page after click in the item Community''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''Check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(success_stories_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''After click on the logo, check present logo on the page after click in the item Success Stories''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''Check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(news_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''After click on the logo, check present logo on the page after click in the item News''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''Check is it the button Lounch Interactiv shell''' '''-----------------------------------------------------------------------------------''' base_page.push(events_in_main_menu_locator) assert base_page.is_element_present(logo_locator) is False, \ '''After click on the logo, check present logo on the page after click in the item Events''' base_page.push(logo_locator) home_page = HomePage() launch_shel_locator = home_page.launch_interactive_shell assert base_page.is_element_present(launch_shel_locator) is False, \ '''Check is it the button Lounch Interactiv shell''' path_into_screenshot = "C:/My/Projects/Pyscreen/" name_screen = "test" base_page.make_screenshot(path_into_screenshot, name_screen)
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''' '''---------------------------------------------------------------------------------------'''
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)