Ejemplo n.º 1
0
    def test_A_000019(self):
        """ Confirm empty operations on the filter modals don't affect the
        results set or the persistance of the searchbox entry """
        def oracle_search_text_is_same(text):
            """ Check if the text is the same in the search field """
            self.assertEqual(Search.get_searchbox_text(self.driver), text)

        def oracle_result(init_result):
            """ Compare search results count to the initial level """
            self.assertEqual(init_result, Search.count_results(self.driver))

        location = "NUIO üł. 54343nt, 342sf 234sdf, 12..."  # deliberately random
        Search.search_location(self.driver, location)
        Search.search(self.driver)
        init_result_count = Search.count_results(self.driver)
        Services.filters(self.driver)  # apply no services filters
        Keywords.empty_keywords(self.driver)  # no keyword filters
        Advanced.empty_advanced(self.driver)  # no advanced filters
        Search.search(self.driver)
        oracle_result(init_result_count)
        oracle_search_text_is_same(location)
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle_result(init_result_count)
        oracle_search_text_is_same(location)
Ejemplo n.º 2
0
    def test_A_000010(self):
        """ Confirms that filtering by all keywords and all data types
        returns the same number of results as if no search parameters
        were applied.  This test is applied near both the Dallas Texas
        and Rio De Janeiro Brazil areas
        """
        def oracle():
            """ A search which filters for all keywords and all data types
            returns the same number of results as a search without any
            filters
            """
            for rio_count in rio_counts:
                self.assertEqual(rio_count, rio_counts[0])
            for dallas_count in dallas_counts:
                self.assertEqual(dallas_count, dallas_counts[0])

        driver = self.driver
        rio_counts = []
        dallas_counts = []
        Search.search_location(driver, 'Rio De Janeiro')
        Keywords.filter_root(driver, ['Biological', 'Chemical', 'Physical'])
        rio_counts.append(Search.count_results(driver))
        Advanced.filter_all_value_types(driver)
        rio_counts.append(Search.count_results(driver))
        Search.reset(driver)
        rio_counts.append(Search.count_results(driver))
        Search.search_location(driver, 'Dallas')
        Keywords.filter_root(driver, ['Biological', 'Chemical', 'Physical'])
        dallas_counts.append(Search.count_results(driver))
        Advanced.filter_all_value_types(driver)
        dallas_counts.append(Search.count_results(driver))
        Search.reset(driver)
        dallas_counts.append(Search.count_results(driver))
        oracle()
Ejemplo n.º 3
0
    def test_A_000018(self):
        """ Search results for Antarctica is greater than 0 """
        def oracle():
            """ Search result is greater than zero """
            self.assertGreater(Search.count_results(self.driver), 0)

        Search.search_location(self.driver, "Antarctica")
        Search.search(self.driver)
        oracle()
Ejemplo n.º 4
0
    def test_A_000015(self):
        """ Confirms no date filters returns the same number of results as
        applying a date filter from 01/01/0100 to 01/01/9000 """
        def oracle(init_count, final_count):
            self.assertEqual(init_count, final_count)

        Search.search_location(self.driver, 'United States')
        Search.search(self.driver)
        Search.filter_dates(self.driver, '01/01/0100', '01/01/9000')
        init_count = Search.count_results(self.driver)
        Search.clear_date_filter(self.driver)
        Search.search(self.driver)
        final_count = Search.count_results(self.driver)
        oracle(init_count, final_count)
Ejemplo n.º 5
0
    def test_A_000003(self):
        """ Confirms repeated search for Lake Annie data does not result
        in problematic behavior
        """
        def oracle():
            """ 51 results are returned for a Lake Annie Florida data search,
            when the search is filtered to only include "Archbold Biological
            Center" service
            """
            self.assertIn('51', Search.count_results(self.driver))

        Search.search_location(self.driver, 'Lake Annie Highlands County')
        Services.filters(self.driver, orgs='Archbold Biological Station')
        Search.search(self.driver, 60)
        oracle()
Ejemplo n.º 6
0
    def test_A_000006(self):
        """ Confirms metadata availability and the capability to download data
        near Köln Germany
        """
        def oracle():
            """ Results are exported to workspace and number of successfully
            processed time series is above 0
            """
            self.assertNotEqual(Workspace.count_complete(self.driver), 0)

        Search.search_location(self.driver, 'Köln ')
        Search.search(self.driver)
        Search.to_random_map_marker(self.driver, 24)
        Marker.to_workspace_one(self.driver)
        oracle()
Ejemplo n.º 7
0
    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()
Ejemplo n.º 8
0
    def test_A_000012(self):
        """ Confirms repeated map scrolls, followed by a location search,
        returns nonzero results for an area which normally has nonzero
        search results.  Effectively, this test confirms that viewing
        duplicate map instances to the left and right of the main (starting)
        map instance does not cause problems during location searching.
        """
        def oracle():
            """ Results count is nonzero after map navigations and a map
            location search (in that order)
            """
            self.assertNotEqual(Search.count_results(self.driver), '0')

        Search.scroll_map(self.driver, 25)
        Search.search_location(self.driver, 'Raleigh')
        Search.search(self.driver)
        oracle()
Ejemplo n.º 9
0
    def test_A_000014(self):
        """ Confirms NLDAS data is not available over the ocean (from
        either of the two services) """
        def oracle():
            """ The results count over Cape Cod Bay (no land in view)
            is 0 after filtering for only NLDAS services
            """
            self.assertEqual(Search.count_results(self.driver), '0')

        Search.search_location(self.driver, 'Cape Cod Bay')
        Search.zoom_in(self.driver, 3)
        Services.filters(self.driver,
                         titles=[
                             'NLDAS Hourly NOAH Data',
                             'NLDAS Hourly Primary Forcing Data'
                         ])
        oracle()
Ejemplo n.º 10
0
    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()
Ejemplo n.º 11
0
    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)
Ejemplo n.º 12
0
    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()
Ejemplo n.º 13
0
    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)
Ejemplo n.º 14
0
    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()
Ejemplo n.º 15
0
    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()
Ejemplo n.º 16
0
    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()
Ejemplo n.º 17
0
    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()
Ejemplo n.º 18
0
    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()
Ejemplo n.º 19
0
    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)
Ejemplo n.º 20
0
    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)