def oracle_data_prop_selection(data_props, should_be_selected): """ Checks that filter options not selected """ for data_prop in data_props: if should_be_selected: self.assertTrue( Filter.data_prop_is_selected(self.driver, data_prop)) else: self.assertFalse( Filter.data_prop_is_selected(self.driver, data_prop))
def test_A_000002(self): """ Confirms Archbold service metadata is available through HydroClient and that a sample of the data downloads successfully """ def oracle(): """ The Lake Annie Florida data can be successfully sent to the workspace, and then is processed successfully in the workspace ("completed" status) """ self.assertEqual(Workspace.count_complete(self.driver), 1) Search.search_location(self.driver, 'Lake Annie Highlands County') Services.filters(self.driver, orgs='Archbold Biological Station') Filter.open(self.driver) Filter.to_workspace_cell(self.driver, 1, 1) oracle()
def test_A_000004(self): """ Confirms the start and end date in a NWIS Unit Values data search are applied throughout search and workspace export workflow """ def oracle(): """ Start date and end date in workspace match the initial date filtering values established in the Search interface """ self.assertTrue( Workspace.is_in_results(self.driver, ['2015-12-01', '2015-12-30'], 10)) Search.search_location(self.driver, 'Tampa ') Services.filters(self.driver, titles='NWIS Unit Values') Search.filter_dates(self.driver, '12/01/2015', '12/30/2015') Filter.open(self.driver) Filter.to_workspace_text(self.driver, 'Derived Value') oracle()
def test_A_000016(self): """ Austin, TX search successfully pulls metadata, which is then viewable within the Filter Results dialog. """ def oracle(result_nums): """ Results count is between 1k and 10k, as seen from Filter Results dialog reporting """ self.assertEqual(result_nums[0], 1) # first results page is active self.assertEqual(result_nums[1], 10) # 10 results on first page self.assertTrue(1000 < result_nums[2] and result_nums[2] < 10000) Search.search_location(self.driver, "Austin, TX") Search.search(self.driver) Filter.open(self.driver) TestSystem.wait(10) result_nums = Filter.count_results(self.driver) result_nums = [int(result_num) for result_num in result_nums] oracle(result_nums)
def test_A_000025(self): """ Verifies availability of University of New Hampshire data """ def oracle_search(): """ Checks search result is greater than 8000 """ self.assertGreater(Search.count_results(self.driver), 8000) def oracle_filters(): """ Checks search results with applied filters is greater than 97 """ self.assertGreater(Search.count_results(self.driver), 97) Search.hybrid(self.driver) Search.search_location(self.driver, "new york city") Search.search(self.driver) oracle_search() Filter.open(self.driver) Filter.set_data_services( self.driver, "University of New Hampshire Environmental Research Group") oracle_filters() Search.search(self.driver) oracle_search()
def test_A_000023(self): """ Confirm workspace maximum count limits are enforced """ def oracle(): """ Checks that Ok button of warning window is displayed """ # self.assertTrue(FilterModal.ok.is_visible(self.driver)) self.assertTrue(Filter.ok_is_visible(self.driver)) Search.search_location(self.driver, "Dubai International Airport") Search.search(self.driver) Filter.open(self.driver) Filter.complex_selection_to_workspace(self.driver) Filter.close(self.driver) Search.search_location(self.driver, "Abu Dhabi") Search.search(self.driver) Filter.open(self.driver) Filter.complex_selection_to_workspace(self.driver, double=True, to_workspace=False) oracle()
def test_A_000020(self): """ Confirms sample Buffalo NY data exports successfully to the Data Series Viewer """ def oracle_processed_count(): """ The Buffalo NY three time series process successfully """ self.assertEqual(Workspace.count_complete(self.driver), 3) 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)) Search.search_location(self.driver, "Buffalo") Search.search(self.driver) Filter.open(self.driver) Filter.to_workspace_cell_range(self.driver, 1, 3) oracle_processed_count() Workspace.select_all(self.driver) Workspace.to_viewer(self.driver) Workspace.launch_tool(self.driver) TestSystem.wait(5) oracle_viewer_opened()
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 test_A_000021(self): """" Confirm the Data Series Viewer application can't be sent more than 10 time series records """ def oracle(): """ Checks that the Launch Tool is disabled """ self.assertTrue(Workspace.launch_is_disabled(self.driver)) Search.search_location(self.driver, "Panama City, Pana") Search.search(self.driver) Services.filters(self.driver, non_gridded_only=True) Search.search(self.driver) Filter.open(self.driver) Filter.show_25(self.driver) Filter.to_workspace_all(self.driver) Workspace.select_all(self.driver) Workspace.to_viewer(self.driver) TestSystem.wait(10) oracle()
def test_A_000005(self): """ Confirms metadata and data availability for the NASA Goddard Earth Sciences services, using the New Haven CT Site X416-Y130. The two associated services are NLDAS Hourly NOAH Data and NLDAS Hourly Primary Forcing Data """ def oracle(): """ The time series are sent to the workspace and processed, resulting in a "completed" status for all time series """ self.assertEqual(Workspace.count_complete(self.driver, 6), 3) Search.search_location(self.driver, 'New Haven ') Services.filters(self.driver, titles=[ 'NLDAS Hourly NOAH Data', 'NLDAS Hourly Primary Forcing Data' ]) Filter.open(self.driver) Filter.search_field(self.driver, 'X416-Y130') Filter.to_workspace_cell_multi(self.driver, [1, 5, 9]) # rows 1, 5, 9 oracle()
def oracle(): """ Checks that Ok button of warning window is displayed """ # self.assertTrue(FilterModal.ok.is_visible(self.driver)) self.assertTrue(Filter.ok_is_visible(self.driver))
def test_A_000017(self): """ Confirm Reset button clears Filter Results text and categorical filters """ def oracle_results_count(expected_results, should_match): if should_match: self.assertEqual(Search.count_results(self.driver), expected_results) else: self.assertNotEqual(Search.count_results(self.driver), expected_results) def oracle_data_prop_selection(data_props, should_be_selected): """ Checks that filter options not selected """ for data_prop in data_props: if should_be_selected: self.assertTrue( Filter.data_prop_is_selected(self.driver, data_prop)) else: self.assertFalse( Filter.data_prop_is_selected(self.driver, data_prop)) def oracle_data_service_selection(data_services, should_be_selected): """ Checks that filter options not selected """ for data_service in data_services: if should_be_selected: self.assertTrue( Filter.data_service_is_selected( self.driver, data_service)) else: self.assertFalse( Filter.data_service_is_selected( self.driver, data_service)) data_props = ["Data Type", "Sample Medium"] data_services = ["Community Collaborative Rain, Hail and Snow Network"] Search.search_location(self.driver, "Montreal ") Search.search(self.driver) expected_results = Search.count_results(self.driver) Filter.open(self.driver) Filter.selection(self.driver) Filter.close(self.driver) TestSystem.wait(5) Search.reset(self.driver) Search.search(self.driver) oracle_results_count(expected_results, should_match=True) Filter.open(self.driver) Filter.find_in_table(self.driver, "DOLLARD") oracle_results_count(expected_results, should_match=False) Search.reset(self.driver) Search.search(self.driver) oracle_results_count(expected_results, should_match=True) Filter.open(self.driver) Filter.set_data_props(self.driver, data_props) Filter.open(self.driver) Filter.set_data_services(self.driver, data_services) oracle_results_count(expected_results, should_match=False) Filter.open(self.driver) oracle_data_prop_selection(data_props, should_be_selected=True) oracle_data_service_selection(data_services, should_be_selected=True) Filter.close(self.driver) Search.reset(self.driver) Search.search(self.driver) oracle_results_count(expected_results, should_match=True) Filter.open(self.driver) oracle_data_prop_selection(data_props, should_be_selected=False) oracle_data_service_selection(data_services, should_be_selected=False)