def test_A_000007(self): """ Confirms visibility of the search sidebar legend when the USGS Landcover layer is turned on. Map scope during the test is an area around Anchorage Alaska. """ def oracle(visible_expected): """ Legend is visible when Landcover layer is on, but it is not visible when the layer is off """ if visible_expected: self.assertTrue(Search.is_legend_visible(self.driver)) else: self.assertFalse(Search.is_legend_visible(self.driver)) Search.search_location(self.driver, 'Anchorage ') Search.toggle_layer(self.driver, 'USGS LandCover 2011') oracle(visible_expected=True) Search.toggle_layer(self.driver, 'USGS LandCover 2011') oracle(visible_expected=False)
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()