Example #1
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()
Example #2
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)
Example #3
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()
Example #4
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()
Example #5
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()
Example #6
0
    def test_A_000024(self):
        """
        Confirms cycling of panel visibility and date filters does not
        result in result count problems
        """
        def oracle():
            """ Checks that search result is greater than 0 """
            self.assertGreater(Search.count_results(self.driver), 0)

        Search.show_hide_panel(self.driver)
        Search.show_hide_panel(self.driver)
        Search.reset(self.driver)
        Search.search(self.driver)
        Search.filter_dates(self.driver, "11/12/2018", "11/13/2018")
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle()
Example #7
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()
Example #8
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)
Example #9
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()
Example #10
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()
Example #11
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)
Example #12
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()
Example #13
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)
Example #14
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)
        Search.search(self.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)
        Search.search(self.driver)
        dallas_counts.append(Search.count_results(driver))
        oracle()
Example #15
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)