def test_A_000011(self): """ Confirms "About" modal dropdown links successfully open up the associated resource in a new tab and do not show a 404 Error """ def oracle(): """ None of the resource pages contain the text "404 Error" """ self.assertNotIn('404 Error', external_sources, msg='"{}" page was not found.'.format(page)) driver = self.driver page = 'Help Center' for to_helpcenter_link in [About.to_helpcenter, About.to_contact]: to_helpcenter_link(driver) external_sources = External.source_new_page(driver) External.close_new_page(driver) oracle() About.contact_close(driver) page = 'CUAHSI GitHub repository' # opens in new window About.to_license_repo_top(driver) external_sources = External.source_new_page(driver) External.close_new_page(driver) oracle() About.licensing_close(driver) # opens in the same window About.to_license_repo_inline(driver) external_sources = External.source_new_page(driver) # TODO Brian fix of _blank target inconsistency in the works # External.close_new_page(driver) oracle()
def test_A_000009(self): """ Confirms that additional help on layer control can be accessed using the Zendesk widget """ def oracle(): """ A valid help center page is opened from the Zendesk widget, and the page contains the word "Layers" """ self.assertIn('Help Center', TestSystem.title(driver)) self.assertIn('Layer', TestSystem.title(driver)) driver = self.driver Search.search_location(driver, 'San Diego') Search.search_location(driver, 'Amsterdam') num_windows_opened = len(driver.window_handles) Zendesk.to_help(driver, 'Layers', 'Using the Layer Control') External.switch_new_page(driver, num_windows_opened, ZendeskArticlePage.article_header_locator) oracle()
def test_B_000007(self): """ Confirms all apps have an associated resource page which is correctly linked and correctly listed within the app info on the apps page """ def oracle(app_name, resource_page): self.assertIn(app_name, resource_page) driver = self.driver num_windows_now = len(driver.window_handles) Home.to_apps(driver) External.switch_new_page(driver, num_windows_now, AppsPage.apps_container_locator) apps_count = Apps.count(driver) for i in range(0, apps_count): # +1 used below - xpath start at 1 app_name = Apps.get_title(driver, i + 1) Apps.show_info(driver, i + 1) Apps.to_resource(driver, i + 1) oracle(app_name, External.source_new_page(driver)) TestSystem.back(driver)
def test_A_000008(self): """ Confirms that map layer naming, as defined in the HydroClient user interface, is consistent with the Quick Start and help pages documentation """ def oracle_1(): """ Map layer naming in the Quick Start modal matches the naming within the HydroClient map search interface """ for layer in layers: self.assertIn('<li>{}</li>'.format(layer), TestSystem.page_source(driver)) def oracle_2(): """ Map layer naming in the help documentation page matches the naming within the HydroClient search interface """ for layer in layers: self.assertIn(layer, TestSystem.page_source(driver)) driver = self.driver layers = [ 'USGS Stream Gages', 'Nationalmap Hydrology', 'EPA Watersheds', 'USGS LandCover 2011' ] for layer in layers: # Turn all layer on Search.toggle_layer(driver, layer) for layer in layers: # Turn all layers off Search.toggle_layer(driver, layer) Search.to_quickstart(driver) QuickStart.section(driver, 'Using the Layer Control') oracle_1() num_windows_opened = len(driver.window_handles) QuickStart.more(driver, 'Click for more information on the Layer Control') External.switch_new_page(driver, num_windows_opened, ZendeskArticlePage.article_header_locator) oracle_2()
def test_A_000022(self): """ Confirm data series export to the Resource Creator app can be executed successfully """ def oracle_completion_count(): """ Returned results set from Trinidad is not too large """ self.assertLess(Workspace.count_complete(self.driver), 5) def oracle_resource_creator_up(): """ Resource creator seems to be functioning """ self.assertTrue(ResourceCreator.is_initialized(self.driver)) Search.search_location(self.driver, "Trinidad, Trinidad and Tobago") Search.search(self.driver) Services.search(self.driver, "World War", result_num=1) Search.search(self.driver) Filter.open(self.driver) Filter.to_workspace_all(self.driver) oracle_completion_count() Workspace.select_all(self.driver) Workspace.to_hydroshare(self.driver) num_windows_opened = len(self.driver.window_handles) Workspace.launch_tool(self.driver) External.to_file(self.driver, num_windows_opened, "HydroShare") ResourceCreator.create_resource(self.driver)
def oracle_viewer_opened(): """ The Data Series viewer application initializes and the data table near the bottom of the application is loaded """ self.assertIn('id="stat_div"', External.source_new_page(self.driver))